Skip to content

Commit

Permalink
ジェネレーターのルートページを作成
Browse files Browse the repository at this point in the history
  • Loading branch information
DekoKiyo committed Aug 30, 2024
1 parent 942ba90 commit ed6b41d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { VehicleGen } from './generators/Objects/Vehicle';
import { Toaster } from './components/ui/toaster';
import { PedGen } from './generators/Objects/Ped';
import { WeaponGen } from './generators/Objects/Weapon';
import Generators from './pages/Generators';

function App() {
return (
Expand All @@ -39,6 +40,7 @@ function App() {
path="/generators/callouts/pacific-bank-heist"
Component={PacificBankHeistGen}
/>
<Route path="/generators" Component={Generators} />
<Route path="/generators/vehicles" Component={VehicleGen} />
<Route path="/generators/peds" Component={PedGen} />
<Route path="/generators/weapons" Component={WeaponGen} />
Expand Down
2 changes: 2 additions & 0 deletions web/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,13 @@
"ped": "Ped Preset",
"weapon": "Weapon Preset",
"position": "Position Preset",
"outfit": "Outfit Preset",
"string": "String",
"int": "Integer",
"float": "Floating Point Number"
},
"generators": {
"title": "Generators",
"common": {
"require": "This value is required to generate the preset.",
"higher-than-0": "The value must be higher than zero.",
Expand Down
32 changes: 32 additions & 0 deletions web/src/pages/Generators.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router-dom';

const Generators = () => {
const { t } = useTranslation();

return (
<div className="mainContent">
<h1>{t('generators.title')}</h1>
<table>
<tbody>
<tr>
<td>
<Link to="/generators/vehicles">{t('types.vehicle')}</Link>
</td>
<td>
<Link to="/generators/peds">{t('types.ped')}</Link>
</td>
<td>
<Link to="/generators/weapons">{t('types.weapon')}</Link>
</td>
<td>
<Link to="/generators/outfits">{t('types.outfit')}</Link>
</td>
</tr>
</tbody>
</table>
</div>
);
};

export default Generators;
3 changes: 3 additions & 0 deletions web/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ const Home = () => {
<td>
<Link to="/callouts">{t('callouts.title')}</Link>
</td>
<td>
<Link to="/generators">{t('generators.title')}</Link>
</td>
</tr>
</tbody>
</table>
Expand Down

0 comments on commit ed6b41d

Please sign in to comment.