-
Notifications
You must be signed in to change notification settings - Fork 37
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
Use shadcn/ui
as the primary component library for the frontend.
#104
Merged
Merged
Changes from 31 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
c3e68e5
fix: readme
ultraviolet10 61df2f5
update packages
ultraviolet10 a409a0a
add new font
ultraviolet10 5d71404
add new spinner svg for loading state modals
ultraviolet10 632a45d
shadcn component scripts + util func for classname merges
ultraviolet10 1260dde
recreate `coffee` theme from daisy UI within global styles
ultraviolet10 4f17825
redo navbar
ultraviolet10 8e30831
relocate `loadingModal`, update imports
ultraviolet10 f85417c
redo common modal elements
ultraviolet10 a1b5aa4
preload font into `_app` before render
ultraviolet10 470ce60
update pages with new components
ultraviolet10 9acbcf9
update `MintDeckModal`
ultraviolet10 5b66baf
update modals with `Dialog` component
ultraviolet10 5b657ce
update navbar style
ultraviolet10 2827a4b
refactor `JoinGameModal`
ultraviolet10 40bafa2
add default open state for `JoinGameModal`
ultraviolet10 9a0d96d
refactor `createGameModal`
ultraviolet10 a73e0d4
Merge branch 'master' into ac/goodbye-daisy
ultraviolet10 571853d
add missing type
ultraviolet10 9746d73
remove log statement
ultraviolet10 0a17342
remove extra parent and parentheses
ultraviolet10 6294819
add references for new components
ultraviolet10 e77c5c0
added docs ref
ultraviolet10 4e54154
use absoute imports for ui components
ultraviolet10 7bb1ab8
add docstring for util function
ultraviolet10 554e92b
improve code readability
ultraviolet10 978f2a1
use absolute imports for components
ultraviolet10 1d39ac1
define open/close behaviour for `joinGameModal`
ultraviolet10 8ca7ea3
Merge branch 'master' into goodbye-daisy
ultraviolet10 97d7a39
define open/close behaviour for `CreateGameModal`
ultraviolet10 6dd18e0
update event handlers for dialog components
ultraviolet10 4292863
fix: typo
ultraviolet10 eb5989b
abstract keyclick handlers, add prop to `dialog` component
ultraviolet10 1f364bb
remove font preload, use state variable for modal default opens
ultraviolet10 03c6f1e
add missing style to dialog
ultraviolet10 40a94c5
add back dialog close button styles
ultraviolet10 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,35 @@ | ||
// ================================================================================================= | ||
|
||
|
||
import { PropsWithChildren } from "react" | ||
|
||
export const ModalTitle = ({ children }: PropsWithChildren) => { | ||
return <h3 className="text-xl font-bold normal-case">{children}</h3> | ||
} | ||
|
||
// ------------------------------------------------------------------------------------------------- | ||
import Image from "next/image" | ||
import { Button } from "src/components/ui/button" | ||
|
||
export const Spinner = () => { | ||
return <div className="flex justify-center my-8"> | ||
<span className="loading loading-spinner loading-lg text-primary"></span> | ||
</div> | ||
return ( | ||
<div className="flex justify-center my-8"> | ||
<Image | ||
height={80} | ||
width={80} | ||
src={"/img/spinner.svg"} | ||
alt="loading" | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
// ------------------------------------------------------------------------------------------------- | ||
|
||
export const ModalMenuButton = ({ display, label }: { display: () => void, label: string}) => { | ||
return <button | ||
onClick={display} | ||
className="hover:border-3 btn-lg btn btn-neutral border-2 border-green-900 text-2xl normal-case hover:scale-105 hover:border-green-800"> | ||
{label} | ||
</button> | ||
export const ModalMenuButton = ({ | ||
display, | ||
label, | ||
}: { | ||
display: () => void | ||
label: string | ||
}) => { | ||
return ( | ||
<Button variant="outline" onClick={display} className="rounded-lg p-6 font-fable text-2xl border-green-900 border-2 h-16 hover:scale-105 hover:border-green-800 hover:border-3"> | ||
{label} | ||
</Button> | ||
) | ||
} | ||
|
||
// ================================================================================================= | ||
// ================================================================================================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be reversed if I'm not mistaken. We only want to allow closing by clicking outside if we haven't created the game yet, or if we're loading while waiting for it to be created.
So
loading == null || gameStatus < GameStatus.CREATED
You also inverted the condition in the handlers has well (i.e. you prevent it from closing if "closeable" is true) so the behaviour ends up as expected, but that makes the variable name wrong