File tree Expand file tree Collapse file tree 5 files changed +39
-50
lines changed Expand file tree Collapse file tree 5 files changed +39
-50
lines changed Original file line number Diff line number Diff line change 99 } */
1010
1111 .header-tools {
12- display : flex;
13- flex : 1 1 0 ;
14- flex-direction : row-reverse;
12+ align-items : center;
1513 }
1614}
Original file line number Diff line number Diff line change @@ -26,12 +26,7 @@ const Header = (props: HeaderProps) => {
2626 < SlotRenderer name = "navigation" content = { content } location = { location } />
2727 < div className = { clsx ( styles [ 'header-tools' ] , 'header-tools' ) } >
2828 < SlotRenderer
29- name = "headertools"
30- content = { content }
31- location = { location }
32- />
33- < SlotRenderer
34- name = "language-switcher"
29+ name = "headerTools"
3530 content = { content }
3631 location = { location }
3732 />
Original file line number Diff line number Diff line change 1+ import SlotRenderer , { type SlotComponentProps } from '../SlotRenderer' ;
2+ import { useRouteLoaderData } from 'react-router' ;
3+ import type { RootLoader } from 'seven/app/root' ;
4+
5+ const HeaderTools = ( props : SlotComponentProps ) => {
6+ const rootData = useRouteLoaderData < RootLoader > ( 'root' ) ;
7+
8+ if ( ! rootData ) {
9+ return null ;
10+ }
11+
12+ const { isAuthenticated } = rootData ;
13+ const { content, location } = props ;
14+
15+ return (
16+ < >
17+ { isAuthenticated ? (
18+ < SlotRenderer
19+ name = "siteActions"
20+ content = { content }
21+ location = { location }
22+ />
23+ ) : (
24+ < SlotRenderer name = "anontools" content = { content } location = { location } />
25+ ) }
26+ < SlotRenderer
27+ name = "languageSwitcher"
28+ content = { content }
29+ location = { location }
30+ />
31+ < SlotRenderer name = "searchWidget" content = { content } location = { location } />
32+ </ >
33+ ) ;
34+ } ;
35+
36+ export default HeaderTools ;
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ const LanguageSwitcher = (props: LanguageSelectorProps) => {
3636 { availableLanguages . map ( ( lang ) => {
3737 return (
3838 < Link
39- aria-label = { t ( 'layout.languageSwitcher.switchTo' , {
39+ aria-label = { t ( 'layout.slots.tools. languageSwitcher.switchTo' , {
4040 lang : langmap [ lang ] ?. nativeName . toLowerCase ( ) ,
4141 } ) }
4242 className = { clsx ( {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments