File tree Expand file tree Collapse file tree 3 files changed +37
-3
lines changed Expand file tree Collapse file tree 3 files changed +37
-3
lines changed Original file line number Diff line number Diff line change
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 ;
Original file line number Diff line number Diff line change 1
1
import { FC , ReactNode } from 'react' ;
2
+ import PolicyButton from '../components/Policy/PolicyButton' ;
2
3
import HistoryBackButton from '../components/common/HistoryBackButton' ;
3
4
4
5
interface Props {
@@ -8,11 +9,12 @@ interface Props {
8
9
9
10
const PolicyPageLayout : FC < Props > = ( { children, title } ) => {
10
11
return (
11
- < main className = { 'm-auto h-screen w-fit p-8' } >
12
+ < main className = { 'relative m-auto h-screen w-fit p-8' } >
12
13
< HistoryBackButton />
13
14
< 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 />
16
18
</ main >
17
19
) ;
18
20
} ;
Original file line number Diff line number Diff line change
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
+ } ) ) ;
You canโt perform that action at this time.
0 commit comments