mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
Refine profile editing components in account settings.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
8d62fe0094
commit
0ca4403ff7
@ -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"
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user