Skip to content

Commit c1fc534

Browse files
committed
feat: policy button ๊ตฌํ˜„
1 parent 9cf8769 commit c1fc534

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { usePolicyState } from '../../stores/policyStore';
2+
3+
const PolicyButton = () => {
4+
const { check } = usePolicyState();
5+
6+
const onClick = () => {
7+
console.log(check);
8+
};
9+
10+
return (
11+
<div className="absolute bottom-12 w-full max-w-5xl">
12+
<button type={'submit'} onClick={onClick} className="btn btn-outline btn-primary display m-auto">
13+
๋™์˜ํ•˜๊ธฐ
14+
</button>
15+
</div>
16+
);
17+
};
18+
19+
export default PolicyButton;

โ€Žsrc/layouts/PolicyPageLayout.tsxโ€Ž

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { FC, ReactNode } from 'react';
2+
import PolicyButton from '../components/Policy/PolicyButton';
23
import HistoryBackButton from '../components/common/HistoryBackButton';
34

45
interface Props {
@@ -8,11 +9,12 @@ interface Props {
89

910
const PolicyPageLayout: FC<Props> = ({ children, title }) => {
1011
return (
11-
<main className={'m-auto h-screen w-fit p-8'}>
12+
<main className={'relative m-auto h-screen w-fit p-8'}>
1213
<HistoryBackButton />
1314
<h2 className="my-5 text-xl font-semibold">{title}</h2>
14-
15-
<div className="card h-5/6 max-w-5xl bg-white">{children}</div>
15+
{/* <div className="card h-5/6 max-w-5xl bg-white">{children}</div> */}
16+
<div className="card h-3/4 max-w-5xl bg-white">{children}</div>
17+
<PolicyButton />
1618
</main>
1719
);
1820
};

โ€Žsrc/stores/policyStore.tsโ€Ž

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { create } from 'zustand';
2+
3+
interface PolicyState {
4+
check: string;
5+
6+
checkHandler: (check: string) => void;
7+
}
8+
9+
export const usePolicyState = create<PolicyState>()((set) => ({
10+
check: 'ํ™•์ธ',
11+
12+
checkHandler: (check: string) => set((state) => ({ ...state, check })),
13+
}));

0 commit comments

Comments
ย (0)