Skip to content

Commit

Permalink
ready
Browse files Browse the repository at this point in the history
  • Loading branch information
noahlitvin committed Jan 19, 2025
1 parent d465a85 commit baf3cb5
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 129 deletions.
2 changes: 0 additions & 2 deletions packages/app/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"name": "Foil",
"short_name": "Foil",
"description": "The fully decentralized marketplace for onchain resources",
"start_url": "https://app.foil.xyz",
"scope": "https://app.foil.xyz/",
"display": "standalone",
"background_color": "#FFFFFF",
"theme_color": "#2C2C2E",
Expand Down
2 changes: 2 additions & 0 deletions packages/app/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Providers from '~/app/providers';
import '@rainbow-me/rainbowkit/styles.css';
import '../lib/styles/globals.css';
import { LoadingSpinner } from '~/lib/components/foil/loadingSpinner';
import { InstallDialog } from '~/lib/components/InstallDialog';
import { LoadingProvider } from '~/lib/context/LoadingContext';
import { Toaster } from '@/components/ui/toaster';
import Layout from '~/lib/layout';
Expand Down Expand Up @@ -61,6 +62,7 @@ const RootLayout = ({ children }: RootLayoutProps) => {
<LoadingProvider>
<LoadingSpinner />
<Layout>{children}</Layout>
<InstallDialog />
<Toaster />
</LoadingProvider>
</Providers>
Expand Down
75 changes: 75 additions & 0 deletions packages/app/src/lib/components/InstallDialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
'use client';

import { Share, PlusSquare } from 'lucide-react';
import Image from 'next/image';
import { useEffect, useState } from 'react';

import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
} from '@/components/ui/dialog';

export const InstallDialog = () => {
const [isOpen, setIsOpen] = useState(false);

useEffect(() => {
// Check if we're on mobile and not in standalone mode
const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
const isStandalone = window.matchMedia(
'(display-mode: standalone)'
).matches;

if (isMobile && !isStandalone) {
setIsOpen(true);
}
}, []);

return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogContent>
<div className="mx-auto w-full max-w-sm">
<DialogHeader className="mb-6">
<div className="my-4 flex justify-center">
<Image
src="/icons/icon-192x192.png"
alt="Foil App Icon"
width={72}
height={72}
className="rounded-2xl border border-border shadow-lg"
/>
</div>
<DialogTitle className="text-center text-2xl">
Install Foil
</DialogTitle>
<DialogDescription>
Add the app to your home screen
</DialogDescription>
</DialogHeader>
<div className="space-y-4 rounded-lg bg-muted px-4 py-8 text-center">
<div className="space-y-2">
<p className="text-lg">
Tap the{' '}
<span className="mx-0.5 inline-flex translate-y-[3px] items-center">
<Share className="h-5 w-5" />
</span>{' '}
share icon in your browser
</p>
</div>
<div className="space-y-2">
<p className="text-lg">
Select{' '}
<span className="mx-0.5 inline-flex translate-y-[3px] items-center">
<PlusSquare className="h-5 w-5" />
</span>{' '}
Add to Home Screen
</p>
</div>
</div>
</div>
</DialogContent>
</Dialog>
);
};
Binary file removed packages/website/public/icons/icon-128x128.png
Binary file not shown.
Binary file removed packages/website/public/icons/icon-144x144.png
Binary file not shown.
Binary file removed packages/website/public/icons/icon-152x152.png
Binary file not shown.
Binary file removed packages/website/public/icons/icon-192x192.png
Binary file not shown.
Binary file removed packages/website/public/icons/icon-384x384.png
Binary file not shown.
Binary file removed packages/website/public/icons/icon-512x512.png
Binary file not shown.
Binary file removed packages/website/public/icons/icon-72x72.png
Binary file not shown.
Binary file removed packages/website/public/icons/icon-96x96.png
Binary file not shown.
61 changes: 0 additions & 61 deletions packages/website/public/manifest.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/website/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export const metadata: Metadata = {
title: APP_NAME,
description: APP_DESCRIPTION,
applicationName: APP_NAME,
manifest: '/manifest.json',
appleWebApp: {
capable: true,
title: APP_NAME,
Expand Down
75 changes: 10 additions & 65 deletions packages/website/src/lib/layout/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@

import Image from 'next/image';
import { Button } from '@/components/ui/button';
import {
Drawer,
DrawerContent,
DrawerFooter,
DrawerHeader,
DrawerTitle,
DrawerTrigger,
} from '@/components/ui/drawer';
import { Share, PlusSquare } from 'lucide-react';

export const Header = () => {
return (
Expand All @@ -24,66 +15,20 @@ export const Header = () => {
>
Docs
</a>
{/* Desktop button */}
<Button
asChild
className="hidden rounded-2xl p-6 font-semibold md:flex"
className="flex items-center rounded-2xl p-6 font-semibold"
>
<a href="https://app.foil.xyz">Go to App</a>
<a href="https://app.foil.xyz" className="hidden md:inline-flex">
Go to App
</a>
</Button>
<Button
asChild
className="flex items-center rounded-2xl p-6 font-semibold md:hidden"
>
<a href="https://app.foil.xyz">Install App</a>
</Button>
{/* Mobile install button with drawer */}
<div className="md:hidden">
<Drawer>
<DrawerTrigger asChild>
<Button className="rounded-2xl p-6 font-semibold">
Install App
</Button>
</DrawerTrigger>
<DrawerContent>
<div className="mx-auto w-full max-w-sm">
<DrawerHeader>
<div className="my-4 flex justify-center">
<Image
src="/icons/icon-192x192.png"
alt="Foil App Icon"
width={72}
height={72}
className="rounded-2xl border border-border shadow-lg"
/>
</div>
<DrawerTitle className="text-center text-2xl">
Install Foil
</DrawerTitle>
<p className="text-center text-muted-foreground">
Add the app to your home screen
</p>
</DrawerHeader>
<DrawerFooter>
<div className="space-y-4 rounded-lg bg-muted px-4 py-8 text-center">
<div className="space-y-2">
<p className="text-lg">
Tap the{' '}
<span className="mx-0.5 inline-flex translate-y-[3px] items-center">
<Share className="h-5 w-5" />
</span>{' '}
share icon in your browser
</p>
</div>
<div className="space-y-2">
<p className="text-lg">
Select{' '}
<span className="mx-0.5 inline-flex translate-y-[3px] items-center">
<PlusSquare className="h-5 w-5" />
</span>{' '}
Add to Home Screen
</p>
</div>
</div>
</DrawerFooter>
</div>
</DrawerContent>
</Drawer>
</div>
</div>
</section>
</header>
Expand Down

0 comments on commit baf3cb5

Please sign in to comment.