aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components/UserIcon.tsx
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-19 04:40:08 +0900
committernsfisis <nsfisis@gmail.com>2024-08-19 04:40:08 +0900
commit6031c81f5394acf315b277302a7fd18ea288b506 (patch)
tree30377a3435445f48ce5de342d240990994cf2e71 /frontend/app/components/UserIcon.tsx
parentf662c0832f1f7f45a4e1a926f3ec5a1d21e80fa7 (diff)
downloadphperkaigi-2025-albatross-6031c81f5394acf315b277302a7fd18ea288b506.tar.gz
phperkaigi-2025-albatross-6031c81f5394acf315b277302a7fd18ea288b506.tar.zst
phperkaigi-2025-albatross-6031c81f5394acf315b277302a7fd18ea288b506.zip
refactor(frontend): extract UserIcon component
Diffstat (limited to 'frontend/app/components/UserIcon.tsx')
-rw-r--r--frontend/app/components/UserIcon.tsx19
1 files changed, 19 insertions, 0 deletions
diff --git a/frontend/app/components/UserIcon.tsx b/frontend/app/components/UserIcon.tsx
new file mode 100644
index 0000000..656c170
--- /dev/null
+++ b/frontend/app/components/UserIcon.tsx
@@ -0,0 +1,19 @@
+type Props = {
+ iconPath: string;
+ displayName: string;
+ className: string;
+};
+
+export default function UserIcon({ iconPath, displayName, className }: Props) {
+ return (
+ <img
+ src={
+ process.env.NODE_ENV === "development"
+ ? `http://localhost:8002/iosdc-japan/2024/code-battle${iconPath}`
+ : `/iosdc-japan/2024/code-battle${iconPath}`
+ }
+ alt={`${displayName} のアイコン`}
+ className={`rounded-full border-4 border-white ${className}`}
+ />
+ );
+}