💄 Avatar rhombus
This commit is contained in:
1 parent
3d91148b7e
commit
7bfa587a77
2 files changed
+20
-8
No files matched your search
@@ -25,16 +25,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.avatar {
|
.avatar {
|
||||||
/* TODO: clip path */
|
|
||||||
width: 50px;
|
width: 50px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
border-radius: 50px;
|
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
|
||||||
|
}
|
||||||
|
.avatarWrap {
|
||||||
|
filter: drop-shadow(0 0 4px var(--background)) drop-shadow(0 0 11px var(--background))
|
||||||
|
drop-shadow(0 0 19px var(--background));
|
||||||
}
|
}
|
||||||
|
|
||||||
.avatar svg {
|
.noAvatar {
|
||||||
|
display: block;
|
||||||
width: 50px;
|
width: 50px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
color: #ccc;
|
background-color: black;
|
||||||
|
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
|
||||||
|
content: "";
|
||||||
}
|
}
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
|
|||||||
@@ -15,10 +15,16 @@ export const UserCard: React.FC<UserCardProps> = ({ user, onUser, active = false
|
|||||||
const classes = clsx(styles.user, { [styles.active]: active });
|
const classes = clsx(styles.user, { [styles.active]: active });
|
||||||
return (
|
return (
|
||||||
<button className={classes} onClick={onUser} type="button">
|
<button className={classes} onClick={onUser} type="button">
|
||||||
{user?.profile?.image && (
|
<div className={styles.avatarWrap}>
|
||||||
<img src={user.profile?.image} alt={`Profile for ${user.firstName}`} className={styles.avatar} />
|
{user?.profile?.image && (
|
||||||
)}
|
<img src={user.profile?.image} alt={`Profile for ${user.firstName}`} className={styles.avatar} />
|
||||||
{!user?.profile?.image && <span className={styles.avatar}>TODO: NO IMAGE</span>}
|
)}
|
||||||
|
{!user?.profile?.image && (
|
||||||
|
<span className={styles.avatar}>
|
||||||
|
<span className={styles.noAvatar} />
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<span className={styles.name}>{user?.firstName || "Ekstern"}</span>
|
<span className={styles.name}>{user?.firstName || "Ekstern"}</span>
|
||||||
<span className={styles.balance}>{user?.profile?.balance || ""}</span>
|
<span className={styles.balance}>{user?.profile?.balance || ""}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in new issue
Block a user