Fix a couple name change leftoveres

This commit is contained in:
Rob Cameron
2022-02-08 15:13:34 -08:00
parent e2c60fde13
commit 3daba85949
6 changed files with 23 additions and 19 deletions

View File

@@ -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>
)
}

View File

@@ -1,4 +1,4 @@
import BlogPost from 'src/components/BlogPost'
import Article from 'src/components/Article'
export const QUERY = gql`
query ArticleQuery($id: Int!) {

View File

@@ -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>
)

View File

@@ -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 && (

View File

@@ -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} />
</>
)
}

View File

@@ -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 />
</>
)
}