Skip to content

Commit

Permalink
Warn users to open friendship portal on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
hulloitskai committed Jan 17, 2025
1 parent cc1be43 commit c816530
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
15 changes: 12 additions & 3 deletions app/pages/FriendPage.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@

.highlight {
font-weight: 500;
color: light-dark(var(--mantine-color-black), var(--mantine-color-white));
text-wrap: nowrap;
}

@mixin dark {
color: var(--mantine-color-white);
}
.landingStack {
line-height: var(--mantine-line-height-xs);
color: light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1));
text-align: center;
text-wrap: pretty;
}

.landingHeadline {
color: light-dark(var(--mantine-color-black), var(--mantine-color-white));
}
12 changes: 9 additions & 3 deletions app/pages/FriendPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const FriendPage: PageComponent<FriendPageProps> = ({
statusId,
}) => {
const isStandalone = useIsStandaloneMode();
const isMobile = useMediaQuery("(pointer: coarse");
const { registration } = useWebPush();
const standaloneMode = emulateStandalone || isStandalone;
const installPromptEvent = useInstallPromptEvent();
Expand Down Expand Up @@ -100,8 +101,8 @@ const FriendPage: PageComponent<FriendPageProps> = ({
)}
{standaloneMode === false && (
<>
<Stack gap={6} lh="xs">
<Text inherit fw={700}>
<Stack gap={6} className={classes.landingStack}>
<Text inherit fw={700} className={classes.landingHeadline}>
Hi, {friend.emoji}{" "}
<span className={classes.name}>{friend.name}</span>!
</Text>
Expand Down Expand Up @@ -131,7 +132,7 @@ const FriendPage: PageComponent<FriendPageProps> = ({
<Stack gap={6} align="center">
<Button
loading={!pwaInstall}
disabled={pwaInstalled}
disabled={pwaInstalled || !isMobile}
leftSection={<PhoneIcon />}
onClick={() => {
if (pwaInstall) {
Expand All @@ -154,6 +155,11 @@ const FriendPage: PageComponent<FriendPageProps> = ({
On Android, you&apos;ll find me in your app drawer.
</Text>
)}
{!isMobile && (
<Text size="xs" c="dimmed" lh="xs">
Open this page on your phone to continue.
</Text>
)}
</Stack>
</>
)}
Expand Down

0 comments on commit c816530

Please sign in to comment.