Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Destructuring error in the cms-contenful example #14970

Merged
merged 2 commits into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/cms-contentful/components/date.js
@@ -1,6 +1,6 @@
import { format } from 'date-fns'

export default function Date({ dateString }) {
export default function DateComponent({ dateString }) {
return (
<time dateTime={dateString}>
{format(new Date(dateString), 'LLLL d, yyyy')}
Expand Down
4 changes: 2 additions & 2 deletions examples/cms-contentful/components/hero-post.js
@@ -1,6 +1,6 @@
import Link from 'next/link'
import Avatar from '../components/avatar'
import Date from '../components/date'
import DateComponent from '../components/date'
import CoverImage from '../components/cover-image'

export default function HeroPost({
Expand All @@ -24,7 +24,7 @@ export default function HeroPost({
</Link>
</h3>
<div className="mb-4 md:mb-0 text-lg">
<Date dateString={date} />
<DateComponent dateString={date} />
</div>
</div>
<div>
Expand Down
4 changes: 2 additions & 2 deletions examples/cms-contentful/components/post-header.js
@@ -1,5 +1,5 @@
import Avatar from '../components/avatar'
import Date from '../components/date'
import DateComponent from '../components/date'
import CoverImage from '../components/cover-image'
import PostTitle from '../components/post-title'

Expand All @@ -18,7 +18,7 @@ export default function PostHeader({ title, coverImage, date, author }) {
{author && <Avatar name={author.name} picture={author.picture} />}
</div>
<div className="mb-6 text-lg">
<Date dateString={date} />
<DateComponent dateString={date} />
</div>
</div>
</>
Expand Down
4 changes: 2 additions & 2 deletions examples/cms-contentful/components/post-preview.js
@@ -1,6 +1,6 @@
import Link from 'next/link'
import Avatar from '../components/avatar'
import Date from '../components/date'
import DateComponent from '../components/date'
import CoverImage from './cover-image'

export default function PostPreview({
Expand All @@ -22,7 +22,7 @@ export default function PostPreview({
</Link>
</h3>
<div className="text-lg mb-4">
<Date dateString={date} />
<DateComponent dateString={date} />
</div>
<p className="text-lg leading-relaxed mb-4">{excerpt}</p>
{author && <Avatar name={author.name} picture={author.picture} />}
Expand Down