feat: add username availability check API endpoint
feat: create user image retrieval API endpoint feat: enhance coin page with dynamic data fetching and improved UI feat: implement coin creation form with validation and submission logic feat: add user settings page with profile update functionality
This commit is contained in:
parent
9aa4ba157b
commit
16ad425bb5
48 changed files with 3030 additions and 326 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { PUBLIC_B2_BUCKET, PUBLIC_B2_ENDPOINT } from "$env/static/public";
|
||||
import { clsx, type ClassValue } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
|
|
@ -25,3 +26,20 @@ export function getTimeBasedGreeting(name: string): string {
|
|||
return `Good night, ${name}`;
|
||||
}
|
||||
}
|
||||
|
||||
export function getPublicUrl(key: string | null): string | null {
|
||||
if (!key) return null;
|
||||
return `${PUBLIC_B2_ENDPOINT}/${PUBLIC_B2_BUCKET}/${key}`;
|
||||
}
|
||||
|
||||
export function debounce(func: (...args: any[]) => void, wait: number) {
|
||||
let timeout: number | undefined;
|
||||
return function executedFunction(...args: any[]) {
|
||||
const later = () => {
|
||||
clearTimeout(timeout);
|
||||
func(...args);
|
||||
};
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(later, wait);
|
||||
};
|
||||
}
|
||||
Reference in a new issue