Skip to content

Commit e08cdea

Browse files
Merge pull request #39 from contentstack/refactor/ECO-1166_loading_starter_on_build
refactor: loading starter app on build [ECO-1166]
2 parents 7835d45 + 3f25f64 commit e08cdea

18 files changed

+658
-618
lines changed

components/about-section-bucket.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ export default function AboutSectionBucket({ sectionWithBuckets }: {sectionWithB
3838
{bucket.icon && (
3939
<img
4040
className='mission-icon'
41-
{...bucket.icon.$?.url}
41+
{...bucket.icon.$?.url as {}}
4242
src={bucket.icon.url}
4343
alt='art work'
4444
/>
4545
)}
4646

4747
<div className='mission-section-content'>
4848
{bucket.title_h3 && (
49-
<h3 {...bucket.$?.title_h3}>{bucket.title_h3}</h3>
49+
<h3 {...bucket.$?.title_h3 as {}}>{bucket.title_h3}</h3>
5050
)}
5151
{typeof bucket.description === 'string' && (
52-
<div {...bucket.$?.description}> {parse(bucket.description)}</div>
52+
<div {...bucket.$?.description as {}}> {parse(bucket.description)}</div>
5353
)}
5454
</div>
5555
</div>
@@ -60,7 +60,7 @@ export default function AboutSectionBucket({ sectionWithBuckets }: {sectionWithB
6060
<div className='member-main-section'>
6161
<div className='member-head'>
6262
{sectionWithBuckets.title_h2 && (
63-
<h2 {...sectionWithBuckets.$?.title_h2}>
63+
<h2 {...sectionWithBuckets.$?.title_h2 as {}}>
6464
{sectionWithBuckets.title_h2}
6565
</h2>
6666
)}

components/archive-relative.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export default function ArchiveRelative({ blogs }: BlogListProps) {
2525
<Link href={blog.url} key={idx}>
2626
<a>
2727
<div>
28-
<h4 {...blog.$?.title}>{blog.title}</h4>
28+
<h4 {...blog.$?.title as {}}>{blog.title}</h4>
2929
{typeof blog.body === 'string' && (
30-
<div {...blog.$?.body}>{parse(blog.body.slice(0, 80))}</div>
30+
<div {...blog.$?.body as {}}>{parse(blog.body.slice(0, 80))}</div>
3131
)}
3232
</div>
3333
</a>

components/blog-banner.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ export default function BlogBanner({ blogBanner }: {blogBanner : BannerProps}) {
2626
>
2727
<div className='blog-page-content'>
2828
{blogBanner.banner_title && (
29-
<h1 className='hero-title' {...blogBanner.$?.banner_title}>
29+
<h1 className='hero-title' {...blogBanner.$?.banner_title as {}}>
3030
{blogBanner.banner_title}
3131
</h1>
3232
)}
3333

3434
{blogBanner.banner_description && (
35-
<p className='hero-description' {...blogBanner.$?.banner_description}>
35+
<p className='hero-description' {...blogBanner.$?.banner_description as {}}>
3636
{blogBanner.banner_description}
3737
</p>
3838
)}

components/blog-list.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function BlogList({ bloglist }: { bloglist: BloglistProps }) {
4242
className='blog-list-img'
4343
src={bloglist.featured_image.url}
4444
alt='blog img'
45-
{...bloglist.featured_image.$?.url}
45+
{...bloglist.featured_image.$?.url as {}}
4646
/>
4747
</a>
4848
</Link>
@@ -56,15 +56,15 @@ function BlogList({ bloglist }: { bloglist: BloglistProps }) {
5656
</Link>
5757
)}
5858
<p>
59-
<strong {...bloglist.$?.date}>
59+
<strong {...bloglist.$?.date as {}}>
6060
{moment(bloglist.date).format('ddd, MMM D YYYY')}
6161
</strong>
6262
,{" "}
6363
<strong {...bloglist.author[0].$?.title}>
6464
{bloglist.author[0].title}
6565
</strong>
6666
</p>
67-
<div {...bloglist.$?.body}>{parse(body)}</div>
67+
<div {...bloglist.$?.body as {}}>{parse(body)}</div>
6868
{bloglist.url ? (
6969
<Link href={bloglist.url}>
7070
<a>

components/blog-section.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function BlogSection(props: FeaturedBlogProps) {
4545
<div className='community-section'>
4646
<div className='community-head'>
4747
{fromBlog.title_h2 && (
48-
<h2 {...fromBlog.$?.title_h2}>{fromBlog.title_h2}</h2>
48+
<h2 {...fromBlog.$?.title_h2 as {}}>{fromBlog.title_h2}</h2>
4949
)}
5050
{fromBlog.view_articles && (
5151
<Link href={fromBlog.view_articles.href}>
@@ -63,7 +63,7 @@ export default function BlogSection(props: FeaturedBlogProps) {
6363
<div className='featured-blog' key={index}>
6464
{blog.featured_image && (
6565
<img
66-
{...blog.featured_image.$?.url}
66+
{...blog.featured_image.$?.url as {}}
6767
src={blog.featured_image.url}
6868
alt={blog.featured_image.filename}
6969
className='blog-post-img'

components/card-section.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export default function CardSection({ cards }: CardProps) {
2323
<div className='demo-section'>
2424
{cards?.map((card, index) => (
2525
<div className='cards' key={index}>
26-
{card.title_h3 && <h3 {...card.$?.title_h3}>{card.title_h3}</h3>}
27-
{card.description && <p {...card.$?.description}>{card.description}</p>}
26+
{card.title_h3 && <h3 {...card.$?.title_h3 as {}}>{card.title_h3}</h3>}
27+
{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 && (
3030
<Link href={card.call_to_action.href}>

components/footer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default function Footer({ footer, entries }: {footer: FooterProps, entrie
5858
src={footerData.logo.url}
5959
alt={footerData.title}
6060
title={footerData.title}
61-
{...footer.logo.$?.url}
61+
{...footer.logo.$?.url as {}}
6262
className='logo footer-logo'
6363
/>
6464
</a>
@@ -99,7 +99,7 @@ export default function Footer({ footer, entries }: {footer: FooterProps, entrie
9999
<img
100100
src={social.icon.url}
101101
alt={social.link.title}
102-
{...social.icon.$?.url}
102+
{...social.icon.$?.url as {}}
103103
/>
104104
)}
105105
</a>
@@ -111,7 +111,7 @@ export default function Footer({ footer, entries }: {footer: FooterProps, entrie
111111
</div>
112112
</div>
113113
{footerData && typeof footerData.copyright === 'string' ? (
114-
<div className='copyright' {...footer.$?.copyright}>
114+
<div className='copyright' {...footer.$?.copyright as {}}>
115115
{parse(footerData.copyright)}
116116
</div>
117117
) : (

components/header.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default function Header({ header, entries }: {header: HeaderProps, entrie
5858
<div className='note-div'>
5959
{headerData?.notification_bar.show_announcement ? (
6060
typeof headerData.notification_bar.announcement_text === 'string' && (
61-
<div {...headerData.notification_bar.$?.announcement_text}>
61+
<div {...headerData.notification_bar.$?.announcement_text as {}}>
6262
{parse(headerData.notification_bar.announcement_text)}
6363
</div>
6464
)
@@ -76,7 +76,7 @@ export default function Header({ header, entries }: {header: HeaderProps, entrie
7676
src={headerData.logo.url}
7777
alt={headerData.title}
7878
title={headerData.title}
79-
{...headerData.logo.$?.url}
79+
{...headerData.logo.$?.url as {}}
8080
/>
8181
</a>
8282
</Link>
@@ -98,7 +98,7 @@ export default function Header({ header, entries }: {header: HeaderProps, entrie
9898
<li
9999
key={list.label}
100100
className='nav-li'
101-
{...list.page_reference[0].$?.url}
101+
{...list.page_reference[0].$?.url as {}}
102102
>
103103
<Link href={list.page_reference[0].url}>
104104
<a className={className}>{list.label}</a>

components/hero-banner.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default function HeroBanner(props: BannerProps) {
3939
}}
4040
>
4141
{banner.banner_title && (
42-
<h1 className='hero-title' {...banner.$?.banner_title}>
42+
<h1 className='hero-title' {...banner.$?.banner_title as {}}>
4343
{banner.banner_title}
4444
</h1>
4545
)}
@@ -49,7 +49,7 @@ export default function HeroBanner(props: BannerProps) {
4949
style={{
5050
color: banner?.text_color ? banner.text_color : '#222',
5151
}}
52-
{...banner.$?.banner_description}
52+
{...banner.$?.banner_description as {}}
5353
>
5454
{banner?.banner_description}
5555
</p>
@@ -70,7 +70,7 @@ export default function HeroBanner(props: BannerProps) {
7070
<img
7171
alt={banner.banner_image.filename}
7272
src={banner.banner_image.url}
73-
{...banner.banner_image.$?.url}
73+
{...banner.banner_image.$?.url as {}}
7474
/>
7575
) : (
7676
''

components/section-bucket.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,30 @@ export default function SectionBucket({ section }: {section: BucketProps}) {
3333
<div className='member-main-section'>
3434
<div className='member-head'>
3535
{section.title_h2 && (
36-
<h2 {...section.$?.title_h2}>{section.title_h2}</h2>
36+
<h2 {...section.$?.title_h2 as {}}>{section.title_h2}</h2>
3737
)}
3838
{section.description && (
39-
<p {...section.$?.description}>{section.description}</p>
39+
<p {...section.$?.description as {}}>{section.description}</p>
4040
)}
4141
</div>
4242
<div className='member-section'>
4343
{section.buckets?.map((bucket, index) => (
4444
<div className='content-section' key={index}>
4545
{bucket.icon && (
4646
<img
47-
{...bucket.icon.$?.url}
47+
{...bucket.icon.$?.url as {}}
4848
src={bucket.icon.url}
4949
alt='bucket icon'
5050
/>
5151
)}
5252

5353
{bucket.title_h3 ? (
54-
<h3 {...bucket.$?.title_h3}>{bucket.title_h3}</h3>
54+
<h3 {...bucket.$?.title_h3 as {}}>{bucket.title_h3}</h3>
5555
) : (
5656
''
5757
)}
5858
{typeof bucket.description === 'string' && (
59-
<div {...bucket.$?.description}>{parse(bucket.description)}</div>
59+
<div {...bucket.$?.description as {}}>{parse(bucket.description)}</div>
6060
)}
6161
{bucket.call_to_action.title ? (
6262
<Link

0 commit comments

Comments
 (0)