@@ -10,7 +10,7 @@ import React, {
10
10
} from 'react' ;
11
11
import { useRouter } from 'next/navigation' ;
12
12
import _ , { zip } from 'lodash' ;
13
- import { ChevronsUp , Info , Plus , SpellCheck , Trash } from 'lucide-react' ;
13
+ import { ChevronsUp , Info , SpellCheck , X } from 'lucide-react' ;
14
14
import { toast } from 'sonner' ;
15
15
16
16
import { useAskForFeedback } from '@/components/ask-for-feedback-provider' ;
@@ -437,11 +437,12 @@ const AddLevelPage = () => {
437
437
onScroll = { onScrollChange }
438
438
>
439
439
< CardContent className = 'p-6 pt-2' >
440
- < div className = 'mt-2 text-sm leading-snug text-muted-foreground' >
440
+ < div className = 'mt-2 text-xs leading-snug text-muted-foreground' >
441
441
You can create your custom topics here! Fill up the fields below and submit your topics.
442
442
Your topic will be reviewed and uploaded to Taboo AI within 3 working days!{ ' ' }
443
443
< span >
444
444
< InfoButton
445
+ className = 'absolute right-0 top-0'
445
446
size = { 15 }
446
447
tooltip = 'Read about Taboo AI content policy'
447
448
title = 'Taboo AI content policy'
@@ -460,7 +461,7 @@ const AddLevelPage = () => {
460
461
</ span >
461
462
</ div >
462
463
< div className = 'mt-4 flex flex-col gap-1' >
463
- < Label className = 'text-lg ' htmlFor = 'input-topicName' >
464
+ < Label className = 'text-md ' htmlFor = 'input-topicName' >
464
465
1. Topic name
465
466
</ Label >
466
467
< div className = 'relative w-full' >
@@ -472,7 +473,7 @@ const AddLevelPage = () => {
472
473
: topicName . length > 0
473
474
? '!border-green-500'
474
475
: '!border-border' ,
475
- 'w-full pr-[40px]'
476
+ 'w-full pr-[40px] text-sm '
476
477
) }
477
478
value = { topicName }
478
479
placeholder = 'Name for your topic...'
@@ -491,11 +492,11 @@ const AddLevelPage = () => {
491
492
< p className = 'my-1 animate-fade-in text-xs text-red-500' > { topicNameErrorMessage } </ p >
492
493
) }
493
494
< Separator className = 'mb-1 mt-2' />
494
- < Label className = 'text-lg ' > 2. Assess the difficulty level for your topic</ Label >
495
+ < Label className = 'text-md ' > 2. Assess the difficulty level for your topic</ Label >
495
496
< RadioGroup
496
497
onValueChange = { setDifficultyLevel }
497
498
value = { difficultyLevel }
498
- className = 'flex flex-row items-center gap-2'
499
+ className = 'mt-2 flex flex-row items-center gap-2'
499
500
>
500
501
< div className = 'flex flex-row items-center gap-2' >
501
502
< RadioGroupItem id = 'diff-1' value = '1' />
@@ -512,34 +513,35 @@ const AddLevelPage = () => {
512
513
</ RadioGroup >
513
514
< Separator className = 'mb-1 mt-2' />
514
515
< div className = 'flex flex-col gap-2' >
515
- < div className = 'flex flex-row items-center justify-between' >
516
+ < div className = 'flex flex-row items-center justify-between gap-x-4 ' >
516
517
< Label className = 'mt-2 text-lg text-primary' htmlFor = 'ai-switch' >
517
518
3. Use AI to generate taboo words for each target word?
518
519
</ Label >
519
520
< Switch
520
521
id = 'ai-switch'
522
+ className = 'cursor-default'
521
523
checked = { shouldUseAIForTabooWords }
522
524
onCheckedChange = { ( checked ) => {
523
525
setShouldUseAIForTabooWords ( checked ) ;
524
526
} }
525
527
/>
526
528
</ div >
527
- < p className = 'text-sm leading-tight text-muted-foreground' >
529
+ < p className = 'text-xs leading-tight text-muted-foreground' >
528
530
If turned on, you are not required to create taboo words for each target word that
529
531
you created. After submission, if your submission passes the review, we will use AI
530
532
to create the taboo words for you.
531
533
</ p >
532
534
</ div >
533
535
< Separator className = 'mb-1 mt-2' />
534
- < Label className = 'text-lg ' >
536
+ < Label className = 'text-md ' >
535
537
4. Give at least 3 target words relevant to the topic provided
536
538
</ Label >
537
539
{ targetWordsErrorMessage && (
538
540
< p className = 'animate-fade-in text-xs text-red-500' > { targetWordsErrorMessage } </ p >
539
541
) }
540
542
< div className = 'my-4 flex w-full flex-row flex-wrap items-center justify-start gap-4' >
541
543
{ targetWords . map ( ( w , i ) => (
542
- < div key = { i } className = 'relative w-full lg:w-52 ' >
544
+ < div key = { i } className = 'relative w-full' >
543
545
< Input
544
546
autoFocus
545
547
disabled = { tabooWordsCheckingStatus [ i ] }
@@ -565,33 +567,33 @@ const AddLevelPage = () => {
565
567
asChild
566
568
tooltip = 'Delete'
567
569
disabled = { tabooWordsCheckingStatus [ i ] }
568
- className = 'absolute -right-3 -top-4 z-10 rounded-full p-2 shadow-sm'
569
570
aria-label = { `delete this target word with index ${ i } ` }
570
- variant = 'destructive'
571
+ className = 'absolute right-1 top-1 z-10 rounded-full p-2'
572
+ variant = 'link'
571
573
onClick = { ( ) => {
572
574
deleteTargetWordAtIndex ( i ) ;
573
575
} }
574
576
>
575
- < Trash size = { 15 } />
577
+ < X size = { 12 } />
576
578
</ IconButton >
577
579
</ div >
578
580
) ) }
579
581
{ targetWords . length < MAX_TARGET_WORDS_COUNT && (
580
- < IconButton
581
- asChild
582
- tooltip = 'Add target word'
582
+ < Button
583
583
key = 'add-button'
584
584
aria-label = 'add a new target word'
585
+ className = 'w-full rounded-md'
586
+ variant = 'outline'
585
587
onClick = { addNewTargetWord }
586
588
>
587
- < Plus />
588
- </ IconButton >
589
+ New target word...
590
+ </ Button >
589
591
) }
590
592
</ div >
591
593
{ ! shouldUseAIForTabooWords && (
592
594
< >
593
595
< Separator className = 'mb-1 mt-2' />
594
- < Label className = 'text-lg ' >
596
+ < Label className = 'text-md ' >
595
597
5. For each target word, define at least 5 taboo words
596
598
</ Label >
597
599
< Accordion
@@ -632,13 +634,13 @@ const AddLevelPage = () => {
632
634
</ b >
633
635
</ div >
634
636
</ AccordionTrigger >
635
- < AccordionContent key = { i } className = 'px-4 ' >
637
+ < AccordionContent key = { i } className = 'px-1 ' >
636
638
{ tabooWordsCheckingStatus [ i ] ? (
637
639
< Skeleton numberOfRows = { 2 } />
638
640
) : (
639
641
< div >
640
642
{ tabooWordsExistedStatus [ i ] && (
641
- < div className = 'text-primary ' >
643
+ < div className = 'text-xs text-muted-foreground ' >
642
644
< span >
643
645
Taboo words for "{ w } " have already been defined in our
644
646
system by others. In order to respect the contents created by
@@ -651,7 +653,7 @@ const AddLevelPage = () => {
651
653
< PopoverTrigger asChild >
652
654
< IconButton
653
655
tooltip = 'How to appeal?'
654
- className = '!m-0 !w-fit !p-0 '
656
+ className = 'inline '
655
657
variant = 'link'
656
658
>
657
659
< Info size = { 12 } />
@@ -681,7 +683,7 @@ const AddLevelPage = () => {
681
683
682
684
< div className = 'my-4 flex w-full flex-row flex-wrap items-center justify-start gap-4' >
683
685
{ tabooWords [ i ] . map ( ( tw , ti ) => (
684
- < div key = { `taboo-${ ti } ` } className = 'relative w-full lg:w-52 ' >
686
+ < div key = { `taboo-${ ti } ` } className = 'relative w-full' >
685
687
< Input
686
688
autoFocus
687
689
disabled = { tabooWordsExistedStatus [ i ] ?? false }
@@ -709,15 +711,15 @@ const AddLevelPage = () => {
709
711
asChild
710
712
tooltip = 'Delete'
711
713
disabled = { tabooWordsCheckingStatus [ i ] }
712
- className = 'absolute - right-3 - top-4 z-10 rounded-full p-2 shadow-sm '
714
+ className = 'absolute right-1 top-1 z-10 rounded-full p-2'
713
715
hidden = { tabooWordsExistedStatus [ i ] ?? false }
714
- variant = 'destructive '
716
+ variant = 'link '
715
717
aria-label = { `delete this target word with index ${ i } ` }
716
718
onClick = { ( ) => {
717
719
deleteTabooWordAtIndex ( i , ti ) ;
718
720
} }
719
721
>
720
- < Trash size = { 15 } />
722
+ < X size = { 12 } />
721
723
</ IconButton >
722
724
</ >
723
725
) }
@@ -726,17 +728,15 @@ const AddLevelPage = () => {
726
728
</ div >
727
729
{ ! ( tabooWordsExistedStatus [ i ] ?? false ) &&
728
730
tabooWords [ i ] . length < MAX_TABOO_WORDS_COUNT && (
729
- < IconButton
730
- asChild
731
- tooltip = 'Add target word'
731
+ < Button
732
732
key = 'add-button'
733
- aria-label = 'add a new target word'
734
- onClick = { ( ) => {
735
- addNewTabooWord ( i ) ;
736
- } }
733
+ aria-label = 'add a new taboo word'
734
+ className = 'w-full rounded-md'
735
+ variant = 'outline'
736
+ onClick = { ( ) => addNewTabooWord ( i ) }
737
737
>
738
- < Plus />
739
- </ IconButton >
738
+ New taboo word...
739
+ </ Button >
740
740
) }
741
741
</ div >
742
742
) }
0 commit comments