Skip to content

Commit

Permalink
[Fix] Feed페이지 수정 (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
nebulaBdj committed Nov 30, 2023
1 parent 773106b commit a34b42a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/app/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function Register(): JSX.Element {
password
)

const register_data = axios({
const register_data = await axios({
method: "POST",
url: "https://www.jerneithe.site/user/api/signup",
data : {
Expand Down
8 changes: 4 additions & 4 deletions src/component/FeedCateDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ export default function FeedcateDetail( { categorytitle, setControl } : PROPS) {
let chooseCa:string[] = [];

//▷ 데이터 확인하기
console.log(category_data);
// console.log(category_data);
// console.log(Object.keys(category_data));//키만 가지고 오기
console.log(categorytitle);
// console.log(categorytitle);

if(categorytitle == "top") {
chooseCa = [...top_data];
Expand All @@ -77,7 +77,7 @@ export default function FeedcateDetail( { categorytitle, setControl } : PROPS) {
//▷ 가져온 Value 값을 Ctitle로 가진 배열 가지고오기
const caArr:DATA | undefined = category_data.find(arr => arr.Ctitle == categorytitle);
const view_arr:string[] | undefined = caArr?.arr;
console.log(view_arr);
// console.log(view_arr);

//▷ 이벤트 리스너

Expand Down Expand Up @@ -177,7 +177,7 @@ export default function FeedcateDetail( { categorytitle, setControl } : PROPS) {

}

console.log("검색 데이터 배열",search);
// console.log("검색 데이터 배열",search);
console.log("삭제할 카테고리", delData);


Expand Down
26 changes: 18 additions & 8 deletions src/component/FeedContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { FeedContent } from "@/recoilAtom/FeedContents";
import { TemMaxControl } from "@/recoilAtom/TemMax";
import { TemMinControl } from "@/recoilAtom/TemMin";
import Image from "next/image";
import Link from "next/link";
import { useRouter } from "next/navigation";
import "../style/feedContent.scss"


Expand All @@ -32,6 +34,8 @@ export default function FeedContents(){

const [feedata, setFeedd] = useRecoilState(FeedContent);

const router = useRouter();

//최고 최저가 바뀔때마다 바뀐 온도에 맞춰 피드 바꾸기
useEffect(() => {

Expand Down Expand Up @@ -109,13 +113,17 @@ export default function FeedContents(){

}

const goDetail = async(board_id:number) => {
console.log("게시글 아이디", board_id);
}

return(<>
<div className="feed_box">
{feedata ?
feedata.map((arr)=>{
return(
<div className="feed" key={arr.boardId}>
<div className="feed_imgs3">
<div className="feed_imgs3" onClick={()=>goDetail(arr.boardId)}>
<Image
src={arr.images.image_url}
alt="코디 이미지"
Expand All @@ -129,13 +137,13 @@ export default function FeedContents(){
<div id="name_like">
<p id="nickName_feed">@{arr.nickName}</p>
<div id="like_feed_dj">
<button onClick={() => heart_plus(arr.boardId)}>
<Image
src="/images/likeuseFeed.svg"
alt="좋아요"
width={25}
height={25}
/>
<button>
<Image
src="/images/likeuseFeed.svg"
alt="좋아요"
width={25}
height={25}
/>
</button>
<p>{arr.likeCount}</p>
</div>
Expand All @@ -158,5 +166,7 @@ export default function FeedContents(){
}) :
<p>로딩 중입니다. 계속 피드에 코디가 뜨지 않는다면 새로고침을 해주세요.</p>}
</div>
{/* <Link href={
pathname: '/'}>ffffffff</Link> */}
</>)
}
5 changes: 3 additions & 2 deletions src/component/FeedSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function FeedSearch(){
setHval(e.target.value); // 입력 값 업데이트
};

console.log("인풋 입력값", hash_value);
// console.log("인풋 입력값", hash_value);

//검색 아이콘 누르면 선택한 카테고리 데이터가 있는 아톰에서 배열들을 가져오고
//해시태그에 있는 스트링을 # 기준으로 나누어 배열에 넣은 뒤에
Expand Down Expand Up @@ -59,7 +59,8 @@ export default function FeedSearch(){

//req 데이터 형식 확인 후 setFeedd로 데이터 넣기

console.log(req);
console.log(req.data);
setFeedd(req.data);
}


Expand Down
4 changes: 3 additions & 1 deletion src/component/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ export default function LoginForm() {
const resData = response.data;
console.log("resData: ", resData);
console.log("resData token: ", resData.token);


const accessToken = Cookies.get("accessToken");
console.log("accessToken 값: ", accessToken);

// 토큰을 쿠키에 저장
// document.cookie = `accessToken=${resData.token}; path=/`;
setToken(resData.token);
Expand Down

0 comments on commit a34b42a

Please sign in to comment.