Skip to content

Commit

Permalink
Merge pull request #12 from KUSITMS-27-chilling/feat/add-suggest/yeonsu
Browse files Browse the repository at this point in the history
Feat/add suggest/yeonsu
  • Loading branch information
leehyewon0531 authored May 5, 2023
2 parents a4cc282 + 94b0979 commit 384beae
Show file tree
Hide file tree
Showing 7 changed files with 286 additions and 1 deletion.
Binary file added src/assets/Write.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions src/components/Commu/CommuBest.styled.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import styled from "styled-components";

export const CommuBestBox = styled.div`
position: relative;
width: 212px;
height: 132px;
border: 3px solid #767676;
border-radius: 10px;
`
export const Best = styled.div`
position: relative;
width: 38px;
height: 18px;
margin-top: 16px;
margin-left: 18px;
font-size: 15px;
font-weight: 700;
color: #535353;
`
export const Text = styled.div`
position: relative;
width: 170px;
height: 50px;
border: 3px solid #767676;
margin-top: 9px;
margin-left: 18px;
`

//๋‚ด๊ฐ€ ๋‚จ๊ธด ํ›„๊ธฐ ๊ธ€ ๋ฐ•์Šค
export const CommuBestBox1 = styled.div`
position: relative;
width: 212px;
height: 132px;
border: 3px solid #59C7C8;
border-radius: 10px;
`
export const Title = styled.div`
position: relative;
width: 176px;
height: 18px;
margin-top: 16px;
margin-left: 18px;
font-size: 15px;
font-weight: 700;
color: #000000;
`
export const Text1 = styled.div`
position: relative;
width: 38px;
height: 18px;
margin-top: 16px;
margin-left: 18px;
font-size: 15px;
font-weight: 700;
color: #535353;
`
//๋ฒ„ํŠผ ์ปดํฌ๋„ŒํŠธ
// export const CommuPostButton = styled.div`
// position: relative;
// width: 920px;
// height: 46px;
// font-size: 15px;
// font-weight: 700;
// color: #535353;

//`
export const Stylebutton = styled.button`
position: relative;
width: 920px;
height: 46px;
border: 2px solid #CBCBCB;
border-radius: 20px;
font-size: 18px;
font-weight: 600;
color: #535353;
background: none;
.Write{
margin-right: 13px;
}
`
45 changes: 45 additions & 0 deletions src/components/Commu/CommuBest.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React ,{useState,useEffect}from 'react'
import axios from 'axios';
import {
CommuBestBox,
Best,
Text

} from './CommuBest.styled'


interface IData {
id: number;
title: string;
body: string;
}

function CommuBest() {

const [data, setData] = useState<IData[]>([]);

useEffect(() => {
axios.get('')
.then(response => {
setData(response.data);
})
.catch(error => {
console.error(error);
});
}, []);

return (
<div>
<CommuBestBox>
{data.map(item => (
<div key={item.id}>
<Best>BEST</Best>
<Text>{item.body}</Text>
</div>
))}
</CommuBestBox>
</div>
)
}

export default CommuBest
46 changes: 46 additions & 0 deletions src/components/Commu/CommuMyPost.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React ,{useState,useEffect}from 'react'
import axios from 'axios';
import {
CommuBestBox1,
Title,
Text1

} from './CommuBest.styled'


interface IData {
id: number;
title: string;
day: string;
}

function CommuBest() {

const [data, setData] = useState<IData[]>([]);

useEffect(() => {
axios.get('')
.then(response => {
setData(response.data);
})
.catch(error => {
console.error(error);
});
}, []);

return (
<div>
<CommuBestBox1>
{data.map(item => (
<div key={item.id}>
{/* <Title>{item.title}</Title> */}
<Title>๊ฐ€๋‚˜๋‹ค๋ผ๋งˆ๋ฐ”์‚ฌ</Title>
<Text1>{item.day}</Text1>
</div>
))}
</CommuBestBox1>
</div>
)
}

export default CommuBest
26 changes: 26 additions & 0 deletions src/components/Commu/CommuPostBtn.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react'
import { useNavigate } from 'react-router-dom';
import {
Stylebutton

} from './CommuBest.styled'
import Write from '../../assets/Write.png'

function CommuPostBtn() {
const navigate = useNavigate();

const goMypage =()=>{ //์ผ๋‹จ์€ ๋งˆ์ดํŽ˜์ด์ง€๋กœ ํ•ด๋†“์•˜์Œ
navigate("/mypage");
}
return (
<div>
<Stylebutton onClick={goMypage}>
<img className="Write" alt="1" src={Write} />
๋‚˜์˜ ๋ฐฐ์›€์— ๋Œ€ํ•ด ์ž‘์„ฑํ•ด๋ณด์„ธ์š”!
</Stylebutton>

</div>
)
}

export default CommuPostBtn
43 changes: 43 additions & 0 deletions src/pages/Commu/CommunityPage.styled.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import styled from "styled-components";
export const MainHeader = styled.div`
position: relative;
width: 100%;
height: 60px;
background-color: white;
border: 1px solid red;
`
export const MainBody_Tapbar = styled.div`
position: relative;
width: 100%;
height: 57px;
background-color: white;
border: 1px solid red;
.MainBody_Tapbar_In{
position: absolute;
width: 600px;
height: 44px;
border: 1px solid red;
margin-left: 112px;
margin-top: 13px;
}
.MainBody_Tapbar_In > button{
width: 135px;
height: 44px;
background-color:transparent;
border: none;
font-size: 20px;
font-weight: 600;
color: #B0B0B0;
Letter-spacing: -5%;
}
`
export const MainBanner = styled.div`
position: relative;
width: 100%;
height: 240px;
background-color: #91C8CA;
border: 1px solid red;
`
45 changes: 44 additions & 1 deletion src/pages/Commu/CommunityPage.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,52 @@
import React from 'react'
import { useNavigate } from 'react-router-dom';
import {
MainBanner,
MainBody_Tapbar
} from "./CommunityPage.styled"

import Header from '../../components/Header/Header';
import CommuBest from '../../components/Commu/CommuBest'
import CommuMyPost from '../../components/Commu/CommuMyPost'
import CommuPostBtn from '../../components/Commu/CommuPostBtn';
function CommunityPage() {

const navigate = useNavigate();
const goLogin =()=>{
navigate("/login");
}
const goMain =()=>{ //๋ชจ์•„๋ณด๊ธฐ
navigate("/");
}
const goSuggest =()=>{ //์ œ์•ˆํ• ๋ž˜์š”
navigate("/suggest");
}
const goCommu =()=>{ //์ปค๋ฎค๋‹ˆํ‹ฐ
navigate("/commu");
}
const goMypage =()=>{ //๋งˆ์ดํŽ˜์ด์ง€
navigate("/mypage");
}
return (
<div>
์ปค๋ฎค๋‹ˆํ‹ฐ ์ž…๋‹ˆ๋‹ค
<>
<Header>
</Header>
<MainBody_Tapbar>
<div className='MainBody_Tapbar_In'>
<button onClick={goMain}>๋ชจ์•„๋ณด๊ธฐ</button>
<button onClick={goSuggest}>์ œ์•ˆํ• ๋ž˜์š”</button>
<button onClick={goCommu}>์ปค๋ฎค๋‹ˆํ‹ฐ</button>
<button onClick={goMypage}>๋งˆ์ดํŽ˜์ด์ง€</button>
</div>
</MainBody_Tapbar>
<MainBanner>
๋ฐฐ๋„ˆ
</MainBanner>
{/* <CommuBest/> */}
{/* <CommuMyPost/> */}
{/* <CommuPostBtn/> */}
</>
</div>
)
}
Expand Down

0 comments on commit 384beae

Please sign in to comment.