Save server url when switching between register and login pages

This commit is contained in:
Zoe Roux 2024-03-06 22:06:00 +01:00
parent a2a3134523
commit 7c5de3c131
4 changed files with 5 additions and 4 deletions

View File

@ -22,6 +22,7 @@ import { forwardRef, ReactNode } from "react";
import { Platform, Pressable, TextProps, View, PressableProps, Linking } from "react-native";
import { TextLink, useLink } from "solito/link";
import { useTheme, useYoshiki } from "yoshiki/native";
import type { UrlObject } from "url";
import { alpha } from "./themes";
export const A = ({
@ -31,7 +32,7 @@ export const A = ({
target,
...props
}: TextProps & {
href?: string | null;
href?: string | UrlObject | null;
target?: string;
replace?: boolean;
children: ReactNode;

View File

@ -34,7 +34,6 @@ declare module "react-native" {
transitionDuration?: string;
}
interface TextProps {
href?: string;
hrefAttrs?: {
rel?: "noreferrer";
target?: string;

View File

@ -87,7 +87,8 @@ export const LoginPage: QueryPage<{ apiUrl?: string; error?: string }> = ({
/>
<P>
<Trans i18nKey="login.or-register">
Dont have an account? <A href="/register">Register</A>.
Dont have an account? <A href={{ pathname: "/register", query: { apiUrl } }}>Register</A>
.
</Trans>
</P>
</FormPage>

View File

@ -98,7 +98,7 @@ export const RegisterPage: QueryPage<{ apiUrl?: string }> = ({ apiUrl }) => {
/>
<P>
<Trans i18nKey="login.or-login">
Have an account already? <A href="/login">Log in</A>.
Have an account already? <A href={{ pathname: "/login", query: { apiUrl } }}>Log in</A>.
</Trans>
</P>
</FormPage>