Skip to content

Commit

Permalink
chore: update rsw
Browse files Browse the repository at this point in the history
  • Loading branch information
lencx committed Jun 26, 2022
1 parent 7155c5b commit 9d0d361
Show file tree
Hide file tree
Showing 11 changed files with 221 additions and 180 deletions.
4 changes: 3 additions & 1 deletion locales/dashboard/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"tools": "Tools",
"video": "Video",
"game": "Game",
"other": "Other"
"other": "Other",
"editor": "Editor",
"mdhub": "MdHub"
}
4 changes: 3 additions & 1 deletion locales/dashboard/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"video": "视频",
"game": "游戏",
"other": "其他",
"canvas": "画板"
"canvas": "画板",
"editor": "Editor",
"mdhub": "MdHub"
}
4 changes: 3 additions & 1 deletion locales/dashboard/zh_HK.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"video": "視頻",
"game": "遊戲",
"other": "其他",
"canvas": "畫板"
"canvas": "畫板",
"editor": "Editor",
"mdhub": "MdHub"
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
"@types/react-dom": "^18.0.0",
"@types/uuid": "^8.3.4",
"@vitejs/plugin-react": "^1.3.0",
"sass": "^1.51.0",
"sass": "^1.53.0",
"typescript": "^4.6.3",
"unocss": "^0.33.2",
"vite": "^2.9.9",
"vite-plugin-rsw": "^2.0.7",
"vite-tsconfig-paths": "^3.4.1"
"vite-plugin-rsw": "^2.0.8",
"vite-tsconfig-paths": "^3.5.0"
}
}
5 changes: 5 additions & 0 deletions src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import DashboardView from '@/views/dashboard';
import CanvasView from '@/views/canvas';
import CanvasPaperView from '@/views/canvas/paper';
import GameOfLifeView from '@/views/game_of_life';
import MdHub from '@/views/mdhub';

const routes: RouteObject[] = [
{
Expand All @@ -24,6 +25,10 @@ const routes: RouteObject[] = [
path: 'game/game-of-life',
element: <GameOfLifeView />,
},
{
path: 'mdhub',
element: <MdHub />,
},
];

export default () => {
Expand Down
5 changes: 4 additions & 1 deletion src/views/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import OmbCard, { OmbItem } from '@/components/OmbCard';
import SwitchLang from '@/components/SwitchLang';

import useI18n from '@/hooks/useI18n';
import ohmyboxIcon from '@/oh-my-box.svg';
// import ohmyboxIcon from '@/oh-my-box.svg';

export default function DashboardView() {
const t = useI18n(['dashboard', 'tools', 'game']);
Expand All @@ -16,6 +16,9 @@ export default function DashboardView() {
<OmbCard title={t('dashboard:game')}>
<OmbItem to="/game/game-of-life">{t('game:game-of-life')}</OmbItem>
</OmbCard>
<OmbCard title={t('dashboard:editor')}>
<OmbItem to="/mdhub">{t('game:mdhub')}</OmbItem>
</OmbCard>
{/* <OmbCard title={t('dashboard:video')}></OmbCard>
<OmbCard title={t('dashboard:other')}></OmbCard> */}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/views/game_of_life/index.scss
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// .game-of-life {}
// .game-of-life-view {}
2 changes: 1 addition & 1 deletion src/views/game_of_life/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function GameOfLifePage() {
}, []);

return (
<FullScreen className="game-of-life h-screen hv-center flex-col">
<FullScreen className="game-of-life-view h-screen hv-center flex-col">
<canvas id="game-of-life-canvas" />
<div className="op mt-4">
<button id="play-pause-btn" title="play-pause">
Expand Down
9 changes: 9 additions & 0 deletions src/views/mdhub/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import FullScreen from '@/layouts/FullSreen';

export default function MdHubView() {
return (
<FullScreen className="mdhub-view">
<div className="p-5">MdHub</div>
</FullScreen>
);
}
11 changes: 11 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ export default defineConfig({
tsconfigPaths(),
react(),
],
build: {
rollupOptions: {
output: {
manualChunks: {
utils: ['lodash', 'uuid', 'dayjs', 'clsx'],
react: ['react', 'react-dom', 'react-router-dom'],
i18next: ['i18next', 'react-i18next'],
}
}
}
},
esbuild: {
// [vite] warning: Top-level "this" will be replaced with undefined since this file is an ECMAScript module
// https://github.com/vitejs/vite/issues/8644
Expand Down
349 changes: 178 additions & 171 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 9d0d361

Please sign in to comment.