Skip to content

Commit 40723cc

Browse files
committed
style: Next and continue buttons looks the same
1 parent 5fd3b38 commit 40723cc

File tree

3 files changed

+45
-8
lines changed

3 files changed

+45
-8
lines changed

src/components/statementWizard/PrivacySelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const PrivacySelector: React.FC<PrivacySelectorProps> = ({
5454
</div>
5555
</Button>
5656
</div>
57-
<Button className='w-full' onClick={onComplete}>
57+
<Button variant='pink' className='mx-auto' onClick={onComplete}>
5858
Create Statement
5959
</Button>
6060
</div>

src/components/statementWizard/StatementWizard.tsx

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ const StatementWizard: React.FC<StatementWizardProps> = ({
193193
const renderObjectStep = () => {
194194
const subQuestion = getSubQuestion('object');
195195
const nextStep: Step = presetQuestion ? 'privacy' : 'category';
196+
196197
return (
197198
<StepContainer subQuestion={subQuestion} showBack onBack={handleBack}>
198199
<div className='p-4 rounded-md'>
@@ -210,11 +211,12 @@ const StatementWizard: React.FC<StatementWizardProps> = ({
210211
/>
211212
</div>
212213
<Button
213-
className='w-full mt-4'
214214
onClick={() => selection.atoms.object.trim() && handleNext(nextStep)}
215215
disabled={!selection.atoms.object.trim()}
216+
variant='pink'
217+
className='mx-auto'
216218
>
217-
Continue
219+
Next
218220
</Button>
219221
</StepContainer>
220222
);
@@ -223,26 +225,60 @@ const StatementWizard: React.FC<StatementWizardProps> = ({
223225
const renderCategoryStep = () => {
224226
const subQuestion = getSubQuestion('category');
225227
const categories = statementsCategories.categories || [];
228+
const uncategorisedSelected =
229+
!selection.category || selection.category === 'uncategorised';
230+
226231
return (
227232
<StepContainer subQuestion={subQuestion} showBack onBack={handleBack}>
228233
<div className='grid grid-cols-2 gap-3 max-h-[60vh] overflow-y-auto p-2'>
229234
{categories.map((cat: { id: string; name: string }) => (
230235
<Button
231236
key={cat.id}
232-
variant={selection.category === cat.id ? 'default' : 'outline'}
233-
className='h-auto py-4 px-6 text-left flex flex-col items-start space-y-1 transition-all'
234237
onClick={() =>
235238
setSelection((prev) => ({ ...prev, category: cat.id }))
236239
}
240+
className={`
241+
h-auto py-4 px-6 text-left flex flex-col items-start transition-all whitespace-normal break-words
242+
${
243+
selection.category === cat.id
244+
? 'bg-blue-50 text-blue-600 border-blue-300'
245+
: 'bg-white text-gray-700 border-gray-300'
246+
}
247+
`}
248+
variant={selection.category === cat.id ? 'default' : 'outline'}
237249
>
238250
<span className='font-medium'>{cat.name}</span>
239251
</Button>
240252
))}
253+
254+
{/* Uncategorised button */}
255+
<Button
256+
onClick={() =>
257+
setSelection((prev) => ({ ...prev, category: 'uncategorised' }))
258+
}
259+
className={`
260+
h-auto py-4 px-6 text-left flex flex-col items-start transition-all whitespace-normal break-words
261+
${
262+
uncategorisedSelected
263+
? 'bg-blue-50 text-blue-600 border-blue-300'
264+
: 'bg-white text-gray-700 border-gray-300'
265+
}
266+
`}
267+
variant={uncategorisedSelected ? 'default' : 'outline'}
268+
>
269+
<span className='font-medium'>Uncategorised</span>
270+
</Button>
241271
</div>
272+
242273
<Button
243-
onClick={() => selection.category && handleNext('privacy')}
244-
disabled={!selection.category}
245-
className='w-full'
274+
onClick={() => {
275+
if (!selection.category) {
276+
setSelection((prev) => ({ ...prev, category: 'uncategorised' }));
277+
}
278+
handleNext('privacy');
279+
}}
280+
variant='pink'
281+
className='mx-auto'
246282
>
247283
Next
248284
</Button>

src/components/ui/buttonVariants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const buttonVariants = cva(
1414
'bg-secondary text-secondary-foreground hover:bg-secondary/80',
1515
ghost: 'hover:bg-accent hover:text-accent-foreground',
1616
link: 'text-primary underline-offset-4 hover:underline',
17+
pink: 'rounded-full flex items-center space-x-2 px-6 py-3 shadow-lg bg-brand-pink text-white text-lg hover:bg-brand-darkPurple transition-colors',
1718
},
1819
size: {
1920
default: 'h-10 px-4 py-2',

0 commit comments

Comments
 (0)