Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add floating mobile menu #58

Merged
merged 2 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
feat: make mobile menu hover
  • Loading branch information
zsh-eng committed Apr 21, 2024
commit 11ff4a3a8245be512bd3bd93f3d727b02d908909
2 changes: 1 addition & 1 deletion src/components/client-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function ClientLayout({ children }: PropsWithChildren<{}>) {
>
<NavigationBar />
{children}
<Toaster />
<Toaster position="top-center" />
</ThemeProvider>
);
}
Expand Down
10 changes: 7 additions & 3 deletions src/components/flashcard/answer-buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ function AnswerButton({
<TooltipProvider key={rating}>
<Tooltip>
<TooltipTrigger asChild>
<Button variant="outline" onClick={() => onRating(rating)}>
<Button
className="h-full"
variant="outline"
onClick={() => onRating(rating)}
>
<p>{rating}</p>
</Button>
</TooltipTrigger>
Expand All @@ -52,7 +56,7 @@ export default function AnswerButtons({
const ratingsToShow: Rating[] = ["Again", "Hard", "Good", "Easy"];

return (
<div className="grid w-80 grid-cols-2 gap-x-2 gap-y-2 sm:w-96 md:grid-cols-4">
<div className="grid h-12 w-screen grid-cols-2 gap-x-2 gap-y-2 px-2 sm:w-96 md:grid-cols-4">
{open ? (
ratingsToShow.map((rating) => {
return (
Expand All @@ -70,7 +74,7 @@ export default function AnswerButtons({
) : (
<Button
variant="secondary"
className="col-span-2 font-mono hover:animate-pulse md:col-span-4"
className="invisible col-span-2 h-full font-mono hover:animate-pulse sm:visible md:col-span-4"
onClick={() => setOpen(true)}
>
space to reveal
Expand Down
4 changes: 3 additions & 1 deletion src/components/flashcard/flashcard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ export default function Flashcard({
/>
</div>

<div className="col-span-8 flex justify-center self-start justify-self-center">
<div className="h-40 sm:hidden"></div>

<div className="fixed bottom-8 z-20 col-span-8 flex justify-center self-start justify-self-center sm:static">
<AnswerButtons
schemaRatingToReviewDay={schemaRatingToReviewDay}
onRating={onRating}
Expand Down