Skip to content

Commit

Permalink
簡易的なドロワーの追加
Browse files Browse the repository at this point in the history
  • Loading branch information
Shugo Kawamura committed Aug 12, 2023
1 parent 9729fa2 commit c586ebd
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 5 deletions.
2 changes: 2 additions & 0 deletions front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
"@emotion/styled": "^11.11.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@heroicons/react": "^2.0.18",
"@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.4",
"@types/react-dom": "18.2.7",
"Groups": "link:@mui/icons-material/Groups",
"autoprefixer": "10.4.14",
"cross-fetch": "^4.0.0",
"eslint": "8.47.0",
Expand Down
23 changes: 23 additions & 0 deletions front/pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions front/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { Inter } from 'next/font/google'
const inter = Inter({ subsets: ['latin'] })

export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
title: 'get5loader',
description: 'get5loader Management Panel',
}

export default function RootLayout({
Expand Down
58 changes: 55 additions & 3 deletions front/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,59 @@
'use client'

import React from 'react';
import Drawer from '@mui/material/Drawer';
import Box from '@mui/material/Box';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemButton from '@mui/material/ListItemButton';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
import GroupsIcon from '@mui/icons-material/Groups';
import DnsIcon from '@mui/icons-material/Dns';

type menuListProps = {
onSelected:(key:string) => void
}

const MenuList = (props:menuListProps) => {
return (
<Box
role="presentation"
>
<List>
<ListItem disablePadding>
<ListItemButton onClick={()=>{props.onSelected("matches")}}>
<ListItemIcon>
<GroupsIcon />
</ListItemIcon>
<ListItemText primary="MATCHES" />
</ListItemButton>
</ListItem>
<ListItem disablePadding>
<ListItemButton onClick={()=>{props.onSelected("servers")}}>
<ListItemIcon>
<DnsIcon />
</ListItemIcon>
<ListItemText primary="SERVERS" />
</ListItemButton>
</ListItem>
</List>
</Box>
)
};

function MenuDrawer() {
const [selected, setSelected] = React.useState<string>("matches")
return (
<Drawer open={true}>
<MenuList onSelected={setSelected} />
{selected}
</Drawer>
)
}

export default function Home() {
return (
<main>
<h1>get5loader</h1>
</main>
<MenuDrawer />
)
}

0 comments on commit c586ebd

Please sign in to comment.