add parts data
This commit is contained in:
26
web/src/layouts/MainLayout/MainLayout.js
Normal file
26
web/src/layouts/MainLayout/MainLayout.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import { Link, routes } from '@redwoodjs/router'
|
||||
|
||||
const MainLayout = ({ children }) => {
|
||||
return (
|
||||
<>
|
||||
<header>
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<Link to={routes.about()}>About</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link to={routes.home()}>Home</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link to={routes.parts()}>Parts</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<main>{children}</main>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default MainLayout
|
||||
7
web/src/layouts/MainLayout/MainLayout.stories.js
Normal file
7
web/src/layouts/MainLayout/MainLayout.stories.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import MainLayout from './MainLayout'
|
||||
|
||||
export const generated = () => {
|
||||
return <MainLayout />
|
||||
}
|
||||
|
||||
export default { title: 'Layouts/MainLayout' }
|
||||
11
web/src/layouts/MainLayout/MainLayout.test.js
Normal file
11
web/src/layouts/MainLayout/MainLayout.test.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import { render } from '@redwoodjs/testing'
|
||||
|
||||
import MainLayout from './MainLayout'
|
||||
|
||||
describe('MainLayout', () => {
|
||||
it('renders successfully', () => {
|
||||
expect(() => {
|
||||
render(<MainLayout />)
|
||||
}).not.toThrow()
|
||||
})
|
||||
})
|
||||
23
web/src/layouts/PartsLayout/PartsLayout.js
Normal file
23
web/src/layouts/PartsLayout/PartsLayout.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Link, routes } from '@redwoodjs/router'
|
||||
import { Flash } from '@redwoodjs/web'
|
||||
|
||||
const PartsLayout = (props) => {
|
||||
return (
|
||||
<div className="rw-scaffold">
|
||||
<Flash timeout={1000} />
|
||||
<header className="rw-header">
|
||||
<h1 className="rw-heading rw-heading-primary">
|
||||
<Link to={routes.parts()} className="rw-link">
|
||||
Parts
|
||||
</Link>
|
||||
</h1>
|
||||
<Link to={routes.newPart()} className="rw-button rw-button-green">
|
||||
<div className="rw-button-icon">+</div> New Part
|
||||
</Link>
|
||||
</header>
|
||||
<main className="rw-main">{props.children}</main>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default PartsLayout
|
||||
Reference in New Issue
Block a user