Skip to content

Commit a127321

Browse files
authored
new pricing plan cards (#6564)
1 parent bf06e94 commit a127321

File tree

18 files changed

+856
-211
lines changed

18 files changed

+856
-211
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ module.exports = {
230230
'hive-focus-within',
231231
'nextra-scrollbar',
232232
'no-scrollbar', // from Nextra
233+
'hive-slider',
233234
],
234235
config: path.join(__dirname, './packages/web/docs/tailwind.config.ts'),
235236
},

.github/workflows/tests-e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
up -d --wait
4949
5050
- name: cypress
51-
timeout-minutes: 6
51+
timeout-minutes: 8
5252
uses: cypress-io/github-action@v6
5353
env:
5454
CI: true

packages/web/docs/src/app/oss-friends/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default async function OSSFriendsPage() {
9595
</div>
9696
</section>
9797
</div>
98-
<section className="relative mx-4 mt-12 overflow-hidden rounded-3xl bg-[#003834] p-12 text-center sm:p-24 md:mx-6">
98+
<section className="bg-blueish-green relative mx-4 mt-12 overflow-hidden rounded-3xl p-12 text-center sm:p-24 md:mx-6">
9999
<DecorationIsolation>
100100
<ArchDecoration className="absolute -left-1/2 -top-1/2 rotate-180 sm:-left-1/4 md:left-[-105px] md:top-[-109px] [&>path]:fill-none" />
101101
<HighlightDecoration className="absolute -left-1 -top-16 size-[600px] -scale-x-100 overflow-visible" />

packages/web/docs/src/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function GetStartedTodaySection({ className }: { className?: string }) {
117117
return (
118118
<section
119119
className={cn(
120-
'relative overflow-hidden rounded-3xl bg-[#003834] p-12 text-center sm:p-24',
120+
'bg-blueish-green relative overflow-hidden rounded-3xl p-12 text-center sm:p-24',
121121
className,
122122
)}
123123
>
@@ -224,7 +224,7 @@ function LearnGraphQLFederationSection(props: { className?: string }) {
224224
return (
225225
<section
226226
className={cn(
227-
'to-green-1000 relative rounded-3xl bg-gradient-to-br from-[#003834] p-8 sm:py-12 md:px-6 md:text-center lg:p-24',
227+
'to-green-1000 from-blueish-green relative rounded-3xl bg-gradient-to-br p-8 sm:py-12 md:px-6 md:text-center lg:p-24',
228228
props.className,
229229
)}
230230
>

packages/web/docs/src/app/pricing/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ export default function PricingPage() {
2222
<LandingPageContainer className="text-green-1000 light mx-auto max-w-[90rem] overflow-hidden">
2323
<PricingPageHero className="mx-4 max-sm:mt-2 md:mx-6" />
2424

25-
<Pricing className="mt-4" />
25+
<Pricing className="mx-4 md:mx-6" />
2626

2727
<PlanComparison className="mx-4 md:mx-6" />
2828

2929
<CompanyTestimonialsSection className="mx-4 mt-6 md:mx-6" />
3030

31-
{/* TODO: Pricing specific questions in the future? */}
3231
<FrequentlyAskedQuestions className="mx-4 md:mx-6" />
3332

3433
<GetYourAPIGameRightSection className="mx-4 sm:mb-6 md:mx-6" />

packages/web/docs/src/components/check-icon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export function CheckIcon(props: React.SVGProps<SVGSVGElement>) {
22
return (
3-
<svg width="20" height="20" fill="none" {...props}>
3+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" {...props}>
44
<path
55
d="M16.667 5 7.5 14.167 3.333 10"
66
stroke="currentColor"
Lines changed: 1 addition & 1 deletion
Loading

packages/web/docs/src/components/frequently-asked-questions/index.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { Anchor, cn, Heading } from '@theguild/components';
55
import { AttachPageFAQSchema } from '../../lib';
66
import FederationQuestions from './federation-questions.mdx';
77
import HomeQuestions from './home-questions.mdx';
8+
import { OpenAccordionItemWhenLinkedTo } from './open-accordion-item-when-linked-to';
89
import PartnersQuestions from './partners-questions.mdx';
10+
import { questionToId } from './question-to-id';
911

1012
const a = (props: ComponentPropsWithoutRef<'a'>) => (
1113
<Anchor
@@ -24,9 +26,12 @@ const h2 = (props: ComponentPropsWithoutRef<'h2'>) => (
2426
const UnwrapChild = (props: { children?: ReactNode }) => props.children as unknown as ReactElement;
2527

2628
const Accordion = (props: ComponentPropsWithoutRef<'ul'>) => (
27-
<RadixAccordion.Root asChild type="single" collapsible>
28-
<ul className="divide-beige-400 basis-1/2 divide-y max-xl:grow" {...props} />
29-
</RadixAccordion.Root>
29+
<>
30+
<RadixAccordion.Root asChild type="single" collapsible>
31+
<ul className="divide-beige-400 basis-1/2 divide-y max-xl:grow" {...props} />
32+
</RadixAccordion.Root>
33+
<OpenAccordionItemWhenLinkedTo />
34+
</>
3035
);
3136

3237
const AccordionItem = (props: ComponentPropsWithoutRef<'li'>) => {
@@ -60,6 +65,7 @@ const AccordionItem = (props: ComponentPropsWithoutRef<'li'>) => {
6065
itemScope
6166
itemProp="mainEntity"
6267
itemType="https://schema.org/Question"
68+
id={questionToId(question)}
6369
>
6470
<li>
6571
<RadixAccordion.Header>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
'use client';
2+
3+
import { useEffect, useLayoutEffect, useSyncExternalStore } from 'react';
4+
5+
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
6+
export function OpenAccordionItemWhenLinkedTo() {
7+
const hash = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
8+
9+
useIsomorphicLayoutEffect(() => {
10+
console.log('hash', hash);
11+
if (hash) {
12+
const button = document.querySelector<HTMLButtonElement>(
13+
`#${hash} button[aria-expanded="false"]`,
14+
);
15+
if (button) {
16+
button.click();
17+
// in the case where user scrolls up and clicks the same link again,
18+
// we couldn't rely on hash change, so we just consume it here
19+
window.history.replaceState({}, '', window.location.pathname);
20+
}
21+
}
22+
}, [hash]);
23+
24+
return null;
25+
}
26+
27+
const subscribe = (onStoreChange: () => void) => {
28+
const handler = () => {
29+
onStoreChange();
30+
};
31+
32+
window.addEventListener('hashchange', handler);
33+
return () => void window.removeEventListener('hashchange', handler);
34+
};
35+
36+
const getSnapshot = () => {
37+
const hash = window.location.hash;
38+
if (hash.startsWith('#faq')) {
39+
return hash.slice(1);
40+
}
41+
return undefined;
42+
};
43+
44+
const getServerSnapshot = () => {
45+
return undefined;
46+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { ReactNode } from 'react';
2+
3+
export function questionToId(question: string | ReactNode) {
4+
return typeof question === 'string'
5+
? `faq--${question.slice(0, -1).replace(/ /g, '-').toLowerCase()}`
6+
: undefined;
7+
}

0 commit comments

Comments
 (0)