Skip to content

Commit

Permalink
comments on pages #62
Browse files Browse the repository at this point in the history
  • Loading branch information
bodobraegger committed Apr 11, 2023
1 parent 8997456 commit c42765b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ type Props = {
page: StartPage
}


// all content comes from the backend as json with markdown
function HomePage(props: Props) {
const startPage = props.page

Expand Down
1 change: 1 addition & 0 deletions src/pages/ImpressumPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function ImpressumPage() {

const [impressumPage, setImpressumPage] = React.useState<ImpressumPageT>();

// TODO: create the impressum page, and cache it perhaps
React.useEffect(() => {
client.get('/impressum-page?_locale=' + lang).then((response: { data: any }) => {
setImpressumPage(response.data)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ type Props = {
function SearchPage(props: Props) {
const searchPage = props.page

// The basis of the search are the sections, from which the chapter content is read
return <div className='content-main'>
<Helmet>
<title>{searchPage.title}</title>
</Helmet>

<div className='search'>
<h1><FontAwesomeIcon icon="search" /> {searchPage.title}</h1>
<ReactMarkdown
Expand Down
2 changes: 2 additions & 0 deletions src/pages/SectionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ type Props = {
sections: SectionsByKey
}

// Section pages include section components
function SectionPage(props: Props) {
const { slug } = useParams<Params>()
const section = props.sections[slug!]
const location = useLocation();

// scroll to chapter if hash in url is set
useEffect(() => {
const hash = location.hash
const id = hash.replace('#', '');
Expand Down

0 comments on commit c42765b

Please sign in to comment.