Skip to content

Commit

Permalink
fix: sw bar style
Browse files Browse the repository at this point in the history
  • Loading branch information
dsrkafuu committed Nov 5, 2024
1 parent 9400981 commit 07e9f55
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/SW.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
display: flex;
backdrop-filter: var.$filter;

&-reverse {
margin-top: 0;
margin-bottom: var.$padding-md;
}

&-text {
flex: 1 1 auto;
min-width: 0;
Expand Down
11 changes: 9 additions & 2 deletions src/SW.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import './SW.scss';
import { useCallback } from 'react';
import clsx from 'clsx';
import { useRegisterSW } from 'virtual:pwa-register/react';
import { useTranslation } from './hooks';
import { useAppSelector, useTranslation } from './hooks';
import { logError, logInfo } from './utils/loggers';
import { IClose, IRefresh } from './assets/icons';

function SW() {
const t = useTranslation();
const layoutMode = useAppSelector((state) => state.settings.layoutMode);

const {
offlineReady: [offlineReady, setOfflineReady],
Expand All @@ -27,7 +29,12 @@ function SW() {
}, [setNeedRefresh, setOfflineReady]);

return offlineReady || needRefresh ? (
<div className='sw'>
<div
className={clsx({
sw: true,
'sw-reverse': layoutMode === 'reverse',
})}
>
<div className='sw-text'>
{offlineReady
? t('App Ready to Work Offline')
Expand Down

0 comments on commit 07e9f55

Please sign in to comment.