-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade prettier, add some ui elements, add the Register page. (#670)
- Loading branch information
Showing
29 changed files
with
885 additions
and
490 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
{} | ||
{ | ||
"plugins": ["prettier-plugin-tailwindcss"] | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from "react"; | ||
|
||
const FormError: React.FC<{ message?: string; className?: string }> = ({ | ||
message, | ||
className, | ||
}) => { | ||
return ( | ||
<span | ||
role="alert" | ||
className={`absolute mt-0.5 text-xs text-red-700 ${className ?? ""}`} | ||
> | ||
{message ?? "This field is invalid."} | ||
</span> | ||
); | ||
}; | ||
|
||
export default FormError; |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from "react"; | ||
|
||
const FormLabel: React.FC<{ | ||
label?: string; | ||
required?: boolean; | ||
className?: string; | ||
}> = ({ label, required = false, className }) => { | ||
return ( | ||
<div | ||
className={`flex flex-row items-center gap-1 text-sm font-medium leading-6 text-gray-700 ${ | ||
className ?? "" | ||
}`} | ||
> | ||
{label} | ||
{required && <span className="text-red-700"> *</span>} | ||
</div> | ||
); | ||
}; | ||
|
||
export default FormLabel; |
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import React from "react"; | ||
import { | ||
ClipboardDocumentIcon as ClipboardDocumentIcon24, | ||
HomeIcon as HomeIcon24, | ||
MapIcon as MapIcon24, | ||
TrophyIcon as TrophyIcon24, | ||
ChartBarIcon as ChartBarIcon24, | ||
ClockIcon as ClockIcon24, | ||
UserGroupIcon as UserGroupIcon24, | ||
ArrowUpTrayIcon as ArrowUpTrayIcon24, | ||
PlayCircleIcon as PlayCircleIcon24, | ||
ChevronDownIcon as ChevronDownIcon24, | ||
CheckIcon as CheckIcon24, | ||
InformationCircleIcon as InformationCircleIcon24, | ||
} from "@heroicons/react/24/outline"; | ||
|
||
import { | ||
ClipboardDocumentIcon as ClipboardDocumentIcon20, | ||
HomeIcon as HomeIcon20, | ||
MapIcon as MapIcon20, | ||
TrophyIcon as TrophyIcon20, | ||
ChartBarIcon as ChartBarIcon20, | ||
ClockIcon as ClockIcon20, | ||
UserGroupIcon as UserGroupIcon20, | ||
ArrowUpTrayIcon as ArrowUpTrayIcon20, | ||
PlayCircleIcon as PlayCircleIcon20, | ||
ChevronDownIcon as ChevronDownIcon20, | ||
CheckIcon as CheckIcon20, | ||
InformationCircleIcon as InformationCircleIcon20, | ||
} from "@heroicons/react/20/solid"; | ||
|
||
const icons24 = { | ||
clipboard_document: ClipboardDocumentIcon24, | ||
home: HomeIcon24, | ||
map: MapIcon24, | ||
trophy: TrophyIcon24, | ||
chart_bar: ChartBarIcon24, | ||
clock: ClockIcon24, | ||
user_group: UserGroupIcon24, | ||
arrow_up_tray: ArrowUpTrayIcon24, | ||
play_circle: PlayCircleIcon24, | ||
chevron_down: ChevronDownIcon24, | ||
check: CheckIcon24, | ||
information_circle: InformationCircleIcon24, | ||
}; | ||
|
||
const icons20 = { | ||
clipboard_document: ClipboardDocumentIcon20, | ||
home: HomeIcon20, | ||
map: MapIcon20, | ||
trophy: TrophyIcon20, | ||
chart_bar: ChartBarIcon20, | ||
clock: ClockIcon20, | ||
user_group: UserGroupIcon20, | ||
arrow_up_tray: ArrowUpTrayIcon20, | ||
play_circle: PlayCircleIcon20, | ||
chevron_down: ChevronDownIcon20, | ||
check: CheckIcon20, | ||
information_circle: InformationCircleIcon20, | ||
}; | ||
|
||
export type IconName = keyof typeof icons24 | keyof typeof icons20; | ||
|
||
export interface IconProps { | ||
name: IconName; | ||
size?: "sm" | "md" | "xs"; | ||
className?: string; | ||
} | ||
|
||
const sizeToClass = { | ||
sm: "h-5 w-5", | ||
md: "h-6 w-6", | ||
xs: "h-4 w-4", | ||
}; | ||
|
||
const Icon: React.FC<IconProps> = ({ | ||
name, | ||
size = "md", | ||
className = "", | ||
}: IconProps) => { | ||
const IconComponent = size === "md" ? icons24[name] : icons20[name]; | ||
return <IconComponent className={`${sizeToClass[size]} ${className}`} />; | ||
}; | ||
|
||
export default Icon; |
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.