Skip to content

Commit

Permalink
feat : register finish
Browse files Browse the repository at this point in the history
  • Loading branch information
bicco2 committed Jul 20, 2022
1 parent 79ca095 commit 473c2b1
Show file tree
Hide file tree
Showing 5 changed files with 178 additions and 154 deletions.
14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
version: "3"

services:
backend:
build: ./backend
command: ["python","manage.py","runserver","0.0.0.0:8080"]
ports:
- 8080:8080
volumes:
- ./backend:/app
# backend:
# build: ./backend
# command: ["python","manage.py","runserver","0.0.0.0:8080"]
# ports:
# - 8080:8080
# volumes:
# - ./backend:/app
frontend:
build: ./frontend
command: ["npm", "start"]
Expand Down
23 changes: 1 addition & 22 deletions frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,14 @@
name="description"
content="Web site created using create-react-app"
/>

<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->

<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
1 change: 0 additions & 1 deletion frontend/src/Page/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ function Login() {
sx={{ mr: -0.5 }}
control={
<Checkbox
defaultChecked
size="small"
sx={{
mr: -1,
Expand Down
90 changes: 52 additions & 38 deletions frontend/src/component/Mypage/MultiActionAreaCard.jsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,60 @@
import * as React from 'react';
import { Button, CardActionArea, CardActions,Card,CardMedia,Typography,styled } from '@mui/material';
import * as React from "react";
import {
Button,
CardActionArea,
CardActions,
Card,
CardMedia,
Typography,
styled,
} from "@mui/material";

const MyTrashcanBtn = styled(Button)(({}) => ({
backgroundColor: "#76F2BE",
backgroundColor: "#76F2BE",
borderColor: "#76F2BE",
"&:hover": {
color: "black",
backgroundColor: "white",
borderColor: "#76F2BE",
"&:hover": {
color:"black",
backgroundColor: "white",
borderColor: "#76F2BE",
},
},
}));

export default function MultiActionAreaCard() {
export default function MultiActionAreaCard(props) {
return (
<Card
sx={{ maxWidth: 200, border: 1, margin:2 }}>
<CardActionArea>
<CardMedia
component="img"
height="170"
image='https://picsum.photos/400/300'
style={{padding:3, borderRadius:8}}
/>
<Typography
fontWeight={"bold"} fontSize={20} component="div" marginTop={1} align="center">
물병
</Typography>
</CardActionArea>
<CardActions >
<MyTrashcanBtn
variant="outlined"
sx={{
margin:"auto",
fontSize:3,
width:30,
height:20,
bgcolor : "#76F2BE",
borderColor:"#76F2BE",
color: "black"}}>
더보기
</MyTrashcanBtn>
</CardActions>
<Card sx={{ maxWidth: 200, border: 1, margin: 2 }}>
<CardActionArea>
<CardMedia
component="img"
height="170"
image={props.imgURL}
style={{ padding: 3, borderRadius: 8 }}
/>
<Typography
fontWeight={"bold"}
fontSize={20}
component="div"
marginTop={1}
align="center"
>
{props.imgID}
</Typography>
</CardActionArea>
<CardActions>
<MyTrashcanBtn
variant="outlined"
sx={{
margin: "auto",
fontSize: 3,
width: 30,
height: 20,
bgcolor: "#76F2BE",
borderColor: "#76F2BE",
color: "black",
}}
>
더보기
</MyTrashcanBtn>
</CardActions>
</Card>
);
}
}
204 changes: 118 additions & 86 deletions frontend/src/component/Mypage/MyTrashcan.jsx
Original file line number Diff line number Diff line change
@@ -1,99 +1,131 @@
import * as React from "react";
import { alpha, createTheme } from "@mui/material/styles";
import {
Box,
Typography,
Container,
styled,
Switch,
} from "@mui/material";
import { Box, Typography, Container, styled, Switch } from "@mui/material";
import MultiActionAreaCard from "./MultiActionAreaCard";

import axios from "axios";
import { useState, useEffect } from "react";

const GreenSwitch = styled(Switch)(({ theme }) => ({
'& .MuiSwitch-switchBase.Mui-checked': {
color: "#76F2BE",
'&:hover': {
backgroundColor: alpha("#76F2BE", theme.palette.action.hoverOpacity),
},
},
'& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track': {
backgroundColor: "white",
"& .MuiSwitch-switchBase.Mui-checked": {
color: "#76F2BE",
"&:hover": {
backgroundColor: alpha("#76F2BE", theme.palette.action.hoverOpacity),
},
}));
},
"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track": {
backgroundColor: "white",
},
}));

function MyTrashcan() {
return(
<Container
style={{
border: "solid",
borderRadius: 5,
borderColor:"transparent",
minWidth: "100%",
height: "100vh",
}}>
<Box
sx={{
display: "flex",
flexDirection: "row",
justifyContent: "space-between"
}}>
<Typography
color="black"
fontWeight="bold"
sx={{mt: 1.2,
mb: 1,
fontSize: "medium"}}>
내 분리수거함
</Typography>
<Box
sx={{
display: "flex",
flexDirection: "row",
}}>
<Typography
color="black"
sx={{mt: 2,
mb: 1,
fontSize: 2}}>
사진 자동으로 추가
</Typography>
<GreenSwitch
defaultChecked size="small"
style={{ color: "primary", backgoundColor: "#E7F5EF"}}
inputProps={{ 'aria-label': 'controlled' }}
sx={{mt: 1.5,}}
/>
</Box>
</Box>
<Container
style={{
backgroundColor: "white",
border: "solid",
borderRadius: 5,
borderColor: "white",
height: "100vh",
pt:2, pb:2}}>
<Box
sx={{
display: "flex",
flexWrap: "wrap",
alignItems: "center",
justifyContent: "space-evenly"
}}>
<MultiActionAreaCard />
<MultiActionAreaCard />
<MultiActionAreaCard />
<MultiActionAreaCard />
<MultiActionAreaCard />
<MultiActionAreaCard />
const [loading, setLoading] = useState(false);
const [trashList, setTrashList] = useState([]);

const onLoadTrashList = async () => {
try {
// 요청이 시작 할 때에는 error 와 users 를 초기화하고
// setError(null);
// setUsers(null);
// loading 상태를 true 로 바꿉니다.
setLoading(true);
const response = await axios.get(
"http://localhost:8080/trash/mypage/users/173dc2de-7076-40cf-a211-f3eca7aa9b4d/images"
);
setTrashList(response.data);
// console.log(response.data);
// console.log(trashList);
} catch (e) {
console.log("An error occured : ", e);
}
setLoading(false);
};

useEffect(() => {
onLoadTrashList();
}, []);

if (loading) return <div>로딩중..</div>;

</Box>
</Container>

</Container>
// console.log("data : ", trashList);

);
return (
<Container
style={{
border: "solid",
borderRadius: 5,
borderColor: "transparent",
minWidth: "100%",
height: "100vh",
}}
>
<Box
sx={{
display: "flex",
flexDirection: "row",
justifyContent: "space-between",
}}
>
<Typography
color="black"
fontWeight="bold"
sx={{ mt: 1.2, mb: 1, fontSize: "medium" }}
>
내 분리수거함
</Typography>
<Box
sx={{
display: "flex",
flexDirection: "row",
}}
>
<Typography color="black" sx={{ mt: 2, mb: 1, fontSize: 2 }}>
사진 자동으로 추가
</Typography>
<GreenSwitch
defaultChecked
size="small"
style={{ color: "primary", backgoundColor: "#E7F5EF" }}
inputProps={{ "aria-label": "controlled" }}
sx={{ mt: 1.5 }}
/>
</Box>
</Box>
<Container
style={{
backgroundColor: "white",
border: "solid",
borderRadius: 5,
borderColor: "white",
height: "100vh",
pt: 2,
pb: 2,
}}
>
<Box
sx={{
display: "flex",
flexWrap: "wrap",
alignItems: "center",
justifyContent: "space-evenly",
}}
>
{/* <MultiActionAreaCard />
<MultiActionAreaCard />
<MultiActionAreaCard />
<MultiActionAreaCard />
<MultiActionAreaCard />
<MultiActionAreaCard /> */}
{trashList?.map((trash) => (
<MultiActionAreaCard
key={trash.uploaded_trash_image_id}
imgURL={trash.img}
imgID={trash.uploaded_trash_image_id}
/>
))}
</Box>
</Container>
</Container>
);
}

export default MyTrashcan;

0 comments on commit 473c2b1

Please sign in to comment.