Skip to content

Commit 4302727

Browse files
authored
Merge branch 'main' into issue-284
2 parents 5f377c6 + 2304215 commit 4302727

File tree

10 files changed

+131
-5
lines changed

10 files changed

+131
-5
lines changed

apps/frontpage/app/releases/[slug]/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export default async function Page({ params: { slug } }: PageProps) {
2929

3030
const page = await getRelease(slug);
3131

32+
const collator = new Intl.Collator('en', { numeric: true });
33+
3234
return (
3335
<>
3436
<Header
@@ -41,7 +43,7 @@ export default async function Page({ params: { slug } }: PageProps) {
4143
<DocsMainNav />
4244
<div className="flex flex-col pt-4 mt-4 border-t border-zinc-200">
4345
{releases
44-
.sort((a, b) => b.localeCompare(a))
46+
.sort((a, b) => collator.compare(b, a))
4547
.map((release) => (
4648
<Link
4749
className={cn(
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import Image from 'next/image';
2+
import Link from 'next/link';
3+
4+
export function CommunityRenderers() {
5+
return (
6+
<div className="mb-6 grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3">
7+
<Card
8+
href="https://analogjs.org/docs/integrations/storybook"
9+
logo="logo-analog.svg"
10+
title="Analog"
11+
subtitle="with Vite"
12+
/>
13+
<Card
14+
href="https://storybook.nuxtjs.org/"
15+
logo="logo-nuxt.svg"
16+
title="Nuxt"
17+
subtitle="with Vite"
18+
/>
19+
<Card
20+
href="https://github.com/solidjs-community/storybook"
21+
logo="logo-solidjs.svg"
22+
title="SolidJS"
23+
subtitle="with Vite"
24+
/>
25+
<Card
26+
href="https://storybook.rsbuild.dev/guide/framework/react.html"
27+
logo="logo-react.svg"
28+
title="React"
29+
subtitle="with Rspack / Rsbuild"
30+
/>
31+
<Card
32+
href="https://storybook.rsbuild.dev/guide/framework/vue.html"
33+
logo="logo-vue.svg"
34+
title="Vue"
35+
subtitle="with Rspack / Rsbuild"
36+
/>
37+
<Card
38+
href="https://storybook.rsbuild.dev/guide/framework/web-components.html"
39+
logo="logo-web-components.svg"
40+
title="Web Components"
41+
subtitle="with Rspack / Rsbuild"
42+
/>
43+
</div>
44+
);
45+
}
46+
47+
function Card({
48+
href,
49+
logo,
50+
title,
51+
subtitle,
52+
}: {
53+
href: string;
54+
logo: string;
55+
title: string;
56+
subtitle?: string;
57+
}) {
58+
return (
59+
<Link
60+
className="flex h-20 items-center gap-3 rounded-md border border-slate-200 pl-5 transition-all hover:-translate-y-px hover:border-slate-300 dark:border-slate-700 dark:hover:border-slate-600"
61+
href={href}
62+
>
63+
<Image
64+
alt=""
65+
height="28"
66+
src={`/images/logos/renderers/${logo}`}
67+
width="28"
68+
/>
69+
{subtitle ? (
70+
<div>
71+
<p className="text-md font-bold text-black dark:text-white">
72+
{title}
73+
</p>
74+
<p className="text-sm text-slate-600 dark:text-slate-400">
75+
{subtitle}
76+
</p>
77+
</div>
78+
) : (
79+
<p className="text-md font-bold text-black dark:text-white">{title}</p>
80+
)}
81+
</Link>
82+
);
83+
}

apps/frontpage/components/docs/mdx/home-renderers.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ export function HomeRenderers({ activeVersion }: HomeRenderersProps) {
1414
logo="logo-nextjs.svg"
1515
title="Next.js"
1616
/>
17+
{Number(activeVersion.id) >= 8.5 ? (
18+
<Card
19+
href="/docs/get-started/frameworks/nextjs-vite/?renderer=react"
20+
logo="logo-nextjs.svg"
21+
subtitle="with Vite"
22+
title="Next.js"
23+
/>
24+
) : null}
1725
<Card
1826
href="/docs/get-started/frameworks/react-vite/?renderer=react"
1927
logo="logo-react.svg"

apps/frontpage/components/docs/mdx/img.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ interface ImgProps extends ImageProps {
1515
}
1616

1717
export function Img({ src, alt, activeVersion }: ImgProps) {
18-
const pathWithoutRoot = src
19-
?.replace('../../_assets/', '')
20-
.replace('../_assets/', '');
18+
const pathWithoutRoot = src?.replace(/^(?:\.\.\/)+_assets\//, '');
2119
const path = `/docs-assets/${activeVersion}/${pathWithoutRoot ?? ''}`;
2220
const localPath = `public${path}`;
2321

apps/frontpage/components/docs/mdx/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export { A } from './a';
22
export { CodeSnippets } from './code-snippets';
3+
export { CommunityRenderers } from './community-renderers';
34
export { FeatureSnippets } from './feature-snippets';
45
export { HomeConcepts } from './home-concepts';
56
export { HomeRenderers } from './home-renderers';

apps/frontpage/components/home/hero/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { motion } from 'framer-motion';
99
import { useEffect, useRef, useState } from 'react';
1010
import { ChevronLeftIcon, ChevronRightIcon } from '@storybook/icons';
1111
import { Container } from '@repo/ui';
12+
import { latestVersion } from '@repo/utils';
1213
import { Manager } from '../manager';
1314
import { InitCommand } from './init-command';
1415
import { Chrome } from './chrome';
@@ -122,7 +123,7 @@ export function Hero({
122123
className="md:hidden"
123124
href="https://github.com/storybookjs/storybook/releases"
124125
>
125-
<div className="text-md text-white">v10</div>
126+
<div className="text-md text-white">v{latestVersion.id.split('.')[0]}</div>
126127
<div className="text-sm text-white/60">Latest version</div>
127128
</a>
128129
<div>

apps/frontpage/lib/get-page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { ReactNode, ReactElement } from 'react';
66
import {
77
A,
88
CodeSnippets,
9+
CommunityRenderers,
910
FeatureSnippets,
1011
HomeConcepts,
1112
HomeRenderers,
@@ -83,6 +84,7 @@ export const getPageData = async (
8384
CodeSnippets: (props) => (
8485
<CodeSnippets activeVersion={activeVersion} {...props} />
8586
),
87+
CommunityRenderers,
8688
FeatureSnippets,
8789
FrameworkSupportTable: (props: { children: ReactNode }) => (
8890
<div {...props}>{props.children}</div>
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 29 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)