Skip to content

Commit

Permalink
translated sidebarnav header
Browse files Browse the repository at this point in the history
  • Loading branch information
bodobraegger committed Sep 21, 2023
1 parent 84aa95c commit 1c01fab
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function App() {
let data = values[0].data;
if(data.filter) {
data = data.filter((e:any) => e.published_at !== null)
console.log(data)
}
setterFunc(data)
window.localStorage.setItem(`${source}_${lang}`, JSON.stringify(data));
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const Header = ({ t }: Props) => {
borderTopRightRadius:'6px !important',
}}
>
SidebarNav Header
{t('sideBarNav.title')}
</Dialog.Header>
<SidebarNav startPageMenuName={t('startPage.menuName')} variant="overlay" />
</Dialog>
Expand Down
13 changes: 8 additions & 5 deletions src/components/SidebarNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ import type { SectionT } from './Section'
import { NavList, Truncate, Link} from '@primer/react'
import cx from 'classnames'

import { HomeIcon, BookmarkIcon, BookmarkFillIcon } from '@primer/octicons-react'
import { HomeIcon, BookmarkIcon, BookmarkFillIcon, RepoIcon } from '@primer/octicons-react'
// icons related to books:
// RepoIcon, RepoCloneIcon, RepoPullIcon, RepoPushIcon, RepoLockedIcon, RepoForkedIcon, RepoDeletedIcon, RepoTemplateIcon


import chapter_logo_test from '../images/chapter_logo_test.png'

type Props = {
startPageMenuName?: String
variant?: 'full' | 'overlay'
Expand Down Expand Up @@ -68,7 +65,12 @@ function SidebarNav(props: Props) {
>
<NavList.LeadingVisual>
{/* <DynamicIcon/> */}
<img src={chapter_logo_test} alt='chapter_logo_test' style={{width: '18px'}}/>
{section.icon &&
(<img className='icon' src={section.icon.url} alt="icon" style={{width: '18px'}} />)
}
{!section.icon &&
<RepoIcon />
}
</NavList.LeadingVisual>
{ chapterNavItems.length > 0
? <Link as={ReactRouterLink} to={section.slug} sx={{color: 'unset'}}>
Expand Down Expand Up @@ -104,6 +106,7 @@ function SidebarNav(props: Props) {

return (
<div data-container="nav"
style={{minWidth: '261px'}}
className={cx(variant === 'full' ? 'position-sticky d-xxl-block d-lg-block d-none' : '')}
>
<NavList>
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"prevButtonText": "Vorheriges Kapitel",
"nextButtonText": "Nächstes Kapitel",
"homeButtonText": "Zurück zum Start"
},
"sideBarNav": {
"title": "Thilo"
}
}
}
Binary file removed src/images/chapter_logo_test.png
Binary file not shown.

0 comments on commit 1c01fab

Please sign in to comment.