mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
refactor
This commit is contained in:
@@ -7,11 +7,16 @@ import IOSShareIcon from './IOSShareIcon'
|
|||||||
import { StyledWrapper, StyledHeader, StyledContent } from './style'
|
import { StyledWrapper, StyledHeader, StyledContent } from './style'
|
||||||
|
|
||||||
export function PWAInstallationGuide() {
|
export function PWAInstallationGuide() {
|
||||||
const [isOpen, setIsOpen] = useState(!JSON.parse(localStorage.getItem('pwaNotificationIsClosed')))
|
const pwaNotificationIsClosed = JSON.parse(localStorage.getItem('pwaNotificationIsClosed'))
|
||||||
|
const [isOpen, setIsOpen] = useState(!pwaNotificationIsClosed)
|
||||||
|
const [shouldBeOpened, setShouldBeOpened] = useState(!pwaNotificationIsClosed)
|
||||||
|
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
||||||
|
if (!isOpen) return null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledWrapper isOpen={isOpen}>
|
<StyledWrapper isOpen={shouldBeOpened}>
|
||||||
<StyledHeader>
|
<StyledHeader>
|
||||||
<img src='/apple-icon-180.png' width={50} alt='ts-icon' />
|
<img src='/apple-icon-180.png' width={50} alt='ts-icon' />
|
||||||
|
|
||||||
@@ -22,8 +27,12 @@ export function PWAInstallationGuide() {
|
|||||||
aria-label='close'
|
aria-label='close'
|
||||||
color='inherit'
|
color='inherit'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsOpen(false)
|
setShouldBeOpened(false)
|
||||||
localStorage.setItem('pwaNotificationIsClosed', true)
|
|
||||||
|
setTimeout(() => {
|
||||||
|
setIsOpen(false)
|
||||||
|
localStorage.setItem('pwaNotificationIsClosed', true)
|
||||||
|
}, 300)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CloseIcon fontSize='small' />
|
<CloseIcon fontSize='small' />
|
||||||
|
|||||||
Reference in New Issue
Block a user