File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ import { useTheme } from "src/hooks";
55import { changeLocale , getFlagCodeForLocale , localeOptions , T } from "src/locale" ;
66import styles from "./LocalePicker.module.css" ;
77
8- function LocalePicker ( ) {
8+ interface Props {
9+ menuAlign ?: "start" | "end" ;
10+ }
11+
12+ function LocalePicker ( { menuAlign = "start" } : Props ) {
913 const { locale, setLocale } = useLocaleState ( ) ;
1014 const { getTheme } = useTheme ( ) ;
1115
@@ -23,7 +27,10 @@ function LocalePicker() {
2327 < button type = "button" className = { cns } data-bs-toggle = "dropdown" >
2428 < Flag countryCode = { getFlagCodeForLocale ( locale ) } />
2529 </ button >
26- < div className = "dropdown-menu" >
30+ < div className = { cn ( "dropdown-menu" , {
31+ "dropdown-menu-end" : menuAlign === "end" ,
32+ } ) }
33+ >
2734 { localeOptions . map ( ( item ) => {
2835 return (
2936 < a
Original file line number Diff line number Diff line change @@ -70,6 +70,23 @@ export function SiteHeader() {
7070 </ div >
7171 </ a >
7272 < div className = "dropdown-menu dropdown-menu-end dropdown-menu-arrow" >
73+ < div className = "d-md-none" >
74+ < div className = "p-2 pb-1 pe-1" onClick = { ( e ) => e . stopPropagation ( ) } >
75+ < div className = "d-flex align-items-center" >
76+ < div className = "ps-2 pe-1 me-auto" >
77+ < div > { currentUser ?. nickname } </ div >
78+ < div className = "mt-1 small text-secondary" >
79+ < T id = { isAdmin ? "role.admin" : "role.standard-user" } />
80+ </ div >
81+ </ div >
82+ < div className = "d-flex align-items-center" >
83+ < ThemeSwitcher className = "me-n1" />
84+ < LocalePicker menuAlign = "end" />
85+ </ div >
86+ </ div >
87+ </ div >
88+ < div className = "dropdown-divider" />
89+ </ div >
7390 < a
7491 href = "?"
7592 className = "dropdown-item"
You can’t perform that action at this time.
0 commit comments