Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 64 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"postcss": "^8.5.6",
"prettier": "^3.6.2",
"prettier-plugin-tailwindcss": "^0.6.14",
"supabase": "^2.40.7",
"supabase": "^2.95.6",
"tailwindcss": "^4.1.12",
"tw-animate-css": "^1.4.0",
"typescript": "^5.9.2",
Expand Down
10 changes: 4 additions & 6 deletions src/features/landing/pages/LandingPage.tsx
Comment thread
agneee-dev marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,17 @@ const AppMockup = () => {
<div
key={i}
className={`flex items-center gap-3 p-2 rounded-lg
${
option === '256'
${option === '256'
? 'bg-blue-500/10 border border-blue-500/30 ring-2 ring-blue-500/20'
: 'bg-slate-100/50 border border-slate-200 dark:bg-slate-800/50 dark:border-slate-700'
}`}
}`}
>
<div
className={`w-5 h-5 rounded-full border-2
${
option === '256'
${option === '256'
? 'border-blue-500 bg-blue-500 flex items-center justify-center'
: 'border-slate-400'
}`}
}`}
>
{option === '256' && (
<div className="w-2 h-2 rounded-full bg-white"></div>
Expand Down
14 changes: 13 additions & 1 deletion src/features/practice/components/PracticeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,26 @@ const PracticeCard = () => {
};

// Keyboard Shortcuts
const hasSelection = selectedOptionIndices.length > 0 || numericalAnswer !== null;

useKeyboardShortcuts(
{
onPrev: handlePrevious,
onNext: handleNext,
onShowAnswer: handleShowAnswer,
onSubmit: handleSubmit,
onExplain: () => onExplanationClick(),
hasSelection,
},
[safeQuestion],
[
safeQuestion,
hasSelection,
handleShowAnswer,
handleSubmit,
handleNext,
handlePrevious,
onExplanationClick,
],
);

// 7. Side Effects: Audio Handling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type ActionButtonsProps = {
handleSubmit?: (() => void) | undefined;
handleExplainationClick: () => void;
isCompatible: boolean | undefined;
hasSelection?: boolean;
};

const ActionButtons = ({
Expand All @@ -23,6 +24,7 @@ const ActionButtons = ({
handleSubmit,
handleExplainationClick,
isCompatible,
hasSelection,
}: ActionButtonsProps) => {
return (
<div className="flex fixed sm:static bottom-0 left-0 w-full z-30 p-2 gap-1 flex-row justify-between items-center bg-white dark:bg-zinc-900 border-t border-border-primary dark:border-border-primary-dark">
Expand Down Expand Up @@ -56,7 +58,7 @@ const ActionButtons = ({
>
<Eye className="inline text-lg" />
<span className="hidden md:inline ml-2">
Submit <span className="font-mono">[⎵/↵]</span>
Submit {hasSelection && <span className="font-mono">[⎵/↵]</span>}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just makes it does not appear until the answer is not selected but it will still work regardless keeping this does not make sense I think. Instead what we can do is disable the Submit button until something is selected or typed in case of NAT and keep the Show Answer as always working cause that is the surrender button.

This will be better UX. Otherwise the thing is already fixed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay - I am on to it ... i'll let you know after modifying

</span>
</Button>
<Button
Expand All @@ -67,7 +69,7 @@ const ActionButtons = ({
>
<Flag className="inline text-lg" />
<span className="hidden md:inline ml-2">
Show Answer <span className="font-mono">[⎵/↵]</span>
Show Answer {!hasSelection && <span className="font-mono">[⎵/↵]</span>}
</span>
</Button>
</>
Expand Down
Loading