Skip to content

Commit 3fb9360

Browse files
Merge pull request #73 from contentstack/staging
Staging
2 parents d2aa50d + a419dd9 commit 3fb9360

17 files changed

+9239
-9376
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Contentstack
3+
Copyright (c) 2023 Contentstack
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

components/archive-relative.tsx

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,18 @@ type BlogListProps = {
1919
}
2020

2121
export default function ArchiveRelative({ blogs }: BlogListProps) {
22-
return (
23-
<>
24-
{blogs?.map((blog, idx) => (
25-
<Link href={blog.url} key={idx}>
26-
<a>
27-
<div>
28-
<h4 {...blog.$?.title as {}}>{blog.title}</h4>
29-
{typeof blog.body === 'string' && (
30-
<div {...blog.$?.body as {}}>{parse(blog.body.slice(0, 80))}</div>
31-
)}
32-
</div>
33-
</a>
34-
</Link>
35-
))}
36-
</>
37-
);
22+
return <>
23+
{blogs?.map((blog, idx) => (
24+
(<Link href={blog.url} key={idx}>
25+
26+
<div>
27+
<h4 {...blog.$?.title as {}}>{blog.title}</h4>
28+
{typeof blog.body === 'string' && (
29+
<div {...blog.$?.body as {}}>{parse(blog.body.slice(0, 80))}</div>
30+
)}
31+
</div>
32+
33+
</Link>)
34+
))}
35+
</>;
3836
}

components/blog-list.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,24 @@ function BlogList({ bloglist }: { bloglist: BloglistProps }) {
3636
return (
3737
<div className='blog-list'>
3838
{bloglist.featured_image && (
39-
<Link href={bloglist.url}>
40-
<a>
41-
<img
42-
className='blog-list-img'
43-
src={bloglist.featured_image.url}
44-
alt='blog img'
45-
{...bloglist.featured_image.$?.url as {}}
46-
/>
47-
</a>
48-
</Link>
39+
(<Link href={bloglist.url}>
40+
41+
<img
42+
className='blog-list-img'
43+
src={bloglist.featured_image.url}
44+
alt='blog img'
45+
{...bloglist.featured_image.$?.url as {}}
46+
/>
47+
48+
</Link>)
4949
)}
5050
<div className='blog-content'>
5151
{bloglist.title && (
52-
<Link href={bloglist.url}>
53-
<a>
54-
<h3 {...bloglist.$?.title}>{bloglist.title}</h3>
55-
</a>
56-
</Link>
52+
(<Link href={bloglist.url}>
53+
54+
<h3 {...bloglist.$?.title}>{bloglist.title}</h3>
55+
56+
</Link>)
5757
)}
5858
<p>
5959
<strong {...bloglist.$?.date as {}}>
@@ -66,11 +66,11 @@ function BlogList({ bloglist }: { bloglist: BloglistProps }) {
6666
</p>
6767
<div {...bloglist.$?.body as {}}>{parse(body)}</div>
6868
{bloglist.url ? (
69-
<Link href={bloglist.url}>
70-
<a>
71-
<span>{'Read more -->'}</span>
72-
</a>
73-
</Link>
69+
(<Link href={bloglist.url}>
70+
71+
<span>{'Read more -->'}</span>
72+
73+
</Link>)
7474
) : (
7575
''
7676
)}

components/blog-section.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ export default function BlogSection(props: FeaturedBlogProps) {
4848
<h2 {...fromBlog.$?.title_h2 as {}}>{fromBlog.title_h2}</h2>
4949
)}
5050
{fromBlog.view_articles && (
51-
<Link href={fromBlog.view_articles.href}>
52-
<a
53-
className='btn secondary-btn article-btn'
54-
{...fromBlog.view_articles.$?.title}
55-
>
56-
{fromBlog.view_articles.title}
57-
</a>
58-
</Link>
51+
(<Link
52+
href={fromBlog.view_articles.href}
53+
className='btn secondary-btn article-btn'
54+
{...fromBlog.view_articles.$?.title}>
55+
56+
{fromBlog.view_articles.title}
57+
58+
</Link>)
5959
)}
6060
</div>
6161
<div className='home-featured-blogs'>
@@ -75,8 +75,8 @@ export default function BlogSection(props: FeaturedBlogProps) {
7575
<div>{parse(blog.body.slice(0, 300))}</div>
7676
)}
7777
{blog.url && (
78-
<Link href={blog.url} passHref>
79-
<a className='blogpost-readmore'>{'Read More -->'}</a>
78+
<Link href={blog.url} passHref className='blogpost-readmore'>
79+
{'Read More -->'}
8080
</Link>
8181
)}
8282
</div>

components/card-section.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export default function CardSection({ cards }: CardProps) {
2727
{card.description && <p {...card.$?.description as {}}>{card.description}</p>}
2828
<div className='card-cta'>
2929
{card.call_to_action.title && card.call_to_action.href && (
30-
<Link href={card.call_to_action.href}>
31-
<a className='btn primary-btn'>{card.call_to_action.title}</a>
30+
<Link href={card.call_to_action.href} className='btn primary-btn'>
31+
{card.call_to_action.title}
3232
</Link>
3333
)}
3434
</div>

components/devtools.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
22
import dynamic from 'next/dynamic';
33
import Tooltip from './tool-tip';
44

5-
const DynamicReactJson = dynamic(import('react-json-view'), { ssr: false });
5+
const DynamicJsonViewer = dynamic(() => import('@textea/json-viewer').then((module) => ({ default: module.JsonViewer })), { ssr: false });
66

77
function filterObject(inputObject: any) {
88
const unWantedProps = [
@@ -87,10 +87,10 @@ const DevTools = ({ response }: any) => {
8787
{response ? (
8888
<pre id="jsonViewer">
8989
{response && (
90-
<DynamicReactJson
91-
src={filteredJson}
92-
collapsed={1}
93-
name="response"
90+
<DynamicJsonViewer
91+
value={filteredJson}
92+
defaultInspectDepth={1}
93+
rootName="response"
9494
displayDataTypes={false}
9595
enableClipboard={false}
9696
style={{ color: '#C8501E' }}

components/footer.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ export default function Footer({ footer, entries }: {footer: FooterProps, entrie
5252
<div className='max-width footer-div'>
5353
<div className='col-quarter'>
5454
{footerData && footerData.logo ? (
55-
<Link href='/'>
56-
<a className='logo-tag'>
57-
<img
58-
src={footerData.logo.url}
59-
alt={footerData.title}
60-
title={footerData.title}
61-
{...footer.logo.$?.url as {}}
62-
className='logo footer-logo'
63-
/>
64-
</a>
65-
</Link>
55+
(<Link href='/' className='logo-tag'>
56+
57+
<img
58+
src={footerData.logo.url}
59+
alt={footerData.title}
60+
title={footerData.title}
61+
{...footer.logo.$?.url as {}}
62+
className='logo footer-logo'
63+
/>
64+
65+
</Link>)
6666
) : (
6767
<Skeleton width={150} />
6868
)}
@@ -77,7 +77,7 @@ export default function Footer({ footer, entries }: {footer: FooterProps, entrie
7777
key={menu.title}
7878
{...menu.$?.title}
7979
>
80-
<Link href={menu.href}>{menu.title}</Link>
80+
<Link href={menu.href} legacyBehavior>{menu.title}</Link>
8181
</li>
8282
))
8383
) : (

components/header.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ export default function Header({ header, entries }: {header: HeaderProps, entrie
6969
<div className='max-width header-div'>
7070
<div className='wrapper-logo'>
7171
{headerData ? (
72-
<Link href='/'>
73-
<a className='logo-tag' title='Contentstack'>
74-
<img
75-
className='logo'
76-
src={headerData.logo.url}
77-
alt={headerData.title}
78-
title={headerData.title}
79-
{...headerData.logo.$?.url as {}}
80-
/>
81-
</a>
82-
</Link>
72+
(<Link href='/' className='logo-tag' title='Contentstack'>
73+
74+
<img
75+
className='logo'
76+
src={headerData.logo.url}
77+
alt={headerData.title}
78+
title={headerData.title}
79+
{...headerData.logo.$?.url as {}}
80+
/>
81+
82+
</Link>)
8383
) : (
8484
<Skeleton width={150} />
8585
)}
@@ -100,8 +100,8 @@ export default function Header({ header, entries }: {header: HeaderProps, entrie
100100
className='nav-li'
101101
{...list.page_reference[0].$?.url as {}}
102102
>
103-
<Link href={list.page_reference[0].url}>
104-
<a className={className}>{list.label}</a>
103+
<Link href={list.page_reference[0].url} className={className}>
104+
{list.label}
105105
</Link>
106106
</li>
107107
);

components/hero-banner.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,14 @@ export default function HeroBanner(props: BannerProps) {
5757
''
5858
)}
5959
{banner.call_to_action.title && banner.call_to_action.href ? (
60-
<Link href={banner?.call_to_action.href}>
61-
<a className='btn tertiary-btn' {...banner.call_to_action.$?.title}>
62-
{banner?.call_to_action.title}
63-
</a>
64-
</Link>
60+
(<Link
61+
href={banner?.call_to_action.href}
62+
className='btn tertiary-btn'
63+
{...banner.call_to_action.$?.title}>
64+
65+
{banner?.call_to_action.title}
66+
67+
</Link>)
6568
) : (
6669
''
6770
)}

components/section-bucket.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default function SectionBucket({ section }: {section: BucketProps}) {
6363
href={
6464
bucket.call_to_action.href ? bucket.call_to_action.href : '#'
6565
}
66-
>
66+
legacyBehavior>
6767
{`${bucket.call_to_action.title} -->`}
6868
</Link>
6969
) : (

0 commit comments

Comments
 (0)