Skip to content

Commit 64e4d56

Browse files
Surafel-Getachewbskinngabalafou
authored
[FEAT] Add social card tags (#733)
This PR implements default (non-customizable) social cards for all pages for both sites. The cards are the respective organization logo on a white field. --- * add social card tags * update twitter img to 1:1 aspect ration * fix img for open-graph * fix syntax error * get URL from window * refactor to SocialCard component and add it to every page * fix TSocialCardProps type and typo * cleanup SocialCards, add summary_large type * canonical url link * Canonical URL fix * add https:// to VERCEL_URL * Add doc to the type for SocialCard compoent and cleanup * remove highlighted links * more comments on SocialCard and comment cleanup * clean up on comments * Update libs/shared/ui-components/src/SocialCard/types.ts * Update libs/shared/ui-components/src/SocialCard/types.ts * Update libs/shared/ui-components/src/SocialCard/types.ts * Update libs/shared/ui-components/src/SocialCard/types.ts * Update libs/shared/ui-components/src/SocialCard/types.ts * Update libs/shared/ui-components/src/SocialCard/types.ts * update to type union for social-card component * rename types * Fix typo Co-authored-by: gabalafou <[email protected]> * update TSocialCardPropsBase * revert SocialCardPropsBase --------- Co-authored-by: Brian Skinn <[email protected]> Co-authored-by: gabalafou <[email protected]>
1 parent 2eacdc2 commit 64e4d56

File tree

14 files changed

+313
-9
lines changed

14 files changed

+313
-9
lines changed

apps/consulting/pages/[slug]/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import React, { FC } from 'react';
33
import { GetStaticPaths, GetStaticProps } from 'next';
44

55
import { ISlugParams, DomainVariant } from '@quansight/shared/types';
6-
import { Layout, SEO, Footer, Header } from '@quansight/shared/ui-components';
6+
import {
7+
Layout,
8+
SEO,
9+
Footer,
10+
Header,
11+
SocialCard,
12+
} from '@quansight/shared/ui-components';
713
import { isPageType, getPaths } from '@quansight/shared/utils';
814

915
import { LinkEntry } from '../../api/types/basic';
@@ -32,6 +38,11 @@ const Container: FC<TContainerProps> = ({ data, header, footer, preview }) => (
3238
description={data.content.description}
3339
variant={DomainVariant.Quansight}
3440
/>
41+
<SocialCard
42+
title={data.content.title}
43+
description={data.content.description}
44+
variant={DomainVariant.Quansight}
45+
/>
3546
{isPageType(data?.content?.component) && (
3647
<Page data={data} preview={preview}>
3748
{(blok: TRawBlok) => <BlokProvider blok={blok} />}

apps/consulting/pages/about-us/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import React, { FC } from 'react';
33
import { GetStaticProps } from 'next';
44

55
import { ISlugParams, DomainVariant } from '@quansight/shared/types';
6-
import { Layout, SEO, Footer, Header } from '@quansight/shared/ui-components';
6+
import {
7+
Layout,
8+
SEO,
9+
Footer,
10+
Header,
11+
SocialCard,
12+
} from '@quansight/shared/ui-components';
713
import { isPageType } from '@quansight/shared/utils';
814

915
import { PageComponent, PageItem } from '../../api/types/basic';
@@ -37,6 +43,11 @@ export const About: FC<TContainerProps> = ({
3743
description={data.content.description}
3844
variant={DomainVariant.Quansight}
3945
/>
46+
<SocialCard
47+
title={data.content.title}
48+
description={data.content.description}
49+
variant={DomainVariant.Quansight}
50+
/>
4051
{isPageType(data?.content?.component) && (
4152
<Page data={data} preview={preview}>
4253
{(blok: TRawBlok) => <BlokProvider blok={blok} />}

apps/consulting/pages/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import React, { FC } from 'react';
33
import { GetStaticProps } from 'next';
44

55
import { ISlugParams, DomainVariant } from '@quansight/shared/types';
6-
import { Layout, SEO, Footer, Header } from '@quansight/shared/ui-components';
6+
import {
7+
Layout,
8+
SEO,
9+
Footer,
10+
Header,
11+
SocialCard,
12+
} from '@quansight/shared/ui-components';
713
import { isPageType } from '@quansight/shared/utils';
814

915
import { getFooter } from '../api/utils/getFooter';
@@ -35,6 +41,11 @@ export const Index: FC<TContainerProps> = ({
3541
description={data.content.description}
3642
variant={DomainVariant.Quansight}
3743
/>
44+
<SocialCard
45+
title={data.content.title}
46+
description={data.content.description}
47+
variant={DomainVariant.Quansight}
48+
/>
3849
{isPageType(data?.content?.component) && (
3950
<Page data={data} preview={preview}>
4051
{(blok: TRawBlok) => <BlokProvider blok={blok} />}

apps/consulting/pages/library/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ import { GetStaticProps } from 'next';
44
import { useRouter } from 'next/router';
55

66
import { ISlugParams, DomainVariant } from '@quansight/shared/types';
7-
import { Layout, SEO, Footer, Header } from '@quansight/shared/ui-components';
7+
import {
8+
Layout,
9+
SEO,
10+
Footer,
11+
Header,
12+
SocialCard,
13+
} from '@quansight/shared/ui-components';
814
import { isPageType } from '@quansight/shared/utils';
915

1016
import { PAGINATION_OFFSETT } from '../..//utils/paginateLibraryTiles/constants';
@@ -126,6 +132,11 @@ export const Library: FC<TLibraryProps> = ({
126132
description={data.content.description}
127133
variant={DomainVariant.Quansight}
128134
/>
135+
<SocialCard
136+
title={data.content.title}
137+
description={data.content.description}
138+
variant={DomainVariant.Quansight}
139+
/>
129140

130141
{isPageType(data?.content?.component) && (
131142
<Page data={data} preview={preview}>

apps/consulting/pages/nebari-services.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ import 'swiper/css/navigation';
1111

1212
import { ISlugParams, DomainVariant } from '@quansight/shared/types';
1313
import { FormSessionStorageKeys } from '@quansight/shared/ui-components';
14-
import { Layout, SEO, Footer, Header } from '@quansight/shared/ui-components';
14+
import {
15+
Layout,
16+
SEO,
17+
Footer,
18+
Header,
19+
SocialCard,
20+
} from '@quansight/shared/ui-components';
1521

1622
import { PageItem } from '../api/types/basic';
1723
import { getFooter } from '../api/utils/getFooter';
@@ -59,6 +65,11 @@ export const NebariServicesPage: FC<TContainerProps> = ({
5965
description="Nebari is designed to be deployed and managed without DevOps expertise. However, if you need support, we offer flexible service options. Learn about Nebari."
6066
variant={DomainVariant.Quansight}
6167
/>
68+
<SocialCard
69+
title="Nebari Services"
70+
description="Nebari is designed to be deployed and managed without DevOps expertise. However, if you need support, we offer flexible service options. Learn about Nebari."
71+
variant={DomainVariant.Quansight}
72+
/>
6273

6374
<div className="overflow-hidden w-full h-[100px] bg-black"></div>
6475

apps/consulting/pages/post/[slug].tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
Header,
1212
Hero,
1313
HeroVariant,
14+
SocialCard,
1415
} from '@quansight/shared/ui-components';
1516

1617
import { getFooter } from '../../api/utils/getFooter';
@@ -47,6 +48,11 @@ const Article: FC<TLibraryArticleProps> = ({
4748
description={post.meta.description}
4849
variant={DomainVariant.Quansight}
4950
/>
51+
<SocialCard
52+
title={post.meta.title}
53+
description={post.meta.description}
54+
variant={DomainVariant.Quansight}
55+
/>
5056

5157
{post.meta.hero && (
5258
<Hero

apps/labs/pages/[slug]/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import React, { FC } from 'react';
33
import { GetStaticPaths, GetStaticProps } from 'next';
44

55
import { ISlugParams, DomainVariant } from '@quansight/shared/types';
6-
import { Layout, SEO, Footer, Header } from '@quansight/shared/ui-components';
6+
import {
7+
Layout,
8+
SEO,
9+
Footer,
10+
Header,
11+
SocialCard,
12+
} from '@quansight/shared/ui-components';
713
import { isPageType, getPaths } from '@quansight/shared/utils';
814

915
import { getFooter, LinkEntry, getHeader } from '../../api';
@@ -30,6 +36,11 @@ const Container: FC<TContainerProps> = ({ data, header, footer, preview }) => (
3036
description={data.content.description}
3137
variant={DomainVariant.Labs}
3238
/>
39+
<SocialCard
40+
title={data.content.title}
41+
description={data.content.description}
42+
variant={DomainVariant.Labs}
43+
/>
3344
{isPageType(data?.content?.component) && (
3445
<Page data={data} preview={preview}>
3546
{(blok: TRawBlok) => <BlokProvider blok={blok} />}

apps/labs/pages/blog/[slug].tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
HeroVariant,
1313
Layout,
1414
SEO,
15+
SocialCard,
1516
} from '@quansight/shared/ui-components';
1617

1718
import { FooterItem, HeaderItem } from '../../api/types/basic';
@@ -61,6 +62,11 @@ export const BlogPost: FC<TBlogPostProps> = ({
6162
description={post.meta.description}
6263
variant={DomainVariant.Labs}
6364
/>
65+
<SocialCard
66+
title={post.meta.title}
67+
description={post.meta.description}
68+
variant={DomainVariant.Labs}
69+
/>
6470
{post.meta.hero && (
6571
<Hero
6672
{...post.meta.hero}

apps/labs/pages/blog/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ import { useRouter } from 'next/router';
66
import ReactPaginate, { ReactPaginateProps } from 'react-paginate';
77

88
import { DomainVariant } from '@quansight/shared/types';
9-
import { Footer, Header, Layout, SEO } from '@quansight/shared/ui-components';
9+
import {
10+
Footer,
11+
Header,
12+
Layout,
13+
SEO,
14+
SocialCard,
15+
} from '@quansight/shared/ui-components';
1016
import { isPageType } from '@quansight/shared/utils';
1117

1218
import {
@@ -140,6 +146,11 @@ const BlogListPage: FC<BlogListPageProps> = ({
140146
description={data.content.description}
141147
variant={DomainVariant.Labs}
142148
/>
149+
<SocialCard
150+
title={data.content.title}
151+
description={data.content.description}
152+
variant={DomainVariant.Labs}
153+
/>
143154
{isPageType(data?.content?.component) && (
144155
<Page data={data} preview={preview}>
145156
{(blok: TRawBlok) => <BlokProvider blok={blok} />}

apps/labs/pages/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import React, { FC } from 'react';
33
import { GetStaticProps } from 'next';
44

55
import { ISlugParams, DomainVariant } from '@quansight/shared/types';
6-
import { Layout, SEO, Footer, Header } from '@quansight/shared/ui-components';
6+
import {
7+
Layout,
8+
SEO,
9+
Footer,
10+
Header,
11+
SocialCard,
12+
} from '@quansight/shared/ui-components';
713
import { isPageType } from '@quansight/shared/utils';
814

915
import { getFooter } from '../api';
@@ -35,6 +41,11 @@ export const Index: FC<TContainerProps> = ({
3541
description={data.content.description}
3642
variant={DomainVariant.Labs}
3743
/>
44+
<SocialCard
45+
title={data.content.title}
46+
description={data.content.description}
47+
variant={DomainVariant.Labs}
48+
/>
3849
{isPageType(data?.content?.component) && (
3950
<Page data={data} preview={preview}>
4051
{(blok: TRawBlok) => <BlokProvider blok={blok} />}

0 commit comments

Comments
 (0)