Skip to content

Commit 6728518

Browse files
committed
style: style snoozed questions when collapsed
1 parent 127e7c2 commit 6728518

File tree

1 file changed

+34
-35
lines changed

1 file changed

+34
-35
lines changed

src/features/statements/components/StatementList.tsx

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ const StatementList: React.FC<{ username: string }> = ({ username }) => {
335335
updateEntry(updatedStatement);
336336
};
337337

338-
// State for managing the visibility of the snoozed section
339-
const [isSnoozedQuestionsSectionExpanded, setIsSnoozedQuestionsSectionExpanded] = useState(false);
338+
// State for managing the visibility of the snoozed section - default to expanded
339+
const [isSnoozedQuestionsSectionExpanded, setIsSnoozedQuestionsSectionExpanded] = useState(true);
340340

341341
// Move the hook call to the top level
342342
const { categoryCounts } = useAnsweredCountByCategory();
@@ -458,45 +458,44 @@ const StatementList: React.FC<{ username: string }> = ({ username }) => {
458458

459459
return (
460460
<div className='mb-8 mt-4'>
461-
{/* Folder Tab Design for Snoozed Questions */}
462-
<div className={`relative z-10`}>
461+
{/* New and improved Snoozed Questions section */}
462+
<div className={`border rounded-lg overflow-hidden bg-white ${isSnoozedQuestionsSectionExpanded ? 'border-blue-300' : 'border-blue-200'}`}>
463+
{/* Header/Tab that's always visible */}
463464
<div
464-
className={`inline-block px-4 py-2 rounded-t-lg bg-blue-100 border-blue-300 border-t border-l border-r border-b-0 cursor-pointer`}
465+
className={`flex items-center justify-between px-4 py-3 bg-blue-100 cursor-pointer ${isSnoozedQuestionsSectionExpanded ? 'border-b border-blue-300' : ''}`}
465466
onClick={() => setIsSnoozedQuestionsSectionExpanded(!isSnoozedQuestionsSectionExpanded)}
466467
>
467-
<div className="flex items-center justify-between min-w-[200px]">
468-
<h3 className='text-lg font-semibold flex items-center text-blue-700'>
469-
<BellOff className='h-5 w-5 mr-2' />
470-
Snoozed Questions
471-
</h3>
472-
<div className='flex items-center'>
473-
<span className="mr-2 text-blue-700">({snoozedQuestions.length})</span>
474-
{isSnoozedQuestionsSectionExpanded ? (
475-
<ChevronUp className='h-5 w-5 text-blue-600' />
476-
) : (
477-
<ChevronDown className='h-5 w-5 text-blue-600' />
478-
)}
479-
</div>
468+
<h3 className='text-lg font-semibold flex items-center text-blue-700'>
469+
<BellOff className='h-5 w-5 mr-2' />
470+
Snoozed Questions
471+
</h3>
472+
<div className='flex items-center'>
473+
<span className="mr-2 text-blue-700 font-medium">({snoozedQuestions.length})</span>
474+
{isSnoozedQuestionsSectionExpanded ? (
475+
<ChevronUp className='h-5 w-5 text-blue-600' />
476+
) : (
477+
<ChevronDown className='h-5 w-5 text-blue-600' />
478+
)}
480479
</div>
481480
</div>
481+
482+
{/* Content section that appears/disappears */}
483+
{isSnoozedQuestionsSectionExpanded && (
484+
<div className="p-4 bg-white">
485+
<ul className='space-y-2'>
486+
{snoozedQuestions.map((question) => (
487+
<li key={`snoozed-${question.id}`}>
488+
<QuestionCard
489+
presetQuestion={question}
490+
onSelect={() => {/* Disabled for snoozed questions */}}
491+
onToggleSnooze={handleToggleQuestionSnooze}
492+
/>
493+
</li>
494+
))}
495+
</ul>
496+
</div>
497+
)}
482498
</div>
483-
484-
{/* Folder Content for Snoozed Questions */}
485-
{isSnoozedQuestionsSectionExpanded && (
486-
<div className="border rounded-tr-lg rounded-b-lg p-4 -mt-[1px] bg-white border-blue-300">
487-
<ul className='space-y-2'>
488-
{snoozedQuestions.map((question) => (
489-
<li key={`snoozed-${question.id}`}>
490-
<QuestionCard
491-
presetQuestion={question}
492-
onSelect={() => {/* Disabled for snoozed questions */}}
493-
onToggleSnooze={handleToggleQuestionSnooze}
494-
/>
495-
</li>
496-
))}
497-
</ul>
498-
</div>
499-
)}
500499
</div>
501500
);
502501
};

0 commit comments

Comments
 (0)