Skip to content

Commit 1f242a0

Browse files
committed
change: add mobile placeholder
1 parent 69f32e1 commit 1f242a0

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

src/components/Scaffold/index.tsx

+38
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ import classes from "./style.module.scss";
22

33
import {
44
Box,
5+
Button,
56
Center,
67
Flex,
8+
Stack,
9+
Text,
710
} from "@mantine/core";
811

912
import { useStable } from "~/hooks/stable";
@@ -38,6 +41,10 @@ import { LegacyModal } from "./modals/legacy";
3841
import { SandboxModal } from "./modals/sandbox";
3942
import { executeUserQuery } from "~/connection";
4043
import { ChangelogModal } from "./modals/changelog";
44+
import { SurrealistLogo } from "../SurrealistLogo";
45+
import { Icon } from "../Icon";
46+
import { iconOpen } from "~/util/icons";
47+
import { isMobile } from "~/util/helpers";
4148

4249
const PORTAL_ATTRS = {
4350
attributes: {
@@ -99,6 +106,37 @@ export function Scaffold() {
99106
</Center>
100107
)}
101108

109+
{isMobile() && (
110+
<Center
111+
pos="fixed"
112+
inset={0}
113+
bg="slate.9"
114+
style={{ zIndex: 1000 }}
115+
>
116+
<Stack maw={250} mx="auto">
117+
<SurrealistLogo />
118+
119+
<Text c="bright" mt="lg">
120+
Surrealist is the ultimate way to visually manage your SurrealDB database
121+
</Text>
122+
123+
<Text c="slate.3">
124+
Support for Surrealist on mobile platforms is currently unavailable, however you can visit Surrealist
125+
on a desktop environment to get started.
126+
</Text>
127+
128+
<Button
129+
mt="lg"
130+
variant="gradient"
131+
onClick={() => adapter.openUrl("https://surrealdb.com/surrealist")}
132+
rightSection={<Icon path={iconOpen} />}
133+
>
134+
Read more about Surrealist
135+
</Button>
136+
</Stack>
137+
</Center>
138+
)}
139+
102140
<Flex
103141
direction="column"
104142
flex={1}

src/util/helpers.tsx

+8
Original file line numberDiff line numberDiff line change
@@ -363,3 +363,11 @@ export function fuzzyMatch(query: string, target: string) {
363363

364364
return regex.test(target);
365365
}
366+
367+
/**
368+
* Check if the current platform is mobile
369+
*/
370+
export function isMobile() {
371+
const userAgent = navigator.userAgent.toLowerCase();
372+
return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/.test(userAgent);
373+
}

0 commit comments

Comments
 (0)