Faisal Amir b0c6779015
feat: app updater with changelog (#4631)
* feat: ui modal app updater with changelog

* chore: update action when click update now

* chore: update handler actions

* chore: fix linter
2025-02-17 12:08:08 +07:00

58 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React, { useEffect, useState } from 'react'
import { Button, Modal } from '@janhq/joi'
import { useAtom } from 'jotai'
import LogoMark from '../Brand/Logo/Mark'
import { appUpdateNotAvailableAtom } from '@/helpers/atoms/App.atom'
const ModalAppUpdaterNotAvailable = () => {
const [appUpdateNotAvailable, setAppUpdateNotAvailable] = useAtom(
appUpdateNotAvailableAtom
)
const [open, setOpen] = useState(appUpdateNotAvailable)
useEffect(() => {
setOpen(appUpdateNotAvailable)
}, [appUpdateNotAvailable])
return (
<Modal
hideClose={true}
title={
<>
<div className="flex items-center gap-x-2">
<LogoMark width={40} height={40} />
<h6>App Update</h6>
</div>
</>
}
open={open}
onOpenChange={() => setOpen(!open)}
content={
<div className="mt-3">
<p className="mt-2 text-sm font-normal">
Youre up to date! No new updates available
</p>
<div className="mt-4 flex items-center justify-end gap-x-2">
<Button
autoFocus
onClick={() => {
setOpen(false)
setAppUpdateNotAvailable(false)
}}
>
Check back later
</Button>
</div>
</div>
}
/>
)
}
export default ModalAppUpdaterNotAvailable