Files
psf-memo-client/src/components/app-body/index.js
T

39 lines
1.3 KiB
JavaScript

/*
This Body component is a container for all the different Views of the app.
Views are equivalent to 'pages' in a multi-page app. Views are hidden or
displayed to simulate the use of pages in an SPA.
The Body app contains all the Views and chooses which to show, based on
the state of the Menu component.
*/
// Global npm libraries
import React from 'react'
import { Route, Routes } from 'react-router-dom'
// Local libraries
import GetBalance from './balance'
import Placeholder2 from './placeholder2'
import Placeholder3 from './placeholder3'
import ServerSelectView from './configuration/select-server-view'
function AppBody (props) {
// Dependency injection through props
const appData = props.appData
return (
<>
<Routes>
<Route path='/' element={<GetBalance wallet={appData.wallet} />} />
<Route path='/balance' element={<GetBalance wallet={appData.wallet} />} />
<Route path='/placeholder2' element={<Placeholder2 />} />
<Route path='/placeholder3' element={<Placeholder3 />} />
<Route path='/configuration' element={<ServerSelectView appData={appData} />} />
</Routes>
{/** Show in all paths except the servers view */}
{/* {appData.currentPath !== '/servers' && <SelectServerButton linkTo='/servers' appData={appData} />} */}
</>
)
}
export default AppBody