forked from kdt-8-4/Weatherfit_frontend_refactoring
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…디 3 코드 구현중
- Loading branch information
Showing
17 changed files
with
244 additions
and
92 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> | ||
) | ||
} |
55 changes: 25 additions & 30 deletions
55
weatherfit_refactoring/src/Components/Molecules/FeedSearch.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,33 +1,28 @@ | ||
"use client" | ||
'use client' | ||
|
||
import IconStore, { IconStyle } from "../Atoms/Icon/IconStore"; | ||
import InputStore, { InputStyle } from "../Atoms/Input/InputStore"; | ||
import ButtonStore, { ButtonStyle } from "../Atoms/Button/ButtonStore"; | ||
import IconStore, { IconStyle } from '../Atoms/Icon/IconStore' | ||
import InputStore, { InputStyle } from '../Atoms/Input/InputStore' | ||
import ButtonStore, { ButtonStyle } from '../Atoms/Button/ButtonStore' | ||
|
||
export default function FeedSearch(){ | ||
export default function FeedSearch() { | ||
const searchCancle = () => {} | ||
|
||
const searchCancle = () => { | ||
|
||
} | ||
|
||
return( | ||
<div className=" flex py-[10px] px-[10px]"> | ||
<div className="flex border rounded-[9px] mx-1"> | ||
<InputStore | ||
inputStyle={InputStyle.INPUT_SEARCH} | ||
placeholderContents="#해시태그를 입력하세요" | ||
style="font-gmarketsans font-thin outline-none text-[14px] w-[65vw] h-[38px] mx-1"/> | ||
<IconStore | ||
iconStyle={IconStyle.SEARCH} | ||
size={16} | ||
style="mr-[10px]"/> | ||
</div> | ||
<ButtonStore | ||
buttonStyle={ButtonStyle.CANCLE_BTN} | ||
style="font-NanumSquareRound text-gray-500 text-[16px] w-[70px]" | ||
onClickFunction={searchCancle}> | ||
취소 | ||
</ButtonStore> | ||
</div> | ||
) | ||
} | ||
return ( | ||
<div className=" flex py-[10px] px-[10px]"> | ||
<div className="flex border rounded-[9px] mx-1"> | ||
<InputStore | ||
inputStyle={InputStyle.INPUT_SEARCH} | ||
placeholderContents="#해시태그를 입력하세요" | ||
style="font-gmarketsans font-thin outline-none text-[14px] w-[65vw] h-[38px] mx-1" | ||
/> | ||
<IconStore iconStyle={IconStyle.SEARCH} size={16} style="mr-[10px]" /> | ||
</div> | ||
<ButtonStore | ||
buttonStyle={ButtonStyle.CANCEL_BTN} | ||
style="font-NanumSquareRound text-gray-500 text-[16px] w-[70px]" | ||
onClickFunction={searchCancle}> | ||
취소 | ||
</ButtonStore> | ||
</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
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} /> | ||
</> | ||
) | ||
} |
Oops, something went wrong.