Skip to content

Commit

Permalink
Add UserInfo component (#100)
Browse files Browse the repository at this point in the history
* userinfo

* fixes
  • Loading branch information
KhunKrit46 authored Oct 11, 2024
1 parent 4c846a0 commit 955a262
Show file tree
Hide file tree
Showing 12 changed files with 547 additions and 413 deletions.
142 changes: 129 additions & 13 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"@types/styled-components": "^5.1.34",
"bootstrap": "^5.3.2",
"dayjs": "^1.11.11",
"react": "^18.2.0",
Expand All @@ -19,7 +20,8 @@
"react-drawio": "^0.1.7",
"react-json-editor-ajrm": "^2.5.14",
"react-remark": "^2.1.0",
"react-router-dom": "^6.21.3"
"react-router-dom": "^6.21.3",
"styled-components": "^6.1.13"
},
"devDependencies": {
"@types/react": "^18.2.43",
Expand Down
21 changes: 21 additions & 0 deletions client/src/components/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import { Image } from 'react-bootstrap';

interface AvatarProps {
username: string;
size?: number;
}

const Avatar: React.FC<AvatarProps> = ({ username, size = 40 }) => {
return (
<Image
src={`https://api.dicebear.com/6.x/pixel-art/svg?seed=${username}`}
roundedCircle
width={size}
height={size}
alt={`${username}'s avatar`}
/>
);
};

export default Avatar;
Loading

0 comments on commit 955a262

Please sign in to comment.