This file contains hidden or 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
| import useProgressiveSpin from "@/hooks/use-progressive-spin"; | |
| import { motion } from "motion/react"; | |
| export default function SpinningDisjointedYellowPolygon({ | |
| wrapperClassName, | |
| children | |
| }: { | |
| wrapperClassName?: string; | |
| children: JSX.Element; | |
| }) { |
This file contains hidden or 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
| import { toast } from "sonner"; | |
| export default async function copyToClipboard(text: string) { | |
| await navigator.clipboard.writeText(text); | |
| toast.success("Copied to clipboard", { | |
| duration: 2000, | |
| position: "bottom-center", | |
| }); | |
| } |
This file contains hidden or 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
| import { z } from "zod"; | |
| const envSchema = z.object({ | |
| NEXT_PUBLIC_SUPABASE_URL: z.string().trim().min(1), | |
| NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY: z.string().trim().min(1), | |
| }); | |
| function validateEnv() { | |
| try { | |
| return envSchema.parse({ |
This file contains hidden or 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
| import { useCooldown } from "@/hooks/useCoolDown"; | |
| const { remainingTime, startCooldown } = useCooldown( | |
| "forgot_password_timestamp", | |
| 2 * 60 * 1000, // 2 minutes | |
| ); | |
| async function onSubmit(data: ForgotPasswordFormData) { | |
| try { | |
| // Process form... |
This file contains hidden or 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
| "use client"; | |
| import React from "react"; | |
| import { motion } from "framer-motion"; | |
| import useCountUp from "@/hooks/useCountUp"; | |
| const stats = [ | |
| { value: "500+", label: "Label A" }, | |
| { value: "97%", label: "Label B" }, | |
| { value: "200+", label: "Label C" }, |
This file contains hidden or 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
| import useHCaptcha from "@/hooks/useHCaptcha"; | |
| import HCaptcha from "@hcaptcha/react-hcaptcha"; | |
| const { captchaToken, resetCaptcha, captchaProps } = useHCaptcha(); | |
| async function onSubmit(data: LoginFormData) { | |
| if (!captchaToken) { | |
| toast.error("Please complete the captcha verification"); | |
| return; | |
| } |
This file contains hidden or 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
| "use client"; | |
| import { cn } from "@/lib/utils"; | |
| import type { FieldError, FieldValues, Path, UseFormRegister } from "react-hook-form"; | |
| import { Eye, EyeOff } from "lucide-react"; | |
| import { useState } from "react"; | |
| interface NewFormInputProps<T extends FieldValues> { | |
| name: Path<T>; | |
| type: string; |
This file contains hidden or 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
| 1. Add the remote repo: git remote add newRemoteName https://remote-url | |
| 2. Ensure local branch is up to date: | |
| - git switch main | |
| - git pull origin main | |
| 3. Fetch all commits from the new remote: git fetch newRemoteName | |
| 4. Merge unrelated histories: git merge newRemoteName/main --allow-unrelated-histories | |
| 5. Resolve (all possible) conflicts, and then commit | |
| 6. Finally, push the merged history back: git push newRemoteName main |
This file contains hidden or 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
| const uploadUrl = `https://api.cloudinary.com/v1_1/${cloud_name}/image/upload`; | |
| const uploadData = await new Promise<{ secure_url: string }>( | |
| (resolve, reject) => { | |
| // create XMLHttpRequest object | |
| const xhr = new XMLHttpRequest(); | |
| // open POST request to Cloudinary upload endpoint | |
| xhr.open("POST", uploadUrl); | |
| // set upload onprogress event listener to update progress bar | |
| xhr.upload.onprogress = (event) => { |
This file contains hidden or 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
| // THEME TOGGLING FOR SEPARATE LIGHT, DARK AND SYSTEM THEME BUTTONS | |
| // user setting theme to light mode | |
| function setLightTheme() { | |
| document.documentElement.classList.remove("dark"); | |
| localStorage.setItem("theme", "light"); | |
| } | |
| // user setting theme to dark mode | |
| function setDarkTheme() { | |
| document.documentElement.classList.add("dark"); |
NewerOlder