diff --git a/src/components/UnderConstruction/UnderConstruction.tsx b/src/components/UnderConstruction/UnderConstruction.tsx index 8e9c459..9d37932 100644 --- a/src/components/UnderConstruction/UnderConstruction.tsx +++ b/src/components/UnderConstruction/UnderConstruction.tsx @@ -3,7 +3,7 @@ import { Card, CardContent, CardHeader, CardTitle } from '~/ui'; export const UnderConstruction: React.FC = () => { return ( - + Hold on a second! @@ -15,7 +15,7 @@ export const UnderConstruction: React.FC = () => { color='#e4ec75' strokeWidth={1.2} /> -

+

This page is under construction, check back soon

diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 91bbff2..146b7c8 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,4 +1,14 @@ import { type ClassValue, clsx } from 'clsx'; +import { headers } from 'next/headers'; +import { userAgentFromString } from 'next/server'; import { twMerge } from 'tailwind-merge'; export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs)); + +export const isMobile = async (): Promise => { + const headersList = await headers(); + const userAgent = headersList.get('user-agent') || ''; + const agent = userAgentFromString(userAgent); + + return agent?.device?.type === 'mobile'; +}; diff --git a/src/routes/Home.tsx b/src/routes/Home.tsx index dad1b17..edff7a7 100644 --- a/src/routes/Home.tsx +++ b/src/routes/Home.tsx @@ -1,13 +1,19 @@ import { UnderConstruction } from '~/components'; +import { isMobile } from '~/lib/utils'; import { VantaNet } from '~/ui'; -export const Home = () => { +export const Home = async () => { + const mobile = await isMobile(); + return (