bunch of stuff

This commit is contained in:
Kurt Hutten
2020-10-10 11:26:25 +11:00
parent 5f8cccf336
commit 029d6f4efc
36 changed files with 1277 additions and 7 deletions

View File

@@ -0,0 +1,24 @@
import { Link, routes } from '@redwoodjs/router'
const BlogLayout = ({ children }) => {
return (
<>
<header>
<h1>Redwood Blog</h1>
<nav>
<ul>
<li>
<Link to={routes.about()}>About</Link>
</li>
<li>
<Link to={routes.home()}>Home</Link>
</li>
</ul>
</nav>
</header>
<main>{children}</main>
</>
)
}
export default BlogLayout

View File

@@ -0,0 +1,7 @@
import BlogLayout from './BlogLayout'
export const generated = () => {
return <BlogLayout />
}
export default { title: 'Layouts/BlogLayout' }

View File

@@ -0,0 +1,11 @@
import { render } from '@redwoodjs/testing'
import BlogLayout from './BlogLayout'
describe('BlogLayout', () => {
it('renders successfully', () => {
expect(() => {
render(<BlogLayout />)
}).not.toThrow()
})
})

View File

@@ -0,0 +1,23 @@
import { Link, routes } from '@redwoodjs/router'
import { Flash } from '@redwoodjs/web'
const PostsLayout = (props) => {
return (
<div className="rw-scaffold">
<Flash timeout={1000} />
<header className="rw-header">
<h1 className="rw-heading rw-heading-primary">
<Link to={routes.posts()} className="rw-link">
Posts
</Link>
</h1>
<Link to={routes.newPost()} className="rw-button rw-button-green">
<div className="rw-button-icon">+</div> New Post
</Link>
</header>
<main className="rw-main">{props.children}</main>
</div>
)
}
export default PostsLayout