Skip to content

Commit

Permalink
use named export
Browse files Browse the repository at this point in the history
  • Loading branch information
barbalex committed Oct 27, 2024
1 parent 4f85495 commit d31edb2
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 35 deletions.
4 changes: 1 addition & 3 deletions src/components/AppBar/Bar/Docs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const StyledButton = styled(Button)`
border-color: rgba(255, 255, 255, 0.5) !important;
text-transform: none !important;
`
const DokuBar = () => {
export const Docs = () => {
const { pathname, search } = useLocation()

return (
Expand All @@ -30,5 +30,3 @@ const DokuBar = () => {
</>
)
}

export default DokuBar
4 changes: 1 addition & 3 deletions src/components/AppBar/Bar/EkPlan.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const StyledButton = styled(Button)`
border-color: rgba(255, 255, 255, 0.5) !important;
text-transform: none !important;
`
const EkPlanBar = () => {
export const EkPlan = () => {
const { pathname, search } = useLocation()

return (
Expand All @@ -30,5 +30,3 @@ const EkPlanBar = () => {
</>
)
}

export default EkPlanBar
4 changes: 1 addition & 3 deletions src/components/AppBar/Bar/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const StyledButton = styled(Button)`
color: white !important;
text-transform: none !important;
`
const HomeBar = () => {
export const Home = () => {
const { pathname, search } = useLocation()

return (
Expand All @@ -29,5 +29,3 @@ const HomeBar = () => {
</>
)
}

export default HomeBar
6 changes: 2 additions & 4 deletions src/components/AppBar/Bar/Projekte/Daten.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const StyledButton = styled(Button)`
text-transform: none !important;
`

const MyAppBarDaten = ({ treeNr = '' }) => {
export const Daten = observer(({ treeNr = '' }) => {
const [projekteTabs, setProjekteTabs] = useSearchParamsState(
'projekteTabs',
isMobilePhone() ? ['tree'] : ['tree', 'daten'],
Expand Down Expand Up @@ -70,6 +70,4 @@ const MyAppBarDaten = ({ treeNr = '' }) => {
{`Daten${treeNr === '2' ? ' 2' : ''}`}
</StyledButton>
)
}

export default observer(MyAppBarDaten)
})
8 changes: 3 additions & 5 deletions src/components/AppBar/Bar/Projekte/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Link, useParams, useLocation } from 'react-router-dom'

import { isMobilePhone } from '../../../../modules/isMobilePhone.js'
import { More } from './More/index.jsx'
import Daten from './Daten.jsx'
import { Daten } from './Daten.jsx'
import { StoreContext } from '../../../../storeContext.js'
import { useSearchParamsState } from '../../../../modules/useSearchParamsState.js'

Expand Down Expand Up @@ -40,7 +40,7 @@ const DokuButton = styled(Button)`
text-transform: none !important;
`

const ProjekteBar = () => {
export const Projekte = observer(() => {
const { projId } = useParams()
const { search } = useLocation()

Expand Down Expand Up @@ -201,6 +201,4 @@ const ProjekteBar = () => {
/>
</>
)
}

export default observer(ProjekteBar)
})
8 changes: 4 additions & 4 deletions src/components/AppBar/Bar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import styled from '@emotion/styled'
import { useLocation, Link } from 'react-router-dom'

import { isMobilePhone } from '../../../modules/isMobilePhone.js'
import Home from './Home.jsx'
import EkPlan from './EkPlan.jsx'
import Projekte from './Projekte/index.jsx'
import Docs from './Docs.jsx'
import { Home } from './Home.jsx'
import { EkPlan } from './EkPlan.jsx'
import { Projekte } from './Projekte/index.jsx'
import { Docs } from './Docs.jsx'

const SiteTitle = styled(Button)`
display: none !important;
Expand Down
4 changes: 1 addition & 3 deletions src/components/Docs/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const Code = styled.code`
padding: 0 3px;
`

const Docs = () => (
export const Component = () => (
<ErrorBoundary>
<Container>
<Sidebar />
Expand All @@ -93,5 +93,3 @@ const Docs = () => (
</Container>
</ErrorBoundary>
)

export const Component = Docs
50 changes: 40 additions & 10 deletions src/components/Router/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ const RouterComponent = () => {
const router = createBrowserRouter(
createRoutesFromElements(
<Route lazy={() => import('../AppBar/index.jsx')}>
<Route index lazy={() => import('../Home/index.jsx')} />
<Route path="/Daten/*" lazy={() => import('./ProtectedRoute.jsx')}>
<Route
index
lazy={() => import('../Home/index.jsx')}
/>
<Route
path="/Daten/*"
lazy={() => import('./ProtectedRoute.jsx')}
>
{/* <Route path="*" element={<Unterhalt />}></Route> */}
<Route
path="Projekte/:projId/EK-Planung"
Expand All @@ -30,7 +36,10 @@ const RouterComponent = () => {
path="Benutzer/:userId/EKF/:ekfYear/:ekfId"
lazy={() => import('../Ekf/index.jsx')}
/>
<Route path="*" lazy={() => import('../Projekte/index.jsx')}>
<Route
path="*"
lazy={() => import('../Projekte/index.jsx')}
>
<Route
path="Werte-Listen/Adressen/:adrId"
lazy={() => import('../Projekte/Daten/Adresse/index.jsx')}
Expand Down Expand Up @@ -177,8 +186,14 @@ const RouterComponent = () => {
/>
</Route>
</Route>
<Route path="/Dokumentation/*" lazy={() => import('../Docs/index.jsx')}>
<Route index element={null} />
<Route
path="/Dokumentation/*"
lazy={() => import('../Docs/index.jsx')}
>
<Route
index
element={null}
/>
<Route
path="was-kann-man-mit-apflora-machen"
lazy={() => import('../Docs/docs/WasKannApflora.jsx')}
Expand Down Expand Up @@ -273,8 +288,14 @@ const RouterComponent = () => {
path="koordinaten"
lazy={() => import('../Docs/docs/Koordinaten/index.jsx')}
/>
<Route path="melden" lazy={() => import('../Docs/docs/Melden.jsx')} />
<Route path="pwa" lazy={() => import('../Docs/docs/Pwa/index.jsx')} />
<Route
path="melden"
lazy={() => import('../Docs/docs/Melden.jsx')}
/>
<Route
path="pwa"
lazy={() => import('../Docs/docs/Pwa/index.jsx')}
/>
<Route
path="technologien"
lazy={() => import('../Docs/docs/Technologien/index.jsx')}
Expand All @@ -295,7 +316,10 @@ const RouterComponent = () => {
path="daten-wiederherstellen"
lazy={() => import('../Docs/docs/DatenWiederherstellen.jsx')}
/>
<Route path="testen" lazy={() => import('../Docs/docs/Testen.jsx')} />
<Route
path="testen"
lazy={() => import('../Docs/docs/Testen.jsx')}
/>
<Route
path="geschichte"
lazy={() => import('../Docs/docs/Geschichte.jsx')}
Expand All @@ -312,9 +336,15 @@ const RouterComponent = () => {
path="info-flora-export"
lazy={() => import('../Docs/docs/InfofloraExport.jsx')}
/>
<Route path="*" lazy={() => import('../404.jsx')} />
<Route
path="*"
lazy={() => import('../404.jsx')}
/>
</Route>
<Route path="*" lazy={() => import('../404.jsx')} />
<Route
path="*"
lazy={() => import('../404.jsx')}
/>
</Route>,
),
)
Expand Down

0 comments on commit d31edb2

Please sign in to comment.