-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
17 changed files
with
225 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
weatherfit_refactoring/src/Components/Molecules/Best3Codi.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Link from 'next/link' | ||
import BoxStore, { BoxStyle } from '../Atoms/Box/BoxStore' | ||
import Image from 'next/image' | ||
|
||
export default function Best3Codi({ data }: { data?: FEEDDATA_detail }) { | ||
if (!data || !data.images) { | ||
return null | ||
} | ||
|
||
return ( | ||
<> | ||
{data.images.map((image, index) => ( | ||
<Link href={`/detail/${data.boardId}`}> | ||
<BoxStore boxStyle={BoxStyle.BOX_IMAGE} key={index}> | ||
<Image | ||
src={image.imageUrl} | ||
alt={`Image ${index}`} | ||
width={100} | ||
height={100} | ||
className="w-full h-full object-cover border rounded-2xl" | ||
/> | ||
</BoxStore> | ||
</Link> | ||
// 유저 정보 넣어야 함 | ||
))} | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
weatherfit_refactoring/src/Components/Molecules/EditWeather.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use client' | ||
|
||
import Image from 'next/image' | ||
|
||
export default function EditWeather({ data }: { data: FEEDDATA_detail }) { | ||
return ( | ||
<div className="flex mb-3 items-center w-fit"> | ||
<p className="font-gmarketsans pt-[5px] mr-3 text-sm">업로드 당시 날씨</p> | ||
<Image | ||
src={data.weatherIcon} | ||
alt="날씨" | ||
width={20} | ||
height={20} | ||
loading="lazy" | ||
/> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 11 additions & 4 deletions
15
weatherfit_refactoring/src/Components/Molecules/TextAreaMolecule.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
weatherfit_refactoring/src/Components/Molecules/UploadWeather.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
'use client' | ||
|
||
import { WeatherIcon } from '@/Store/WeatherIcon' | ||
import Image from 'next/image' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
weatherfit_refactoring/src/Components/Organisms/EditOrganism.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import DetailContent from '@/Components/Molecules/DetailContent' | ||
import DetailImage from '@/Components/Molecules/DetailImge' | ||
import DetailCategory from '../Molecules/DetailCategory' | ||
import LikeAndComment from '../Molecules/LikeAndComment' | ||
import DetailProfile from '../Molecules/DetailProfile' | ||
import DetailEtc from '../Molecules/DetailEtc' | ||
import NotFound from '@/app/not-found' | ||
import EditWeather from '../Molecules/EditWeather' | ||
import TextAreaMolecule from '../Molecules/TextAreaMolecule' | ||
import EditHeader from './EditHeader' | ||
import ImageUpload from './ImageUpload' | ||
import SelectCategory from './SelectCategory' | ||
|
||
export default async function EditOrganism({ boardId }: BOARDID) { | ||
const response = await fetch( | ||
`https://www.jerneithe.site/board/detail/${boardId}`, | ||
{ | ||
method: 'GET', | ||
}, | ||
) | ||
const data: FEEDDATA_detail = await response.json() | ||
|
||
return ( | ||
<div className="h-screen"> | ||
<EditHeader boardId={boardId} /> | ||
<div className="mx-5 h-full"> | ||
<div className="flex-col items-center justify-center mb-7"> | ||
<EditWeather data={data} /> | ||
<ImageUpload data={data} /> | ||
</div> | ||
<TextAreaMolecule data={data} /> | ||
<hr /> | ||
<SelectCategory data={data} /> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
weatherfit_refactoring/src/Components/Organisms/MainOrganism.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
'use client' | ||
|
||
import { useEffect, useState } from 'react' | ||
import { WeatherTempMax } from '@/Store/WeatherMaxTemp' | ||
import { WeatherTempMin } from '@/Store/WeatherMinTemp' | ||
import Best3Codi from '../Molecules/Best3Codi' | ||
|
||
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', | ||
}, | ||
) | ||
|
||
const data = await response.json() | ||
setData(data) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
getBestCodi() | ||
}, [temperatureMax, temperatureMin]) | ||
|
||
return ( | ||
<> | ||
<Best3Codi data={data} /> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.