mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: moving props spread
This commit is contained in:
parent
69f4ce821f
commit
f522a7c9ef
1 changed files with 4 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
||||||
import { PersonIcon } from "@primer/octicons-react";
|
import { PersonIcon } from "@primer/octicons-react";
|
||||||
|
import cn from "classnames";
|
||||||
|
|
||||||
import "./avatar.scss";
|
import "./avatar.scss";
|
||||||
|
|
||||||
|
@ -14,17 +15,17 @@ export interface AvatarProps
|
||||||
src?: string | null;
|
src?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Avatar({ size, alt, src, ...props }: AvatarProps) {
|
export function Avatar({ size, alt, src, className, ...props }: AvatarProps) {
|
||||||
return (
|
return (
|
||||||
<div className="profile-avatar" style={{ width: size, height: size }}>
|
<div className="profile-avatar" style={{ width: size, height: size }}>
|
||||||
{src ? (
|
{src ? (
|
||||||
<img
|
<img
|
||||||
{...props}
|
className={cn("profile-avatar__image", className)}
|
||||||
className="profile-avatar__image"
|
|
||||||
alt={alt}
|
alt={alt}
|
||||||
src={src}
|
src={src}
|
||||||
width={size}
|
width={size}
|
||||||
height={size}
|
height={size}
|
||||||
|
{...props}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<PersonIcon size={size * 0.7} />
|
<PersonIcon size={size * 0.7} />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue