-
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
Showing
96 changed files
with
13,811 additions
and
10,591 deletions.
There are no files selected for viewing
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
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,31 @@ | ||
import { ArrowRightIcon } from "@radix-ui/react-icons"; | ||
import { type ClassValue } from "clsx"; | ||
|
||
import { cn } from "~/lib/utils"; | ||
|
||
export interface ArrowProps { | ||
orientation?: "up" | "right" | "down" | "left"; | ||
className?: string | ClassValue[]; | ||
} | ||
|
||
export function Arrow({ orientation = "right", className }: ArrowProps) { | ||
return ( | ||
<> | ||
<div | ||
className={cn( | ||
"flex h-12 w-12 items-center rounded-full border border-current text-current", | ||
className, | ||
)} | ||
> | ||
<ArrowRightIcon | ||
className={cn( | ||
"mx-auto h-8 w-8", | ||
orientation === "down" && "rotate-90", | ||
orientation === "left" && "rotate-180", | ||
orientation === "up" && "-rotate-90", | ||
)} | ||
/> | ||
</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,33 @@ | ||
/** | ||
* This function converts plain text with links into text | ||
* where the links have been replaced with an anchor tag. | ||
* Grabbed this from here: https://www.30secondsofcode.org/react/s/auto-link/ | ||
* @param { text } | ||
* @returns A string of text where the detected links were replaced with anchor tags. | ||
*/ | ||
export function AutoLink({ text }: { text: string }) { | ||
const delimiter = | ||
/((?:https?:\/\/)?(?:(?:[a-z0-9]?(?:[a-z0-9\-]{1,61}[a-z0-9])?\.[^\.|\s])+[a-z\.]*[a-z]+|(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3})(?::\d{1,5})*[a-z0-9.,_\/~#&=;%+?\-\\(\\)]*)/gi; | ||
|
||
return ( | ||
<> | ||
{text.split(delimiter).map((word) => { | ||
const match = word.match(delimiter); | ||
if (match) { | ||
const url = match[0]; | ||
return ( | ||
<a | ||
target="_blank" | ||
rel="noreferrer" | ||
href={url.startsWith("http") ? url : `http://${url}`} | ||
className="underline" | ||
> | ||
{url} | ||
</a> | ||
); | ||
} | ||
return word; | ||
})} | ||
</> | ||
); | ||
} |
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
Oops, something went wrong.