-
Notifications
You must be signed in to change notification settings - Fork 6
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 #192 from UPbrella/develop
Deploy
- Loading branch information
Showing
5 changed files
with
58 additions
and
15 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Meta, StoryFn } from "@storybook/react"; | ||
import DetailBtn, { TDetailBtn } from "."; | ||
import { BrowserRouter as Router } from "react-router-dom"; | ||
|
||
export default { | ||
title: "atoms/DetailBtn", | ||
component: DetailBtn, | ||
tags: ["autodocs"], | ||
} as Meta; | ||
|
||
// Story 함수의 타입 정의 | ||
const Template: StoryFn<TDetailBtn> = (args) => ( | ||
<Router> | ||
<DetailBtn {...args} /> | ||
</Router> | ||
); | ||
|
||
export const Default = Template.bind({}); |
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 StorefrontOutlinedIcon from "@mui/icons-material/StorefrontOutlined"; | ||
import { useNavigate } from "react-router-dom"; | ||
|
||
export type TDetailBtn = { | ||
id: number; | ||
}; | ||
|
||
const DetailBtn = ({ id }: TDetailBtn) => { | ||
const navigate = useNavigate(); | ||
const handleDetailClick = () => { | ||
navigate(`/rentalOffice/${id}`); | ||
}; | ||
return ( | ||
<button | ||
className="text-center text-primary-500 rounded-99 w-full py-9 text-15 font-semibold border border-primary-500" | ||
onClick={handleDetailClick} | ||
> | ||
<StorefrontOutlinedIcon className="mr-2" /> | ||
소개 더보기 | ||
</button> | ||
); | ||
}; | ||
|
||
export default DetailBtn; |
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
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