+
+
+ 카테고리
+
- if (localTempMin != undefined) {
- setTempMin(localTempMin)
- }
+
+ {categoryData.map(categoryTitle => {
+ return (
+
+ )
+ })}
+
- setCategoryControl(false);
-
- }
+
+ {categoryList &&
+ categoryList.map(categoryList => {
+ return (
+
+ )
+ })}
+
-
- return (
-
-
-
-
- 카테고리
-
-
-
- {categoryData.map((categoryTitle)=>{
- return(
-
- )
- })}
-
-
-
- {categoryList &&
- categoryList.map((categoryList)=>{
- return(
-
- )
- })
- }
-
-
-
-
온도 설정 :
-
) => setLocalTempMax(parseInt(e.target.value))}
- value={localTempMax || ""}
- placeholderContents="최고온도를 입력해주세요."
- style=" w-[70px] h-[30px] text-[13px] ml-2 mr-1"
- />℃
- ) => setLocalTempMin(parseInt(e.target.value))}
- value={localTempMin || ""}
- placeholderContents="최저온도를 입력해주세요."
- style=" w-[70px] h-[30px] text-[13px] ml-2 mr-1"
- />℃
-
-
- {selectData.map((data, index)=>{
- return(
-
- {data}
-
-
- )
- })}
-
-
-
-
-
-
- )
-}
\ No newline at end of file
+
+
온도 설정 :
+
) =>
+ setLocalTempMax(parseInt(e.target.value))
+ }
+ value={localTempMax || ''}
+ placeholderContents="최고온도를 입력해주세요."
+ style=" w-[70px] h-[30px] text-[13px] ml-2 mr-1"
+ />
+ ℃
+ ) =>
+ setLocalTempMin(parseInt(e.target.value))
+ }
+ value={localTempMin || ''}
+ placeholderContents="최저온도를 입력해주세요."
+ style=" w-[70px] h-[30px] text-[13px] ml-2 mr-1"
+ />
+ ℃
+
+
+ {selectData.map((data, index) => {
+ return (
+
+ {data}
+
+
+ )
+ })}
+
+
+
+
+
+
+ )
+}
diff --git a/weatherfit_refactoring/src/Components/Molecules/FeedContent.tsx b/weatherfit_refactoring/src/Components/Molecules/FeedContent.tsx
index a360e44..5bf11ad 100644
--- a/weatherfit_refactoring/src/Components/Molecules/FeedContent.tsx
+++ b/weatherfit_refactoring/src/Components/Molecules/FeedContent.tsx
@@ -7,53 +7,48 @@ import { AuthTokenStore } from '@/Store/AuthToken'
import { AuthUserNickStore } from '@/Store/AuthUserNick'
import { FeedData } from '@/Store/FeedData'
-
interface Props {
DataforFeed: FEEDDATA
}
export default function FeedContent({ DataforFeed }: Props) {
- const {feedData, setFeedData} = FeedData()
- const date = new Date(DataforFeed.createDate);
- const createDate:string = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDay()}`;
+ const { feedData, setFeedData } = FeedData()
+ const date = new Date(DataforFeed.createDate)
+ const createDate: string = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDay()}`
const { accesstoken } = AuthTokenStore()
const { userNick } = AuthUserNickStore()
- const likeChecker = ( likelist:LIKE[], nickName:string | null ) => {
- if( likelist.some((list) => list.nickName === nickName ) ) {
+ const likeChecker = (likelist: LIKE[], nickName: string | null) => {
+ if (likelist.some(list => list.nickName === nickName)) {
return true
} else {
return false
}
}
- const isUserLiked:boolean = likeChecker( DataforFeed.likelist, userNick );
-
+ const isUserLiked: boolean = likeChecker(DataforFeed.likelist, userNick)
- const clickLike = async() => {
+ const clickLike = async () => {
const sendToLikeAPI = `https://www.jerneithe.site/board/like/${DataforFeed.boardId}`
try {
const res = await fetch(sendToLikeAPI, {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- Authorization: "Bearer " + accesstoken,
- }
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer ' + accesstoken,
+ },
})
if (res.ok) {
- console.log("좋아요 변경 성공");
+ console.log('좋아요 변경 성공')
// 성공적으로 처리된 경우 추가적인 작업 수행
} else {
// throw new Error('Network response was not ok.')
- console.error("좋아요 변경 실패:", res.status);
+ console.error('좋아요 변경 실패:', res.status)
// 실패한 경우에 대한 처리
}
-
} catch (error) {
- console.error("좋아요 변경 실패:", error);
+ console.error('좋아요 변경 실패:', error)
}
-
-
}
return (
@@ -98,11 +93,7 @@ export default function FeedContent({ DataforFeed }: Props) {