Skip to content

Commit

Permalink
feat: 🎸 update list page to new version
Browse files Browse the repository at this point in the history
  • Loading branch information
HuskyHsu committed Nov 4, 2023
1 parent c199d0d commit bff16da
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 27 deletions.
1 change: 1 addition & 0 deletions public/data/moveList.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/pages/Pokedex/Pokedex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ function Pokedex() {

return (
<div className="mb-4 flex flex-col gap-y-4">
新版圖鑑清單施工中。。。
<Header
filter={filter}
abilities={abilities}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Pokedex/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function Header({
<header>
<div className="flex flex-col justify-between gap-x-2 md:flex-row md:items-center">
<div className="flex items-center gap-2">
<div className={clsx('rounded-xl p-2', 'bg-custom-blue', 'hidden md:block')}>
<div className={clsx('rounded-xl p-2', 'bg-custom-red', 'hidden md:block')}>
<Icon.Books className="h-5 w-5 fill-current" />
</div>
<h2 className="text-xl">圖鑑清單</h2>
Expand Down
29 changes: 13 additions & 16 deletions src/routers/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { lazy } from 'react';
import { Navigate, Route, Routes } from 'react-router-dom';
import MainLayout from './layouts/MainLayout';
import { LiffProvider, QueryProvider } from '@/components';
import { List, Moves, Detail } from '@/pages';
import { QueryProvider } from '@/components';
import { List, Moves } from '@/pages';
import { PokemonListProvider, BackToTopProvider } from '@/newComponents/contexts';

const Pokedex = lazy(() => import(/* webpackChunkName: "Pokedex" */ '@/pages/Pokedex/Pokedex'));
Expand All @@ -13,21 +13,18 @@ export function Router() {
<QueryProvider>
<PokemonListProvider>
<BackToTopProvider>
<LiffProvider>
<Routes>
<Route path="/" element={<MainLayout />}>
{/* 主頁 */}
<Route index element={<List />} />
<Route path="liffIsEscapedFromApp=true" element={<List />} />
<Route path="moves" element={<Moves />} />
<Route path="pm/:link" element={<Detail />} />
<Routes>
<Route path="/" element={<MainLayout />}>
{/* 主頁 */}
<Route index element={<Pokedex />} />
<Route path="pokedex" element={<Pokedex />} />
<Route path="pokedex/:nameId" element={<Pokemon />} />

<Route path="pokedex" element={<Pokedex />} />
<Route path="pokedex/:nameId" element={<Pokemon />} />
</Route>
<Route path="*" element={<Navigate to="/" />} />
</Routes>
</LiffProvider>
<Route path="oldList" element={<List />} />
<Route path="moves" element={<Moves />} />
</Route>
<Route path="*" element={<Navigate to="/" />} />
</Routes>
</BackToTopProvider>
</PokemonListProvider>
</QueryProvider>
Expand Down
10 changes: 1 addition & 9 deletions src/routers/layouts/MainLayout/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function MainLayout() {
<Item
text={'圖鑑清單'}
color="bg-custom-red"
selected={hash === ''}
selected={hash === 'pokedex' || hash === ''}
onClick={() => updateNav('')}
>
<Icon.Books className="h-5 w-5 fill-current" />
Expand All @@ -73,14 +73,6 @@ function MainLayout() {
>
<Icon.Book className="h-5 w-5 fill-current" />
</Item>
<Item
text={'施工圖鑑'}
color="bg-custom-blue"
selected={hash === 'pokedex'}
onClick={() => updateNav('pokedex')}
>
<Icon.Books className="h-5 w-5 fill-current" />
</Item>
</div>
</aside>
<div
Expand Down

0 comments on commit bff16da

Please sign in to comment.