Skip to content

Commit

Permalink
[Fix] #14 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeiis committed Mar 28, 2024
1 parent 5a7e9f4 commit dc3c3c4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function BestThreeCodi({ data }: { data?: FEEDDATA_detail }) {
/>
</BoxStore>
</Link>
// 유저 정보 넣어야 함
// 유저 정보
))}
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function DetailCategory({
key={index}
onClickFunction={() => handleSelectCategory(subCategory)}
buttonStyle={ButtonStyle.CATEGORY_BTN_Y}
style="mr-2 text-sm flex ">
style="mr-2 text-sm flex px-1.5 py-0.5">
{subCategory}
</ButtonStore>
))}
Expand Down
38 changes: 20 additions & 18 deletions weatherfit_refactoring/src/Components/Organisms/MainOrganism.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,35 @@ import { useEffect, useState } from 'react'
import { WeatherTempMax } from '@/Store/WeatherMaxTemp'
import { WeatherTempMin } from '@/Store/WeatherMinTemp'
import BestThreeCodi from '../Molecules/BestThreeCodi'
import feedData from '../../../public/dummy_data/feed.json'

export default function MainOrganism() {
const { temperatureMax } = WeatherTempMax()
const { temperatureMin } = WeatherTempMin()

const [data, setData] = useState<FEEDDATA_detail | undefined>(undefined)

useEffect(() => {
const getBestCodi = async () => {
try {
const response = await fetch(
`https://www.jerneithe.site/board/tops?temp_min=${temperatureMax}&temp_max=${temperatureMin}`,
{
method: 'GET',
},
)
useEffect(() => {})
// useEffect(() => {
// const getBestCodi = async () => {
// try {
// const response = await fetch(
// `https://www.jerneithe.site/board/tops?temp_min=${temperatureMax}&temp_max=${temperatureMin}`,
// {
// method: 'GET',
// },
// )

const data = await response.json()
setData(data)
} catch (error) {
console.error(error)
}
}
getBestCodi()
}, [temperatureMax, temperatureMin])
// const data = await response.json()
// setData(data)
// } catch (error) {
// console.error(error)
// }
// }
// getBestCodi()
// }, [temperatureMax, temperatureMin])

console.log(temperatureMax, temperatureMin)
// console.log(temperatureMax, temperatureMin)

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion weatherfit_refactoring/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function RootLayout({
children: React.ReactNode
}) {
return (
<html>
<html lang="ko">
<body>
<ReactQueryProvider>{children}</ReactQueryProvider>
</body>
Expand Down
2 changes: 2 additions & 0 deletions weatherfit_refactoring/src/app/upload/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { CheckStore } from '@/Store/Check'
import { AuthTokenStore } from '@/Store/AuthToken'
import { loginCheck } from '@/utils/function/utilFunction'
import { useEffect } from 'react'
import NavBar from '@/Components/Molecules/NavBar'

export default function Upload() {
const { loading, setLoading } = LoadingStore()
Expand Down Expand Up @@ -41,6 +42,7 @@ export default function Upload() {
<hr />
<SelectCategory mode="upload" />
</div>
{/* <NavBar /> */}
</div>
) : (
<NoLogin />
Expand Down

0 comments on commit dc3c3c4

Please sign in to comment.