-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa82717
commit 3b6aee4
Showing
31 changed files
with
634 additions
and
81 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
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,4 @@ | ||
export { default as Text } from "./text.svg?react"; | ||
export { default as Presentation } from "./presentation.svg?react"; | ||
export { default as Video } from "./video.svg?react"; | ||
export { default as Quiz } from "./quiz.svg?react"; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Badge } from "~/components/ui/badge"; | ||
|
||
import type { IconName } from "~/types/shared"; | ||
|
||
type ProgressBadgeProps = { | ||
progress: "completed" | "inProgress" | "notStarted"; | ||
className?: string; | ||
}; | ||
|
||
type ProgressConfig = { | ||
[key in "completed" | "inProgress" | "notStarted"]: { | ||
variant: "successFilled" | "inProgressFilled" | "notStartedFilled"; | ||
icon: IconName; | ||
label: string; | ||
}; | ||
}; | ||
|
||
export const ProgressBadge = ({ progress, className }: ProgressBadgeProps) => { | ||
const progressConfig: ProgressConfig = { | ||
completed: { | ||
variant: "successFilled", | ||
icon: "InputRoundedMarkerSuccess", | ||
label: "Completed", | ||
}, | ||
inProgress: { | ||
variant: "inProgressFilled", | ||
icon: "InProgress", | ||
label: "In Progress", | ||
}, | ||
notStarted: { | ||
variant: "notStartedFilled", | ||
icon: "NotStartedRounded", | ||
label: "Not Started", | ||
}, | ||
}; | ||
|
||
const { variant, icon, label } = progressConfig[progress]; | ||
|
||
return ( | ||
<Badge variant={variant} icon={icon} {...(Boolean(className) && { className })}> | ||
{label} | ||
</Badge> | ||
); | ||
}; |
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,15 +1,53 @@ | ||
import { | ||
BreadcrumbItem, | ||
BreadcrumbLink, | ||
BreadcrumbList, | ||
BreadcrumbSeparator, | ||
} from "~/components/ui/breadcrumb"; | ||
import { cn } from "~/lib/utils"; | ||
|
||
import type { HTMLAttributes } from "react"; | ||
import type { HTMLAttributes, ReactNode } from "react"; | ||
|
||
type PageWrapperProps = HTMLAttributes<HTMLDivElement> & { | ||
breadcrumbs?: { title: string; href: string }[]; | ||
children: ReactNode; | ||
className?: string; | ||
}; | ||
|
||
export const PageWrapper = ({ className, ...props }: PageWrapperProps) => { | ||
type Breadcrumb = { title: string; href: string }; | ||
|
||
type BreadcrumbsProps = { | ||
breadcrumbs?: Breadcrumb[]; | ||
}; | ||
|
||
export const Breadcrumbs = ({ breadcrumbs = [] }: BreadcrumbsProps) => { | ||
if (!breadcrumbs.length) return null; | ||
|
||
return ( | ||
<BreadcrumbList> | ||
{breadcrumbs.map(({ href, title }, index) => ( | ||
<BreadcrumbItem key={index}> | ||
<BreadcrumbLink href={href}>{title}</BreadcrumbLink> | ||
{index < breadcrumbs.length - 1 && <BreadcrumbSeparator />} | ||
</BreadcrumbItem> | ||
))} | ||
</BreadcrumbList> | ||
); | ||
}; | ||
|
||
export const PageWrapper = ({ className, breadcrumbs, children, ...props }: PageWrapperProps) => { | ||
const hasBreadcrumbs = Boolean(breadcrumbs); | ||
|
||
const classes = cn( | ||
"h-auto w-full pt-6 px-4 pb-4 md:px-6 md:pb-6 2xl:pt-12 2xl:px-8 2xl:pb-8", | ||
"w-full pt-6 px-4 pb-4 md:px-6 md:pb-6 3xl:pt-12 3xl:px-8 3xl:pb-8", | ||
{ "pt-8 md:pt-6 3xl:pb-2": hasBreadcrumbs }, | ||
className, | ||
); | ||
return <div className={classes} {...props} />; | ||
|
||
return ( | ||
<div className={classes} {...props}> | ||
{breadcrumbs && <Breadcrumbs breadcrumbs={breadcrumbs} />} | ||
{children} | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.