2023-08-18 13:58:29 -04:00
|
|
|
import { Dialog } from '@headlessui/react'
|
|
|
|
import { ActionButton } from './ActionButton'
|
2024-04-05 00:30:11 -04:00
|
|
|
import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext'
|
|
|
|
import { useState } from 'react'
|
2023-08-18 13:58:29 -04:00
|
|
|
|
2023-08-18 10:27:01 -04:00
|
|
|
const DownloadAppBanner = () => {
|
2024-04-05 00:30:11 -04:00
|
|
|
const { settings } = useSettingsAuthContext()
|
|
|
|
const [isBannerDismissed, setIsBannerDismissed] = useState(
|
|
|
|
settings.context.app.dismissWebBanner.current
|
|
|
|
)
|
2023-08-18 13:58:29 -04:00
|
|
|
|
2023-08-18 10:27:01 -04:00
|
|
|
return (
|
2023-08-18 13:58:29 -04:00
|
|
|
<Dialog
|
2023-12-14 15:48:06 -05:00
|
|
|
className="fixed inset-0 z-50"
|
2023-08-18 13:58:29 -04:00
|
|
|
open={!isBannerDismissed}
|
|
|
|
onClose={() => ({})}
|
|
|
|
>
|
2023-12-14 15:48:06 -05:00
|
|
|
<Dialog.Overlay className="fixed inset-0 bg-chalkboard-100/50" />
|
|
|
|
<Dialog.Panel className="absolute inset-0 top-auto bg-warn-20 text-warn-80 px-8 py-4">
|
|
|
|
<div className="max-w-3xl mx-auto">
|
|
|
|
<div className="flex gap-2 justify-between items-start">
|
|
|
|
<h2 className="text-xl font-bold mb-4">
|
2023-12-19 14:19:34 -05:00
|
|
|
Modeling App is better as a desktop app!
|
2023-12-14 15:48:06 -05:00
|
|
|
</h2>
|
|
|
|
<ActionButton
|
|
|
|
Element="button"
|
2024-04-05 00:30:11 -04:00
|
|
|
onClick={() => setIsBannerDismissed(true)}
|
2024-05-10 19:02:11 -04:00
|
|
|
iconStart={{
|
2023-12-14 15:48:06 -05:00
|
|
|
icon: 'close',
|
|
|
|
className: 'p-1',
|
|
|
|
bgClassName:
|
|
|
|
'bg-warn-70 hover:bg-warn-80 dark:bg-warn-70 dark:hover:bg-warn-80',
|
|
|
|
iconClassName:
|
|
|
|
'text-warn-10 group-hover:text-warn-10 dark:text-warn-10 dark:group-hover:text-warn-10',
|
|
|
|
}}
|
|
|
|
className="!p-0 !bg-transparent !border-transparent"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<p>
|
|
|
|
The browser version of the app only saves your data temporarily in{' '}
|
|
|
|
<code className="text-base inline-block px-0.5 bg-warn-30/50 rounded">
|
|
|
|
localStorage
|
|
|
|
</code>
|
|
|
|
, and isn't backed up anywhere! Visit{' '}
|
|
|
|
<a
|
2023-12-18 06:15:26 -05:00
|
|
|
href="https://zoo.dev/modeling-app/download"
|
2023-12-14 15:48:06 -05:00
|
|
|
rel="noopener noreferrer"
|
|
|
|
target="_blank"
|
|
|
|
className="!text-warn-80 dark:!text-warn-80 dark:hover:!text-warn-70 underline"
|
|
|
|
>
|
|
|
|
our website
|
|
|
|
</a>{' '}
|
|
|
|
to download the app for the best experience.
|
|
|
|
</p>
|
2024-04-05 00:30:11 -04:00
|
|
|
<p className="mt-6">
|
|
|
|
If you're on Linux and the browser is your only way to use the app,
|
|
|
|
you can permanently dismiss this banner by{' '}
|
|
|
|
<a
|
|
|
|
onClick={() => {
|
|
|
|
setIsBannerDismissed(true)
|
|
|
|
settings.send({
|
|
|
|
type: 'set.app.dismissWebBanner',
|
|
|
|
data: { level: 'user', value: true },
|
|
|
|
})
|
|
|
|
}}
|
|
|
|
href="/"
|
|
|
|
className="!text-warn-80 dark:!text-warn-80 dark:hover:!text-warn-70 underline"
|
|
|
|
>
|
|
|
|
toggling the App > Dismiss Web Banner setting
|
|
|
|
</a>
|
|
|
|
.
|
|
|
|
</p>
|
2023-08-18 13:58:29 -04:00
|
|
|
</div>
|
|
|
|
</Dialog.Panel>
|
|
|
|
</Dialog>
|
2023-08-18 10:27:01 -04:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default DownloadAppBanner
|