@@ -6,74 +6,77 @@ import { BoundlessButton } from '../buttons';
66import { Plus , Search , Menu } from 'lucide-react' ;
77import { SidebarTrigger } from '../ui/sidebar' ;
88import Image from 'next/image' ;
9- import BoundlessSheet from '../sheet/boundless-sheet' ;
9+ // import BoundlessSheet from '../sheet/boundless-sheet';
1010import { motion } from 'framer-motion' ;
1111import { fadeInUp , slideInFromLeft , slideInFromRight } from '@/lib/motion' ;
1212import WalletConnectButton from '../wallet/WalletConnectButton' ;
13- import ProjectSubmissionForm from '../project/ProjectSubmissionForm' ;
14- import ProjectSubmissionLoading from '../project/ProjectSubmissionLoading' ;
15- import ProjectSubmissionSuccess from '../project/ProjectSubmissionSuccess' ;
16- import { Stepper } from '../stepper' ;
13+ // import ProjectSubmissionForm from '../project/ProjectSubmissionForm';
14+ // import ProjectSubmissionLoading from '../project/ProjectSubmissionLoading';
15+ // import ProjectSubmissionSuccess from '../project/ProjectSubmissionSuccess';
16+ // import { Stepper } from '../stepper';
17+ import { ProjectSheetFlow } from '../project' ;
18+ import { useProjectSheetStore } from '@/lib/stores/project-sheet-store' ;
1719
18- type Step = {
19- title : string ;
20- description : string ;
21- state : 'pending' | 'active' | 'completed' ;
22- } ;
20+ // type Step = {
21+ // title: string;
22+ // description: string;
23+ // state: 'pending' | 'active' | 'completed';
24+ // };
2325
24- const initialSteps : Step [ ] = [
25- {
26- title : 'Initialize' ,
27- description : 'Submit your project idea to kickstart your campaign journey.' ,
28- state : 'active' ,
29- } ,
30- {
31- title : 'Project Details' ,
32- description : 'Provide detailed information about your project.' ,
33- state : 'pending' ,
34- } ,
35- {
36- title : 'Review & Submit' ,
37- description : 'Review your submission and finalize your entry.' ,
38- state : 'pending' ,
39- } ,
40- ] ;
26+ // const initialSteps: Step[] = [
27+ // {
28+ // title: 'Initialize',
29+ // description: 'Submit your project idea to kickstart your campaign journey.',
30+ // state: 'active',
31+ // },
32+ // {
33+ // title: 'Project Details',
34+ // description: 'Provide detailed information about your project.',
35+ // state: 'pending',
36+ // },
37+ // {
38+ // title: 'Review & Submit',
39+ // description: 'Review your submission and finalize your entry.',
40+ // state: 'pending',
41+ // },
42+ // ];
4143
4244const Header = ( ) => {
4345 const [ open , setOpen ] = useState ( false ) ;
44- const [ submissionStatus , setSubmissionStatus ] = useState ( 'idle' ) ;
45- const [ steps , setSteps ] = useState < Step [ ] > ( initialSteps ) ;
46+ const sheet = useProjectSheetStore ( ) ;
47+ // const [submissionStatus, setSubmissionStatus] = useState('idle');
48+ // const [steps, setSteps] = useState<Step[]>(initialSteps);
4649
47- const handleSuccess = ( ) => {
48- setSubmissionStatus ( 'success' ) ;
49- setSteps ( prevSteps =>
50- prevSteps . map ( ( step , index ) => {
51- if ( index === 0 ) {
52- return { ...step , state : 'completed' } ;
53- }
54- if ( index === 1 ) {
55- return { ...step , state : 'active' } ;
56- }
57- return step ;
58- } )
59- ) ;
60- } ;
50+ // const handleSuccess = () => {
51+ // setSubmissionStatus('success');
52+ // setSteps(prevSteps =>
53+ // prevSteps.map((step, index) => {
54+ // if (index === 0) {
55+ // return { ...step, state: 'completed' };
56+ // }
57+ // if (index === 1) {
58+ // return { ...step, state: 'active' };
59+ // }
60+ // return step;
61+ // })
62+ // );
63+ // };
6164
62- const renderContent = ( ) => {
63- switch ( submissionStatus ) {
64- case 'submitting' :
65- return < ProjectSubmissionLoading /> ;
66- case 'success' :
67- return < ProjectSubmissionSuccess /> ;
68- default :
69- return (
70- < ProjectSubmissionForm
71- onSuccess = { handleSuccess }
72- setSubmissionStatus = { setSubmissionStatus }
73- />
74- ) ;
75- }
76- } ;
65+ // const renderContent = () => {
66+ // switch (submissionStatus) {
67+ // case 'submitting':
68+ // return <ProjectSubmissionLoading />;
69+ // case 'success':
70+ // return <ProjectSubmissionSuccess />;
71+ // default:
72+ // return (
73+ // <ProjectSubmissionForm
74+ // onSuccess={handleSuccess}
75+ // setSubmissionStatus={setSubmissionStatus}
76+ // />
77+ // );
78+ // }
79+ // };
7780
7881 return (
7982 < motion . header
@@ -141,7 +144,10 @@ const Header = () => {
141144 size = 'default'
142145 icon = { < Plus className = 'w-4 h-4 sm:w-5 sm:h-5' /> }
143146 iconPosition = 'right'
144- onClick = { ( ) => setOpen ( true ) }
147+ onClick = { ( ) => {
148+ sheet . openInitialize ( ) ;
149+ setOpen ( true ) ;
150+ } }
145151 >
146152 New Project
147153 </ BoundlessButton >
@@ -156,13 +162,23 @@ const Header = () => {
156162 />
157163 </ motion . div >
158164 </ motion . div >
159-
160- < BoundlessSheet open = { open } setOpen = { setOpen } >
161- < div className = 'flex' >
162- < Stepper steps = { steps } />
163- < div className = 'flex-1' > { renderContent ( ) } </ div >
165+ < ProjectSheetFlow
166+ open = { open || sheet . open }
167+ onOpenChange = { o => {
168+ setOpen ( o ) ;
169+ sheet . setOpen ( o ) ;
170+ } }
171+ />
172+ { /* <BoundlessSheet open={open} setOpen={setOpen}>
173+ <div className='flex justify-between'>
174+ <div className='flex-1'>
175+ <Stepper steps={steps} />
176+ </div>
177+ <div className='flex-1'>
178+ <div className='flex-1'>{renderContent()}</div>
179+ </div>
164180 </div>
165- </ BoundlessSheet >
181+ </BoundlessSheet> */ }
166182 </ motion . header >
167183 ) ;
168184} ;
0 commit comments