-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from 8princesses/feat/detail
Feat/detail
- Loading branch information
Showing
27 changed files
with
794 additions
and
130 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
NEXT_PUBLIC_API_URL=https://api.modumozu.com/ | ||
NEXT_PUBLIC_KAKAO_KEY="5d83cd0432c767f46c20dceb0f8f3947" | ||
NEXT_PUBLIC_KAKAO_KEY="5d83cd0432c767f46c20dceb0f8f3947" |
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 +1 @@ | ||
NEXT_PUBLIC_API_URL=https://api.modumozu.com/ | ||
NEXT_PUBLIC_API_URL=https://api.modumozu.com/ |
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,28 +1,52 @@ | ||
import { EndedStockType, UpcomingStockType } from "@/types"; | ||
import instance from "./common"; | ||
import api from "./common"; | ||
import { IPODetailResponse } from "@/dto/detail"; | ||
import { ApiResponse } from "./network"; | ||
import { NewsResponse } from "@/dto/news"; | ||
|
||
const url = "/api/ipo/v1"; | ||
|
||
/** | ||
* IPO 상세 조회 | ||
*/ | ||
export const getDetailById = async (id: string) => { | ||
const data = await instance.get(`${url}/${id}`); | ||
console.log("data", data); | ||
const { | ||
data: { data }, | ||
} = await api.get<ApiResponse<IPODetailResponse>>(`${url}/ipo/${id}`); | ||
|
||
return data; | ||
}; | ||
|
||
/** | ||
* IPO 상세 news | ||
*/ | ||
export const getDetailNewsById = async (id: string) => { | ||
const { | ||
data: { data }, | ||
} = await api.get<ApiResponse<NewsResponse>>(`${url}/ipo/${id}/news`); | ||
|
||
return data.news; | ||
}; | ||
|
||
/** | ||
* 관심 공모주 수정 | ||
*/ | ||
export const updateDetailPin = async (ipoId: number) => { | ||
await api.put(`${url}/ipo/pin`, { ipoId }); | ||
}; | ||
|
||
/** | ||
* 다가오는 공모주 조회 | ||
*/ | ||
export const fetchUpcomingStocks = async (): Promise<UpcomingStockType> => { | ||
const { data } = await instance.get(url + "/ipo"); | ||
const { data } = await api.get(url + "/ipo"); | ||
return data.data; | ||
}; | ||
|
||
/** | ||
* 종료된 공모주 조회 | ||
*/ | ||
export const fetchEndedStocks = async (page: number): Promise<EndedStockType[]> => { | ||
const { data } = await instance.get(`${url}/closed-ipo?page=${page}&size=10`); | ||
const { data } = await api.get(`${url}/closed-ipo?page=${page}&size=10`); | ||
return data.data.ipos; | ||
}; |
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,6 @@ | ||
export class ModuMozuError {} | ||
|
||
export interface ApiResponse<T> { | ||
data: T; | ||
timestamp: number; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import PageHeader from "@/components/common/PageHeader"; | ||
import { FC, ReactNode } from "react"; | ||
|
||
interface EnterPriseLayoutProps { | ||
children: ReactNode; | ||
} | ||
|
||
const EnterPriseLayout: FC<EnterPriseLayoutProps> = ({ children }) => { | ||
return ( | ||
<div style={{ backgroundColor: "white" }}> | ||
<PageHeader /> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
export default EnterPriseLayout; |
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,16 @@ | ||
"use client"; | ||
|
||
import DetailCard from "@/components/detail/DetailCard"; | ||
|
||
const EnterPrise = () => { | ||
return ( | ||
<> | ||
<DetailCard.wrapper> | ||
<DetailCard.item>하ㅓ이</DetailCard.item> | ||
<DetailCard.item>힝;</DetailCard.item> | ||
</DetailCard.wrapper> | ||
</> | ||
); | ||
}; | ||
|
||
export default EnterPrise; |
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 |
---|---|---|
|
@@ -96,6 +96,10 @@ video { | |
box-sizing: border-box; | ||
} | ||
|
||
a { | ||
text-decoration: none; | ||
} | ||
|
||
article, | ||
aside, | ||
details, | ||
|
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,6 @@ | ||
"use client"; | ||
|
||
const Test = () => { | ||
return <div></div>; | ||
}; | ||
export default Test; |
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,42 @@ | ||
"use client"; | ||
|
||
import BackIcon from "@/svg/BackIcon"; | ||
import { useRouter } from "next/navigation"; | ||
import { FC, ReactNode } from "react"; | ||
import styled from "styled-components"; | ||
|
||
interface PageHeaderProps { | ||
showPrevButton?: boolean; | ||
addtionalButton?: ReactNode; | ||
} | ||
|
||
const PageHeader: FC<PageHeaderProps> = ({ showPrevButton = true, addtionalButton }) => { | ||
const router = useRouter(); | ||
|
||
const handlePrevClick = () => { | ||
router.back(); | ||
}; | ||
|
||
return ( | ||
<Header> | ||
{showPrevButton && ( | ||
<div> | ||
<BackButton onClick={handlePrevClick} /> | ||
</div> | ||
)} | ||
|
||
{addtionalButton && <div>{addtionalButton}</div>} | ||
</Header> | ||
); | ||
}; | ||
export default PageHeader; | ||
|
||
const Header = styled.header` | ||
display: flex; | ||
justify-content: space-between; | ||
padding: 16px; | ||
`; | ||
|
||
const BackButton = styled(BackIcon)` | ||
cursor: pointer; | ||
`; |
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,24 @@ | ||
import styled from "styled-components"; | ||
import Button from "../common/Button"; | ||
import { Proposal } from "@/dto/detail"; | ||
import { FC } from "react"; | ||
|
||
interface DetailBottomButton { | ||
proposal: Proposal; | ||
offerBeginAt: string; | ||
offerEndAt: string; | ||
} | ||
|
||
const DetailBottomButton: FC<DetailBottomButton> = ({ proposal, offerBeginAt, offerEndAt }) => { | ||
return ( | ||
<BottomButtonWrap> | ||
<Button width="100%">버튼이요</Button> | ||
</BottomButtonWrap> | ||
); | ||
}; | ||
|
||
export default DetailBottomButton; | ||
|
||
const BottomButtonWrap = styled.div` | ||
padding: 16px 16px 20px 16px; | ||
`; |
Oops, something went wrong.