From 89850f881d6afbe9f67e1a07510f6978acfca0ac Mon Sep 17 00:00:00 2001 From: SwiftHawk Date: Fri, 19 Apr 2024 14:07:18 +0500 Subject: [PATCH] feat: add color border to user's profile picture based on first 6 character of user's hexkey --- src/components/username.tsx | 25 +++++++++++++++++++------ src/index.css | 4 ++-- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/components/username.tsx b/src/components/username.tsx index 001382b..fd6cc89 100644 --- a/src/components/username.tsx +++ b/src/components/username.tsx @@ -1,4 +1,6 @@ import { Typography, IconButton } from '@mui/material' +import { useSelector } from 'react-redux' +import { State } from '../store/rootReducer' type Props = { username: string @@ -7,17 +9,28 @@ type Props = { } const Username = ({ username, avatarContent, handleClick }: Props) => { + const hexKey = useSelector((state: State) => state.auth.usersPubkey) + return ( - user-avatar + user-avatar