-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d465a85
commit baf3cb5
Showing
14 changed files
with
87 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters