Skip to content

Commit 81d968a

Browse files
committed
fix: typescript errors on old wizard and statementbuilder
1 parent ae97d1c commit 81d968a

File tree

3 files changed

+4
-197
lines changed

3 files changed

+4
-197
lines changed

src/components/MainPage.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use client';
22

33
import React from 'react';
4-
// import StatementBuilder from './StatementBuilder';
54
import StatementList from './statements/StatementList';
65
import { useStatements } from '../hooks/useStatements';
76

@@ -15,12 +14,6 @@ const MainPage: React.FC = () => {
1514
</h1>
1615
<div className='container mx-auto px-4'>
1716
<StatementList username={username} />
18-
19-
{/* <div className='flex flex-col justify-center max-w-3xl mx-auto'>
20-
<div className='bg-white rounded-xl shadow-lg p-6'>
21-
<StatementBuilder username={username} />
22-
</div>
23-
</div> */}
2417
</div>
2518
</main>
2619
);

src/components/StatementBuilder.tsx

Lines changed: 0 additions & 188 deletions
This file was deleted.

src/components/StatementWizardOld.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import type { Statement, DescriptorsData } from '../../types/types';
2121
type Step = 'closed' | 'who' | 'action' | 'object' | 'privacy';
2222

2323
const StatementWizard: React.FC<{ username: string }> = ({ username }) => {
24-
const { dispatch } = useStatements();
24+
const { setData } = useStatements();
2525

2626
const [isOpen, setIsOpen] = useState(false);
2727
const [step, setStep] = useState<Step>('closed');
@@ -31,6 +31,7 @@ const StatementWizard: React.FC<{ username: string }> = ({ username }) => {
3131
verb: '',
3232
object: '',
3333
isPublic: false,
34+
category: '',
3435
});
3536
const [selectedCategory, setSelectedCategory] = useState<string | null>(null);
3637

@@ -124,6 +125,7 @@ const StatementWizard: React.FC<{ username: string }> = ({ username }) => {
124125
verb: '',
125126
object: '',
126127
isPublic: false,
128+
category: '',
127129
});
128130
};
129131

@@ -157,7 +159,7 @@ const StatementWizard: React.FC<{ username: string }> = ({ username }) => {
157159
};
158160

159161
// Dispatch the new statement to the context.
160-
dispatch({ type: 'ADD_STATEMENT', payload: newStatement });
162+
setData({ type: 'ADD_STATEMENT', payload: newStatement });
161163

162164
// Post the new statement to the backend.
163165
await postNewStatement(newStatement);

0 commit comments

Comments
 (0)