Skip to content

Commit

Permalink
Merge pull request #41 from jun-ho-Kim/web-ui
Browse files Browse the repository at this point in the history
fix: UI 수정
  • Loading branch information
YJ-CHO-TH authored Aug 23, 2023
2 parents a9f6df2 + c4147eb commit cdbb45b
Show file tree
Hide file tree
Showing 15 changed files with 345 additions and 106 deletions.
50 changes: 50 additions & 0 deletions web/GUI/package-lock.json

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

3 changes: 3 additions & 0 deletions web/GUI/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@material-ui/core": "^4.12.4",
"@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.4",
"@mui/x-data-grid": "^6.11.1",
"@mui/x-date-pickers": "^6.11.2",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand All @@ -17,6 +19,7 @@
"@types/react-dom": "^18.2.7",
"@types/react-router-dom": "^5.3.3",
"axios": "^1.4.0",
"dayjs": "^1.11.9",
"http-proxy-middleware": "^2.0.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
18 changes: 17 additions & 1 deletion web/GUI/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}

.App-header {
background-color: #282c34;
background-color: white;
min-height: 100vh;
display: flex;
flex-direction: column;
Expand All @@ -41,6 +41,22 @@
box-sizing: border-box;
}

.Button {
border:2px solid #ff0080; /*---테두리 정의---*/
background-Color:#ffe6f2; /*--백그라운드 정의---*/
font:12px; /*--폰트 정의---*/
font-weight:bold; /*--폰트 굵기---*/
color:#ff0080; /*--폰트 색깔---*/
width:64px;
height:37px; /*--버튼 크기---*/
border-radius: 2px;
}
.Menu {
display: flex;
flex-direction: column;
color: black;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
Expand Down
4 changes: 2 additions & 2 deletions web/GUI/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import './App.css';
const Layout = () =>{
return (
<div>
<main>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"></link>
<main style={{display: 'flex', justifyContent: 'start', alignItems: 'start'}}>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"></link>
<SideBar />
<Outlet />
</main>
Expand Down
90 changes: 90 additions & 0 deletions web/GUI/src/components/header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import * as React from 'react';
import AppBar from '@mui/material/AppBar';
import Box from '@mui/material/Box';
import Toolbar from '@mui/material/Toolbar';
import Typography from '@mui/material/Typography';
import IconButton from '@mui/material/IconButton';
import MenuIcon from '@mui/icons-material/Menu';
import AccountCircle from '@mui/icons-material/AccountCircle';
import Switch from '@mui/material/Switch';
import FormControlLabel from '@mui/material/FormControlLabel';
import FormGroup from '@mui/material/FormGroup';
import MenuItem from '@mui/material/MenuItem';
import Menu from '@mui/material/Menu';

export default function MenuAppBar() {
const [auth, setAuth] = React.useState(true);
const [anchorEl, setAnchorEl] = React.useState(null);

const handleChange = (event) => {
setAuth(event.target.checked);
};

const handleMenu = (event) => {
setAnchorEl(event.currentTarget);
};

const handleClose = () => {
setAnchorEl(null);
};

return (
<Box color={'dar'} sx={{ flexGrow: 1 }}>

<AppBar position="static">
<Toolbar>
<IconButton
size="large"
edge="start"
color="inherit"
aria-label="menu"
sx={{ mr: 2}}
>
<MenuIcon />
</IconButton>
<Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
Home
</Typography>
<Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
등록 관리
</Typography>
<Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
log
</Typography>
{auth && (
<div>
<IconButton
size="large"
aria-label="account of current user"
aria-controls="menu-appbar"
aria-haspopup="true"
onClick={handleMenu}
color="inherit"
>
<AccountCircle />
</IconButton>
<Menu
id="menu-appbar"
anchorEl={anchorEl}
anchorOrigin={{
vertical: 'top',
horizontal: 'right',
}}
keepMounted
transformOrigin={{
vertical: 'top',
horizontal: 'right',
}}
open={Boolean(anchorEl)}
onClose={handleClose}
>
<MenuItem onClick={handleClose}>Profile</MenuItem>
<MenuItem onClick={handleClose}>My account</MenuItem>
</Menu>
</div>
)}
</Toolbar>
</AppBar>
</Box>
);
}
84 changes: 84 additions & 0 deletions web/GUI/src/components/popup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import Button from '@mui/material/Button';
import { styled } from '@mui/material/styles';
import Dialog from '@mui/material/Dialog';
import DialogTitle from '@mui/material/DialogTitle';
import DialogContent from '@mui/material/DialogContent';
import DialogActions from '@mui/material/DialogActions';
import IconButton from '@mui/material/IconButton';
import CloseIcon from '@mui/icons-material/Close';
import Typography from '@mui/material/Typography';

const BootstrapDialog = styled(Dialog)(({ theme }) => ({
'& .MuiDialogContent-root': {
padding: theme.spacing(2),
},
'& .MuiDialogActions-root': {
padding: theme.spacing(1),
},
}));

function BootstrapDialogTitle(props) {
const { children, onClose, ...other } = props;

return (
<DialogTitle sx={{ m: 0, p: 2 }} {...other}>
{children}
{onClose ? (
<IconButton
aria-label="close"
onClick={onClose}
sx={{
position: 'absolute',
right: 8,
top: 8,
color: (theme) => theme.palette.grey[500],
}}
>
<CloseIcon />
</IconButton>
) : null}
</DialogTitle>
);
}

BootstrapDialogTitle.propTypes = {
children: PropTypes.node,
onClose: PropTypes.func.isRequired,
};

export default function CustomizedDialogs() {
const [open, setOpen] = React.useState(false);

const handleClickOpen = () => {
setOpen(true);
};
const handleClose = () => {
setOpen(false);
};

return (
<div>
<BootstrapDialog
onClose={handleClose}
aria-labelledby="customized-dialog-title"
open={open}
>
<BootstrapDialogTitle id="customized-dialog-title" onClose={handleClose}>
test
</BootstrapDialogTitle>
<DialogContent dividers>
<Typography gutterBottom>
test desc
</Typography>
</DialogContent>
<DialogActions>
<Button autoFocus onClick={handleClose}>
OK
</Button>
</DialogActions>
</BootstrapDialog>
</div>
);
}
12 changes: 5 additions & 7 deletions web/GUI/src/components/sideBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { Link } from 'react-router-dom';
import { Navigation } from 'react-minimal-side-navigation';

import {Sidebar, Menu, MenuItem} from 'react-pro-sidebar'

import Toolbar from '@mui/material/Toolbar';
const Bar = styled.div`
position: sticky;
top: 200px;
top: 20px;
width: 10.5rem;
height: 100%;
/* position: fixed;
Expand All @@ -24,7 +24,7 @@ export const SideBar = () => {
return (
<>
<Bar>
<Sidebar className="app">
<Sidebar className="Menu">
<Menu>
<MenuItem className="menu1">
<h2>Menu</h2>
Expand All @@ -37,15 +37,13 @@ export const SideBar = () => {
<MenuItem
component={<Link to="/mng-car-num" />}
>
등록 관리(개발중)
차량 등록 관리
</MenuItem>
<MenuItem
component={<Link to="/logs" />}
>
log(개발중)
log 확인
</MenuItem>

<MenuItem> Logout </MenuItem>
</Menu>
</Sidebar>
</Bar>
Expand Down
Loading

0 comments on commit cdbb45b

Please sign in to comment.