Skip to content

Commit

Permalink
Add in-app create account browser for native builds (#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding authored Aug 3, 2023
1 parent f0466e6 commit e82fc8d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/features/auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ import TermsSheet from "../settings/terms/TermsSheet";
import { preventPhotoswipeGalleryFocusTrap } from "../gallery/GalleryImg";
import { getCustomServers } from "../../services/app";
import { isNative } from "../../helpers/device";
import { Browser } from "@capacitor/browser";

const JOIN_LEMMY_URL = "https://join-lemmy.org/instances";

export const Spinner = styled(IonSpinner)`
width: 1.5rem;
Expand Down Expand Up @@ -299,9 +302,16 @@ export default function Login({

<HelperText>
<IonRouterLink
href="https://join-lemmy.org/instances"
href={JOIN_LEMMY_URL}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => {
if (!isNative()) return;

e.preventDefault();

Browser.open({ url: JOIN_LEMMY_URL });
}}
>
<IonText color="primary">Don&apos;t have an account?</IonText>
</IonRouterLink>
Expand Down

0 comments on commit e82fc8d

Please sign in to comment.