Skip to content

Commit 79ad03d

Browse files
authored
Add SOC-2 badge (#2065)
1 parent 2426f22 commit 79ad03d

File tree

5 files changed

+74
-27
lines changed

5 files changed

+74
-27
lines changed

.changeset/late-buckets-cover.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@theguild/components': minor
3+
---
4+
5+
Add SOC-2 badge to HiveFooter

.storybook/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
/* eslint-disable @typescript-eslint/consistent-type-imports */
12
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';
2-
import { Configuration } from 'webpack';
3-
import { StorybookConfig } from '@storybook/nextjs';
3+
import type { Configuration } from 'webpack';
4+
import type { StorybookConfig } from '@storybook/nextjs';
45

56
export default {
67
stories: ['../packages/*/src/**/*.stories.@(js|jsx|ts|tsx|mdx)'],

packages/components/src/components/hive-footer/index.stories.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ export default {
1414
description: "Use this to add current site's links to the footer.",
1515
},
1616
},
17+
showSecurityBadges: {
18+
name: 'Show Security Badges',
19+
description: 'Show the security badges in the footer.',
20+
},
1721
},
1822
} satisfies Meta<HiveFooterProps>;
1923

2024
export const Default: StoryObj<HiveFooterProps> = {
2125
name: 'HiveFooter',
2226
args: {
27+
showSecurityBadges: true,
2328
items: {
2429
...HiveFooter.DEFAULT_ITEMS,
2530
resources: [
@@ -48,3 +53,10 @@ export const CodegenFooter: StoryObj<HiveFooterProps> = {
4853
description: 'End-to-end type safety',
4954
},
5055
};
56+
57+
export const WithoutSecurityBadges: StoryObj<HiveFooterProps> = {
58+
...Default,
59+
args: {
60+
showSecurityBadges: false,
61+
},
62+
};

packages/components/src/components/hive-footer/index.tsx

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,8 @@ import { ILink } from '../../types/components';
77
import { Anchor } from '../anchor';
88
import { ContactTextLink } from '../contact-us';
99
import { __LANDING_WIDTHS_ID } from '../hive-layout-config';
10-
import {
11-
CSAStarLevelOneIcon,
12-
DiscordIcon,
13-
GitHubIcon,
14-
LinkedInIcon,
15-
TwitterIcon,
16-
YouTubeIcon,
17-
} from '../icons/index';
10+
import { DiscordIcon, GitHubIcon, LinkedInIcon, TwitterIcon, YouTubeIcon } from '../icons/index';
11+
import { SecurityBadges } from './security-badges';
1812

1913
const INNER_BOX_WIDTH_STYLE =
2014
'max-w-[90rem] [body:has(#hive-l-widths)_&]:max-w-[75rem] [body:has(#hive-l-widths)_&]:mx-4';
@@ -33,6 +27,10 @@ export type HiveFooterProps = {
3327
href?: string;
3428
description?: string;
3529
items?: HiveFooterItems;
30+
/**
31+
* In case this component is used outside of Hive Platform in a design-consistent but less related context,
32+
*/
33+
showSecurityBadges?: boolean;
3634
};
3735

3836
export function HiveFooter({
@@ -41,6 +39,7 @@ export function HiveFooter({
4139
href = `${siteOrigin}/`,
4240
description = 'Open-source GraphQL management platform',
4341
items,
42+
showSecurityBadges,
4443
}: HiveFooterProps) {
4544
items = { ...HiveFooter.DEFAULT_ITEMS, ...items };
4645

@@ -82,7 +81,9 @@ export function HiveFooter({
8281
))}
8382
<ContactTextLink />
8483
</div>
85-
<CSAStarLink className="sm:col-start-[-1] lg:col-start-[-2]" />
84+
<div className="sm:col-start-[-1] lg:col-start-[-2]">
85+
{showSecurityBadges && <SecurityBadges />}
86+
</div>
8687
</div>
8788

8889
<div className="col-span-full flex flex-wrap justify-between gap-x-[inherit] gap-y-8 lg:w-full lg:pb-2 lg:pt-8">
@@ -266,19 +267,3 @@ function DecorationArch(props: React.SVGProps<SVGSVGElement>) {
266267
</svg>
267268
);
268269
}
269-
270-
function CSAStarLink({ className }: { className?: string }) {
271-
return (
272-
<a
273-
href="https://cloudsecurityalliance.org/star/registry/software-products-guild-ltd-the-guild/services/graphql-hive"
274-
target="_blank"
275-
rel="noreferrer noopener"
276-
className={cn(
277-
'hive-focus w-fit rounded-full focus-visible:outline-none focus-visible:ring-offset-2 focus-visible:ring-offset-[rgb(var(--nextra-bg))]',
278-
className,
279-
)}
280-
>
281-
<CSAStarLevelOneIcon className="size-20 lg:size-[120px] dark:opacity-95" />
282-
</a>
283-
);
284-
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { ReactNode } from 'react';
2+
import { cn } from '../../cn';
3+
import { ReactComponent as CSAStarLevelOneIcon } from '../icons/csa-star-level-one.svg';
4+
5+
function SecurityBadge({
6+
href,
7+
children,
8+
className,
9+
}: {
10+
href: string;
11+
children: ReactNode;
12+
className?: string;
13+
}) {
14+
return (
15+
<a
16+
href={href}
17+
target="_blank"
18+
rel="noreferrer noopener"
19+
className={cn(
20+
'hive-focus size-fit rounded-full p-1 hover:bg-blue-200 focus-visible:outline-none focus-visible:ring-offset-2 focus-visible:ring-offset-[rgb(var(--nextra-bg))] dark:hover:bg-white/20 dark:hover:*:opacity-100',
21+
className,
22+
)}
23+
>
24+
{children}
25+
</a>
26+
);
27+
}
28+
29+
export function SecurityBadges() {
30+
return (
31+
<div className="flex flex-wrap gap-4 max-lg:flex-col">
32+
<SecurityBadge href="https://cloudsecurityalliance.org/star/registry/software-products-guild-ltd-the-guild/services/graphql-hive">
33+
<CSAStarLevelOneIcon className="size-[88px] dark:opacity-95" />
34+
</SecurityBadge>
35+
<SecurityBadge href="https://security.graphql-hive.com/">
36+
<img
37+
src="https://static.vanta.com/static/soc2_badge.ac7ad1ad.webp"
38+
alt="AICPA SOC 2"
39+
className="size-[88px] dark:opacity-95"
40+
/>
41+
</SecurityBadge>
42+
</div>
43+
);
44+
}

0 commit comments

Comments
 (0)