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' import { Link, routes } from '@redwoodjs/router'
const Article = ({ post }) => { const Article = ({ article }) => {
return ( return (
<article> <article>
<header> <header>
<h2 className="text-xl text-blue-700 font-semibold"> <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> </h2>
</header> </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> </article>
) )
} }

View File

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

View File

@@ -1,5 +1,4 @@
import { Link, routes } from '@redwoodjs/router' import Article from 'src/components/Article'
import BlogPost from 'src/components/BlogPost'
export const QUERY = gql` export const QUERY = gql`
query BlogPostsQuery { query BlogPostsQuery {
@@ -18,11 +17,11 @@ export const Empty = () => <div>Empty</div>
export const Failure = ({ error }) => <div>Error: {error.message}</div> export const Failure = ({ error }) => <div>Error: {error.message}</div>
export const Success = ({ posts }) => { export const Success = ({ articles }) => {
return ( return (
<div className="space-y-10"> <div className="space-y-10">
{articles.map((article) => ( {articles.map((article) => (
<Article articles={articles} key={article.id} /> <Article article={article} key={article.id} />
))} ))}
</div> </div>
) )

View File

@@ -34,13 +34,18 @@ const BlogLayout = ({ children }) => {
</Link> </Link>
</li> </li>
<li> <li>
<a {isAuthenticated ? (
className="py-2 px-4 hover:bg-blue-600 transition duration-100 rounded" <div>
href="#" <span>Logged in as {currentUser.email}</span>{' '}
onClick={isAuthenticated ? logOut : logIn} <button type="button" onClick={logOut} className="py-2 px-4">
> Logout
{isAuthenticated ? 'Log Out' : 'Log In'} </button>
</a> </div>
) : (
<Link to={routes.login()} className="py-2 px-4">
Login
</Link>
)}
</li> </li>
</ul> </ul>
{isAuthenticated && ( {isAuthenticated && (

View File

@@ -1,12 +1,12 @@
import { MetaTags } from '@redwoodjs/web' import { MetaTags } from '@redwoodjs/web'
import BlogPostCell from 'src/components/BlogPostCell' import ArticleCell from 'src/components/ArticleCell'
const ArticlePage = ({ id }) => { const ArticlePage = ({ id }) => {
return ( return (
<> <>
<MetaTags title="Article" description="Article page" /> <MetaTags title="Article" description="Article page" />
<BlogPostCell id={id} /> <ArticleCell id={id} />
</> </>
) )
} }

View File

@@ -1,11 +1,11 @@
import { MetaTags } from '@redwoodjs/web' import { MetaTags } from '@redwoodjs/web'
import BlogPostsCell from 'src/components/BlogPostsCell' import ArticlesCell from 'src/components/ArticlesCell'
const HomePage = () => { const HomePage = () => {
return ( return (
<> <>
<MetaTags title="Home" description="Home page" /> <MetaTags title="Home" description="Home page" />
<BlogPostsCell /> <ArticlesCell />
</> </>
) )
} }