mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-12 23:15:18 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -375,9 +375,15 @@ export const ProfileForm = () => {
|
|||||||
<div
|
<div
|
||||||
className="color-avatar h-12 w-12 rounded-full border hover:p-px hover:border-primary transition-colors flex items-center justify-center overflow-hidden cursor-pointer"
|
className="color-avatar h-12 w-12 rounded-full border hover:p-px hover:border-primary transition-colors flex items-center justify-center overflow-hidden cursor-pointer"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: isSolidColorAvatar(field.value) ? field.value : undefined,
|
backgroundColor: isSolidColorAvatar(
|
||||||
|
field.value,
|
||||||
|
)
|
||||||
|
? field.value
|
||||||
|
: undefined,
|
||||||
}}
|
}}
|
||||||
onClick={() => colorInputRef.current?.click()}
|
onClick={() =>
|
||||||
|
colorInputRef.current?.click()
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{!isSolidColorAvatar(field.value) && (
|
{!isSolidColorAvatar(field.value) && (
|
||||||
<Palette className="h-5 w-5 text-muted-foreground" />
|
<Palette className="h-5 w-5 text-muted-foreground" />
|
||||||
|
|||||||
@@ -6,8 +6,12 @@
|
|||||||
* @return True if the avatar is a solid color, false otherwise.
|
* @return True if the avatar is a solid color, false otherwise.
|
||||||
*/
|
*/
|
||||||
export function isSolidColorAvatar(value?: string | null) {
|
export function isSolidColorAvatar(value?: string | null) {
|
||||||
return (value?.startsWith("#") && /^#[0-9A-Fa-f]{6}$/.test(value)) || value?.startsWith("color:") || false;
|
return (
|
||||||
};
|
(value?.startsWith("#") && /^#[0-9A-Fa-f]{6}$/.test(value)) ||
|
||||||
|
value?.startsWith("color:") ||
|
||||||
|
false
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the avatar type for form selection (RadioGroup value).
|
* Gets the avatar type for form selection (RadioGroup value).
|
||||||
@@ -23,4 +27,4 @@ export function getAvatarType(value?: string | null) {
|
|||||||
if (isSolidColorAvatar(value)) return "color";
|
if (isSolidColorAvatar(value)) return "color";
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
};
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user