Skip to content

Commit

Permalink
Fix: Destructuring error in the cms-contenful example (#14970)
Browse files Browse the repository at this point in the history
  • Loading branch information
darshkpatel committed Jul 8, 2020
1 parent 913d23b commit 1cd6bb5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/cms-contentful/components/date.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1cd6bb5

Please sign in to comment.