Fix a couple name change leftoveres
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import { Link, routes } from '@redwoodjs/router'
|
||||
|
||||
const Article = ({ post }) => {
|
||||
const Article = ({ article }) => {
|
||||
return (
|
||||
<article>
|
||||
<header>
|
||||
<h2 className="text-xl text-blue-700 font-semibold">
|
||||
<Link to={routes.Article({ id: post.id })}>{post.title}</Link>
|
||||
<Link to={routes.article({ id: article.id })}>{article.title}</Link>
|
||||
</h2>
|
||||
</header>
|
||||
<div className="mt-2 text-gray-900 font-light">{post.body}</div>
|
||||
<div className="mt-2 text-gray-900 font-light">{article.body}</div>
|
||||
</article>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import BlogPost from 'src/components/BlogPost'
|
||||
import Article from 'src/components/Article'
|
||||
|
||||
export const QUERY = gql`
|
||||
query ArticleQuery($id: Int!) {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Link, routes } from '@redwoodjs/router'
|
||||
import BlogPost from 'src/components/BlogPost'
|
||||
import Article from 'src/components/Article'
|
||||
|
||||
export const QUERY = gql`
|
||||
query BlogPostsQuery {
|
||||
@@ -18,11 +17,11 @@ export const Empty = () => <div>Empty</div>
|
||||
|
||||
export const Failure = ({ error }) => <div>Error: {error.message}</div>
|
||||
|
||||
export const Success = ({ posts }) => {
|
||||
export const Success = ({ articles }) => {
|
||||
return (
|
||||
<div className="space-y-10">
|
||||
{articles.map((article) => (
|
||||
<Article articles={articles} key={article.id} />
|
||||
<Article article={article} key={article.id} />
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -34,13 +34,18 @@ const BlogLayout = ({ children }) => {
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
className="py-2 px-4 hover:bg-blue-600 transition duration-100 rounded"
|
||||
href="#"
|
||||
onClick={isAuthenticated ? logOut : logIn}
|
||||
>
|
||||
{isAuthenticated ? 'Log Out' : 'Log In'}
|
||||
</a>
|
||||
{isAuthenticated ? (
|
||||
<div>
|
||||
<span>Logged in as {currentUser.email}</span>{' '}
|
||||
<button type="button" onClick={logOut} className="py-2 px-4">
|
||||
Logout
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<Link to={routes.login()} className="py-2 px-4">
|
||||
Login
|
||||
</Link>
|
||||
)}
|
||||
</li>
|
||||
</ul>
|
||||
{isAuthenticated && (
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { MetaTags } from '@redwoodjs/web'
|
||||
import BlogPostCell from 'src/components/BlogPostCell'
|
||||
import ArticleCell from 'src/components/ArticleCell'
|
||||
|
||||
const ArticlePage = ({ id }) => {
|
||||
return (
|
||||
<>
|
||||
<MetaTags title="Article" description="Article page" />
|
||||
|
||||
<BlogPostCell id={id} />
|
||||
<ArticleCell id={id} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { MetaTags } from '@redwoodjs/web'
|
||||
import BlogPostsCell from 'src/components/BlogPostsCell'
|
||||
import ArticlesCell from 'src/components/ArticlesCell'
|
||||
|
||||
const HomePage = () => {
|
||||
return (
|
||||
<>
|
||||
<MetaTags title="Home" description="Home page" />
|
||||
<BlogPostsCell />
|
||||
<ArticlesCell />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user