-
Notifications
You must be signed in to change notification settings - Fork 0
chore: add avator icon #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
398a2e7
dbba9d0
1214b78
f13e528
d8eea2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| # frontend | ||
| VITE_API_URL= | ||
| VITE_CLIENT_URL= | ||
| VITE_REDIRECT_URL= | ||
| VITE_IDENTEAPOT_SALT= | ||
|
|
||
| # backend | ||
| POSTGRES_USER= | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| VITE_API_URL= | ||
| VITE_CLIENT_URL= | ||
| VITE_REDIRECT_URL= | ||
| VITE_IDENTEAPOT_SALT= |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,8 @@ export interface paths { | |
| "application/json": { | ||
| user_id: string; | ||
| user_name: string; | ||
| /** Format: uri */ | ||
| user_avatar_url: string | null; | ||
|
Comment on lines
+33
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The OpenAPI type now claims Useful? React with 👍 / 👎. |
||
| }; | ||
| }; | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| .ul { | ||
| list-style: none; | ||
| margin: 0 auto; | ||
| width: fit-content; | ||
| max-width: 900px; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| .ul { | ||
| list-style: none; | ||
| margin: 0 auto; | ||
| width: fit-content; | ||
| max-width: 900px; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,11 +15,18 @@ | |
|
|
||
| .nav { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: var(--space-base); | ||
| } | ||
|
|
||
| @media screen and (max-width: 499px) { | ||
| .nav { | ||
| .identicon { | ||
| width: 40px; | ||
| height: 40px; | ||
| border-radius: 50%; | ||
| } | ||
|
Comment on lines
+22
to
+26
|
||
|
|
||
| @media screen and (max-width: 599px) { | ||
| .navLink { | ||
| display: none; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,19 +1,34 @@ | ||||||
| import { useEffect, type FC } from 'react'; | ||||||
| import { useEffect, useState, type FC } from 'react'; | ||||||
| // @tanstack/react-query | ||||||
| import { $api } from '../../../../api/fetchClient'; | ||||||
| // react-router | ||||||
| import { Link, NavLink, useNavigate } from 'react-router'; | ||||||
| // icons | ||||||
| import { generateIdenteapot } from '@teapotlabs/identeapots'; | ||||||
| // toast | ||||||
| import { toast } from 'react-hot-toast'; | ||||||
| // css | ||||||
| import styles from './index.module.css'; | ||||||
|
|
||||||
| const Header: FC = () => { | ||||||
| const [identicon, setIdenticon] = useState<string>(''); | ||||||
| // sessionのチェック | ||||||
| const navigate = useNavigate(); | ||||||
| const sessionCheckMutation = $api.useMutation('get', '/api/session', { | ||||||
| onSuccess: async (data) => { | ||||||
| try { | ||||||
| const salt = import.meta.env.VITE_IDENTEAPOT_SALT satisfies string; | ||||||
| const icon = await generateIdenteapot(data.user_id, salt); | ||||||
| setIdenticon(icon); | ||||||
| } catch { | ||||||
| toast.error('アイコンの生成に失敗しました。'); | ||||||
| } | ||||||
| }, | ||||||
| onError: () => { | ||||||
| navigate('/login', { replace: true }); | ||||||
| }, | ||||||
| }); | ||||||
|
|
||||||
| useEffect(() => { | ||||||
| sessionCheckMutation.mutate({ credentials: 'include' }); | ||||||
| }, []); | ||||||
|
||||||
| }, []); | |
| }, [sessionCheckMutation]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The VITE_CLIENT_URL entry appears on line 3 but was likely already present in the file. However, the ordering in .env.example is inconsistent with products/frontend/.env.example where VITE_CLIENT_URL comes before VITE_REDIRECT_URL. While this doesn't affect functionality, consistency across environment example files improves maintainability.