Skip to content

Commit

Permalink
@fepack/image
Browse files Browse the repository at this point in the history
  • Loading branch information
tooooo1 committed Jul 28, 2024
1 parent 3df20ed commit cd2b9dc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"license": "MIT",
"dependencies": {
"@emotion/react": "^11.13.0",
"@fepack/image": "^0.2.6",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.25.1"
Expand Down
7 changes: 7 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Logo } from './components';
import { ROUTES } from './constants';
import { End, Home, Mode, Play, Ready } from './pages';
import { GlobalStyle } from './styles/GlobalStyle';
import { load, checkWebPSupport } from '@fepack/image';

const router = createBrowserRouter([
{ path: ROUTES.HOME, element: <Home /> },
Expand All @@ -18,6 +19,16 @@ const router = createBrowserRouter([
{ path: '*', element: <Navigate replace to={ROUTES.HOME} /> },
]);

const checkWebPSupportAndLoad = async () => {
if (await checkWebPSupport()) {
load('images/information_resize.webp');
load('images/options_resize.webp');
load('images/boxing-gloves_resize.webp');
}
};

checkWebPSupportAndLoad();

const App = () => (
<>
<GlobalStyle />
Expand Down

0 comments on commit cd2b9dc

Please sign in to comment.