-
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
eefad3a
commit 5b11f55
Showing
29 changed files
with
608 additions
and
51 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
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> | ||
); | ||
}; |
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,52 @@ | ||
"use client"; | ||
|
||
import * as AccordionPrimitive from "@radix-ui/react-accordion"; | ||
import * as React from "react"; | ||
|
||
import { cn } from "~/lib/utils"; | ||
|
||
const Accordion = AccordionPrimitive.Root; | ||
|
||
const AccordionItem = React.forwardRef< | ||
React.ElementRef<typeof AccordionPrimitive.Item>, | ||
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> | ||
>(({ className, ...props }, ref) => ( | ||
<AccordionPrimitive.Item ref={ref} className={cn(className)} {...props} /> | ||
)); | ||
AccordionItem.displayName = "AccordionItem"; | ||
|
||
const AccordionTrigger = React.forwardRef< | ||
React.ElementRef<typeof AccordionPrimitive.Trigger>, | ||
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger> | ||
>(({ className, children, ...props }, ref) => ( | ||
<AccordionPrimitive.Header className="flex"> | ||
<AccordionPrimitive.Trigger | ||
ref={ref} | ||
className={cn( | ||
"flex flex-1 items-center justify-between font-medium transition-all", | ||
className, | ||
)} | ||
{...props} | ||
> | ||
{children} | ||
</AccordionPrimitive.Trigger> | ||
</AccordionPrimitive.Header> | ||
)); | ||
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName; | ||
|
||
const AccordionContent = React.forwardRef< | ||
React.ElementRef<typeof AccordionPrimitive.Content>, | ||
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content> | ||
>(({ className, children, ...props }, ref) => ( | ||
<AccordionPrimitive.Content | ||
ref={ref} | ||
className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down" | ||
{...props} | ||
> | ||
<div className={cn(className)}>{children}</div> | ||
</AccordionPrimitive.Content> | ||
)); | ||
|
||
AccordionContent.displayName = AccordionPrimitive.Content.displayName; | ||
|
||
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }; |
Oops, something went wrong.