Refine profile editing components in account settings.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Developing-Gamer 2026-05-27 13:35:41 -07:00
parent 8d62fe0094
commit 0ca4403ff7
2 changed files with 6 additions and 3 deletions

View File

@ -44,7 +44,10 @@ export function EditableText(props: { value: string, onSave?: (value: string) =>
<>
<span className="text-base font-medium text-foreground">{props.value}</span>
<Button
onClick={() => setEditing(true)}
onClick={() => {
setEditingValue(props.value);
setEditing(true);
}}
size='icon'
variant='ghost'
className="rounded-lg text-muted-foreground hover:text-foreground hover:bg-zinc-100 dark:hover:bg-zinc-900 h-8 w-8 p-0 transition-colors duration-150"

View File

@ -9,12 +9,12 @@ import { UploadSimple, User } from '@phosphor-icons/react';
import { useCallback, useState } from 'react';
import Cropper, { Area } from 'react-easy-crop';
export async function checkImageUrl(url: string){
export async function checkImageUrl(url: string) {
try {
const res = await fetch(url, { method: 'HEAD' });
const buff = await res.blob();
return buff.type.startsWith('image/');
} catch (e) {
} catch {
return false;
}
}