diff --git a/src/pages/study/Listpage.js b/src/pages/study/Listpage.js index e891a91..96e5828 100644 --- a/src/pages/study/Listpage.js +++ b/src/pages/study/Listpage.js @@ -1,76 +1,143 @@ -import * as React from "react"; -import {Card,CardContent,CardMedia} from "@mui/material"; -import CssBaseline from "@mui/material/CssBaseline"; -import {Grid,Typography,Container} from "@mui/material"; -import { createTheme, ThemeProvider } from "@mui/material/styles"; -import { Link } from "react-router-dom"; +import * as React from 'react'; +import { Card, CardContent, CardMedia, TextField, Button } from '@mui/material'; +import CssBaseline from '@mui/material/CssBaseline'; +import { Grid, Typography, Container, Box } from '@mui/material'; +import { createTheme, ThemeProvider } from '@mui/material/styles'; +import EditIcon from '@mui/icons-material/Edit'; +import { Link } from 'react-router-dom'; + + +// 포스팅 글 -> detail 폴더에 작성 + +const cardData = [ + { + id: 1, + imageUrl: "https://images.mypetlife.co.kr/content/uploads/2023/11/17133418/61fbb115-3845-4427-b72d-76c5e650cd3c.jpeg", + title: "Card Title 1", + content: "Card content 1", + }, + { + id: 2, + imageUrl: "https://source.unsplash.com/random?sig=2", + title: "Card Title 2", + content: "Card content 2", + }, + { + id: 3, + imageUrl: "https://source.unsplash.com/random?sig=3", + title: "Card Title 3", + content: "Card content 3", + }, + { + id: 4, + imageUrl: "https://source.unsplash.com/random?sig=4", + title: "Card Title 4", + content: "Card content 4", + }, +]; -const cards = [1, 2, 3, 4, 5, 6, 7, 8, 9]; -// TODO remove, this demo shouldn't need to reset the theme. const defaultTheme = createTheme(); + function Listpage() { + + const backgroundImage = 'https://miro.medium.com/v2/resize:fit:1200/1*6Jp3vJWe7VFlFHZ9WhSJng.jpeg'; + //const backgroundImage = 'https://i0.wp.com/www.oxbridgeacademy.edu.za/blog/wp-content/uploads/2015/07/CN63QSUO8C.jpg?resize=1280%2C640&ssl=1'; + return ( - -
- {/* Hero unit */} - - {/* End hero unit */} - - {cards.map((card) => ( - - - - {/* 포스터 클릭 시 DetailPage로 이동하는 링크 */} - - -
- - 제목 {card} {/* 각 카드에 다른 제목을 표시 */} - - User ID {card} -
-
- -
-
- ))} -
-
-
-
+ + + {/* Background image with transparency */} + + {/* Search bar container */} + + + + + + + + + + {/* Posts cards container */} + + + {cardData.map((card) => ( + + + + + + + {card.title} + + {card.content} + + + + + ))} + + + + + + + + + + + + +
); } -export default Listpage; +export default Listpage; \ No newline at end of file diff --git a/src/pages/study/detail/1.js b/src/pages/study/detail/1.js new file mode 100644 index 0000000..67eb743 --- /dev/null +++ b/src/pages/study/detail/1.js @@ -0,0 +1,56 @@ +import React from 'react'; +import { useParams } from 'react-router-dom'; +import { useLocation } from 'react-router-dom'; +import styled from "styled-components"; + +const DetailPageEx = ({title,date,content,tag}) => { + const location = useLocation(); + const { postId } = useParams(); + + return( + <> +

{title}

+

{date}

+

Posted By   Greek{postId}

+ +
+ {/* Content : 글, 그림 등등등*/} +

{content}

+ +

{tag}

+ + + ) + + +} + +export default DetailPageEx; + +const Title = styled.h1` + font-size: 2rem; + text:bold; + text-align:center; +`; + +const Date = styled.p` + font-size: 1rem; + text-align:right; +`; + +const PostId = styled.p` + font-size: 1.2rem; + text:bold +`; + +const Tag = styled.p` + font-size: 1rem; + text:bold; + color: blue; + margin-top:12rem; +`; + +const Content = styled.p` + font-size: 1rem; + text:bold +`; diff --git a/src/pages/study/detail/2.js b/src/pages/study/detail/2.js new file mode 100644 index 0000000..67eb743 --- /dev/null +++ b/src/pages/study/detail/2.js @@ -0,0 +1,56 @@ +import React from 'react'; +import { useParams } from 'react-router-dom'; +import { useLocation } from 'react-router-dom'; +import styled from "styled-components"; + +const DetailPageEx = ({title,date,content,tag}) => { + const location = useLocation(); + const { postId } = useParams(); + + return( + <> +

{title}

+

{date}

+

Posted By   Greek{postId}

+ +
+ {/* Content : 글, 그림 등등등*/} +

{content}

+ +

{tag}

+ + + ) + + +} + +export default DetailPageEx; + +const Title = styled.h1` + font-size: 2rem; + text:bold; + text-align:center; +`; + +const Date = styled.p` + font-size: 1rem; + text-align:right; +`; + +const PostId = styled.p` + font-size: 1.2rem; + text:bold +`; + +const Tag = styled.p` + font-size: 1rem; + text:bold; + color: blue; + margin-top:12rem; +`; + +const Content = styled.p` + font-size: 1rem; + text:bold +`; diff --git a/src/pages/study/detail/3.js b/src/pages/study/detail/3.js new file mode 100644 index 0000000..67eb743 --- /dev/null +++ b/src/pages/study/detail/3.js @@ -0,0 +1,56 @@ +import React from 'react'; +import { useParams } from 'react-router-dom'; +import { useLocation } from 'react-router-dom'; +import styled from "styled-components"; + +const DetailPageEx = ({title,date,content,tag}) => { + const location = useLocation(); + const { postId } = useParams(); + + return( + <> +

{title}

+

{date}

+

Posted By   Greek{postId}

+ +
+ {/* Content : 글, 그림 등등등*/} +

{content}

+ +

{tag}

+ + + ) + + +} + +export default DetailPageEx; + +const Title = styled.h1` + font-size: 2rem; + text:bold; + text-align:center; +`; + +const Date = styled.p` + font-size: 1rem; + text-align:right; +`; + +const PostId = styled.p` + font-size: 1.2rem; + text:bold +`; + +const Tag = styled.p` + font-size: 1rem; + text:bold; + color: blue; + margin-top:12rem; +`; + +const Content = styled.p` + font-size: 1rem; + text:bold +`; diff --git a/src/pages/study/detail/4.js b/src/pages/study/detail/4.js new file mode 100644 index 0000000..67eb743 --- /dev/null +++ b/src/pages/study/detail/4.js @@ -0,0 +1,56 @@ +import React from 'react'; +import { useParams } from 'react-router-dom'; +import { useLocation } from 'react-router-dom'; +import styled from "styled-components"; + +const DetailPageEx = ({title,date,content,tag}) => { + const location = useLocation(); + const { postId } = useParams(); + + return( + <> +

{title}

+

{date}

+

Posted By   Greek{postId}

+ +
+ {/* Content : 글, 그림 등등등*/} +

{content}

+ +

{tag}

+ + + ) + + +} + +export default DetailPageEx; + +const Title = styled.h1` + font-size: 2rem; + text:bold; + text-align:center; +`; + +const Date = styled.p` + font-size: 1rem; + text-align:right; +`; + +const PostId = styled.p` + font-size: 1.2rem; + text:bold +`; + +const Tag = styled.p` + font-size: 1rem; + text:bold; + color: blue; + margin-top:12rem; +`; + +const Content = styled.p` + font-size: 1rem; + text:bold +`;