From 686813bec10e52a5260b39e18bc3a596cb6f8092 Mon Sep 17 00:00:00 2001 From: sanglim Date: Fri, 19 May 2023 20:51:22 +0900 Subject: [PATCH 1/5] =?UTF-8?q?link.=20=EC=B7=A8=ED=96=A5=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=ED=9B=84=20=EB=A7=81=ED=81=AC=20=EC=9D=B4=EB=8F=99?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/Setting/tasteSetting.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/Setting/tasteSetting.js b/frontend/src/pages/Setting/tasteSetting.js index 9a720e1..6a0245f 100644 --- a/frontend/src/pages/Setting/tasteSetting.js +++ b/frontend/src/pages/Setting/tasteSetting.js @@ -90,7 +90,7 @@ function TasteSetting() { try { await axios.post('/api/hashtag-taste', saveInfo); alert('취향 정보가 저장되었습니다.'); - navigator('/setting'); + navigator('/mypage'); } catch (e) { console.log(e); } From e94e1479c47abdd1540d7eb1fc2479a9455cb959 Mon Sep 17 00:00:00 2001 From: sanglim Date: Fri, 19 May 2023 20:52:01 +0900 Subject: [PATCH 2/5] =?UTF-8?q?style.=20=EC=B7=A8=ED=96=A5=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EC=97=86=EC=9D=84=20=EC=8B=9C=20=EB=A9=94=EC=84=B8?= =?UTF-8?q?=EC=A7=80=20=EB=85=B8=EC=B6=9C=20=EB=B0=8F=20=EC=B7=A8=ED=96=A5?= =?UTF-8?q?=EC=84=A4=EC=A0=95=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=97=B0?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/MyPage/myPage.js | 71 ++++++++++++++++++----------- frontend/src/pages/MyPage/styles.js | 8 +++- 2 files changed, 51 insertions(+), 28 deletions(-) diff --git a/frontend/src/pages/MyPage/myPage.js b/frontend/src/pages/MyPage/myPage.js index 067451f..a369480 100644 --- a/frontend/src/pages/MyPage/myPage.js +++ b/frontend/src/pages/MyPage/myPage.js @@ -6,11 +6,14 @@ import { Title } from '../../components/Fonts/fonts'; import axios from 'axios'; import { useRecoilValue } from 'recoil'; import { email } from '../../store/userInfo'; +import { useNavigate } from 'react-router-dom'; function MyPage() { const userEmail = useRecoilValue(email); const [userInfo, setUserInfo] = useState({}); const [isLoading, setIsLoading] = useState(true); + + const navigator = useNavigate(); useEffect(() => { const fetchData = async () => { setIsLoading(true); @@ -27,15 +30,9 @@ function MyPage() { setUserInfo({ ...result, totalCost: formatNumberWithCommas(result.totalCost), - object: result.object - ? result.object.split(',') - : ['취향을 설정해보세요 :)'], - prefer_age: result.prefer_age - ? result.prefer_age.split(',') - : ['취향을 설정해보세요 :)'], - style: result.style - ? result.style.split(',') - : ['취향을 설정해보세요 :)'], + object: result.object ? result.object.split(',') : [], + prefer_age: result.prefer_age ? result.prefer_age.split(',') : [], + style: result.style ? result.style.split(',') : [], }); setIsLoading(false); @@ -68,36 +65,56 @@ function MyPage() {
나의 여행 스타일
- +
스타일
- {userInfo.style.map((tag) => ( - {tag} - ))} +
+ {userInfo.style.length !== 0 ? ( + userInfo.style.map((tag) => {tag}) + ) : ( + navigator('/setting/taste')}> + 취향을 설정해보세요 :) + + )} +
- +
목적
- {userInfo.object.map((tag) => ( - {tag} - ))} +
+ {userInfo.object.length !== 0 ? ( + userInfo.object.map((tag) => {tag}) + ) : ( + navigator('/setting/taste')}> + 취향을 설정해보세요 :) + + )} +
선호하는 동행자 스타일
- +
연령대
- {userInfo.prefer_age.map((tag) => ( - {tag} - ))} +
+ {userInfo.prefer_age.length !== 0 ? ( + userInfo.prefer_age.map((tag) => {tag}) + ) : ( + navigator('/setting/taste')}> + 취향을 설정해보세요 :) + + )} +
- +
성별
- - {userInfo.prefer_gender - ? userInfo.prefer_gender - : '취향을 설정해보세요 :)'} - + {userInfo.prefer_gender ? ( + {userInfo.prefer_gender} + ) : ( + navigator('/setting/taste')}> + 취향을 설정해보세요 :) + + )}
diff --git a/frontend/src/pages/MyPage/styles.js b/frontend/src/pages/MyPage/styles.js index 65b9025..ab9f22a 100644 --- a/frontend/src/pages/MyPage/styles.js +++ b/frontend/src/pages/MyPage/styles.js @@ -47,11 +47,17 @@ export const RowAlign = styled.div` > div:first-child { flex: 0 1 110px; } + > div:last-child { + display: flex; + flex: auto; + flex-wrap: wrap; + gap: 4px 6px; + } span { padding: 2px 16px; border: 1.5px solid #7c7c7c; border-radius: 24px; - margin-right: 8px; + cursor: ${(props) => (props.cursor ? 'pointer' : 'auto')}; } `; From 49b571d615949767119ae81e17df0c84f834c0d7 Mon Sep 17 00:00:00 2001 From: sanglim Date: Fri, 19 May 2023 21:00:17 +0900 Subject: [PATCH 3/5] =?UTF-8?q?fix.=20=EA=B2=8C=EC=8B=9C=EA=B8=80=20?= =?UTF-8?q?=EC=97=86=EC=9D=84=20=EC=8B=9C=20=EB=A9=94=EC=84=B8=EC=A7=80?= =?UTF-8?q?=EB=A5=BC=20=EA=B2=80=EC=83=89=EC=A1=B0=EA=B1=B4=20=EA=B2=8C?= =?UTF-8?q?=EC=8B=9C=EA=B8=80=20=EB=A9=94=EC=84=B8=EC=A7=80=EC=99=80=20?= =?UTF-8?q?=EA=B5=AC=EB=B6=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/Board/board.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/Board/board.js b/frontend/src/pages/Board/board.js index dd2045e..bac3e2d 100644 --- a/frontend/src/pages/Board/board.js +++ b/frontend/src/pages/Board/board.js @@ -97,7 +97,11 @@ function Board() { /> {/* 검색어가 없을경우 전체 데이터 보여주기, 입력 값이 있을경우 해당하는 데이터 보여주기 */} - {FilterContents.length === 0 ? ( + {searchWord === '' ? ( + <> + 아직 올라온 게시글이 없어요 ! + + ) : searchWord !== '' && FilterContents.length === 0 ? ( <> 검색하신 조건에 맞는 게시글이 없어요 :( From a5a10545a374814b0c9b49b4df15feea3d4939a5 Mon Sep 17 00:00:00 2001 From: sanglim Date: Fri, 19 May 2023 21:06:59 +0900 Subject: [PATCH 4/5] =?UTF-8?q?style.=20=ED=9A=8C=EC=9B=90=EA=B0=80?= =?UTF-8?q?=EC=9E=85=20=EB=B9=84=EB=B0=80=EB=B2=88=ED=98=B8=20=EC=9D=BC?= =?UTF-8?q?=EC=B9=98=20=ED=99=95=EC=9D=B8=20span=EC=9D=98=20css=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Inputs/inputBox.js | 1 + frontend/src/components/Inputs/styles.js | 5 +++++ frontend/src/pages/Join/join.js | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/Inputs/inputBox.js b/frontend/src/components/Inputs/inputBox.js index 7c39cdf..0e45e8a 100644 --- a/frontend/src/components/Inputs/inputBox.js +++ b/frontend/src/components/Inputs/inputBox.js @@ -15,6 +15,7 @@ const InputBox = (props) => { value={props.value} disabled={props.disabled} /> + {props.addSpan ? {props.addSpan} : null} ); }; diff --git a/frontend/src/components/Inputs/styles.js b/frontend/src/components/Inputs/styles.js index bc7305d..b6b78bc 100644 --- a/frontend/src/components/Inputs/styles.js +++ b/frontend/src/components/Inputs/styles.js @@ -32,4 +32,9 @@ export const InputWrap = styled.div` transition: 0.2s ease; } } + + > span { + margin: 4px 0; + color: #7c7c7c; + } `; diff --git a/frontend/src/pages/Join/join.js b/frontend/src/pages/Join/join.js index 6068b5e..917913b 100644 --- a/frontend/src/pages/Join/join.js +++ b/frontend/src/pages/Join/join.js @@ -202,6 +202,7 @@ function Join() { { if ( userInfo.passwd.length !== 0 && @@ -211,19 +212,18 @@ function Join() { else setPasswordMessage('비밀번호가 일치하지 않습니다.'); }} /> - {passwordMessage}
성별 setUserInfo({ ...userInfo, gender: 'M' })} - checked={userInfo.gender === 'M' ? true : false} + checked={userInfo.gender === 'M'} > 남자 setUserInfo({ ...userInfo, gender: 'F' })} - checked={userInfo.gender === 'F' ? true : false} + checked={userInfo.gender === 'F'} > 여자 From 49987437dfe7aedf45e603153328aef803c32e1e Mon Sep 17 00:00:00 2001 From: sanglim Date: Fri, 19 May 2023 21:22:36 +0900 Subject: [PATCH 5/5] =?UTF-8?q?feat.=20=EC=B7=A8=ED=96=A5=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=EA=B0=80=20=EC=99=84=EC=84=B1=EB=90=98=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EC=9D=80=20=EC=9C=A0=EC=A0=80=EC=97=90=EA=B2=8C=20?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC=EC=B0=BD=20=EB=85=B8=EC=B6=9C=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Modals/tasteModal.js | 8 +++---- frontend/src/pages/Home/index.js | 22 +++++++++++++++++++- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/Modals/tasteModal.js b/frontend/src/components/Modals/tasteModal.js index 52ad4bf..65c6ac9 100644 --- a/frontend/src/components/Modals/tasteModal.js +++ b/frontend/src/components/Modals/tasteModal.js @@ -10,16 +10,16 @@ const TasteModal = (props) => {
- 추천을 위한 취향 정보가 없습니다. - 취향 정보를 먼저 저장하시겠습니까 ? + 추천을 위한 취향 정보가 완성되지 않았어요 :( + 취향 정보를 먼저 저장해주세요.
diff --git a/frontend/src/pages/Home/index.js b/frontend/src/pages/Home/index.js index 18ee5d1..6fcc697 100644 --- a/frontend/src/pages/Home/index.js +++ b/frontend/src/pages/Home/index.js @@ -18,6 +18,26 @@ function Home() { // 취향정보가 없는 유저의 경우 홈화면 접근 시 모달창 띄우기 const [tasteModal, setTasteModal] = useState(false); + const [userInfo, setUserInfo] = useState({}); + + useEffect(() => { + const fetchData = async () => { + const response = await axios.post('/api/get-userInfo', { + email: userEmail, + }); + setUserInfo(response.data[0]); + if ( + response.data[0].object === null || + response.data[0].style === null || + response.data[0].prefer_age === null || + response.data[0].prefer_gender === null + ) { + setTasteModal(true); + } + }; + fetchData(); + return; + }, [userEmail]); useEffect(() => { const fetchData = async () => { @@ -65,7 +85,7 @@ function Home() { }} src={loadingImage} alt="loading gif" - > + /> ); }