Skip to content

Commit 027b504

Browse files
committed
fix: PlatformTabs context
Change-Id: I5dc934695cefd9e2bf1289adf09dc133d246f68d
1 parent e913d61 commit 027b504

File tree

3 files changed

+77
-56
lines changed

3 files changed

+77
-56
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@radix-ui/react-slot": "^1.1.1",
3030
"@radix-ui/react-tabs": "^1.1.2",
3131
"@radix-ui/react-tooltip": "^1.1.3",
32-
"@rspress/core": "2.0.0-beta.35",
32+
"@rspress/core": "https://pkg.pr.new/@rspress/core@2747",
3333
"@shikijs/transformers": "^3.4.2",
3434
"class-variance-authority": "^0.7.1",
3535
"classnames": "^2.5.1",
@@ -62,11 +62,11 @@
6262
"@rsbuild/plugin-less": "^1.1.1",
6363
"@rsbuild/plugin-sass": "^1.2.2",
6464
"@rsbuild/plugin-svgr": "^1.0.7",
65-
"@rspress/plugin-algolia": "2.0.0-beta.35",
66-
"@rspress/plugin-client-redirects": "2.0.0-beta.35",
67-
"@rspress/plugin-llms": "2.0.0-beta.35",
68-
"@rspress/plugin-rss": "2.0.0-beta.35",
69-
"@rspress/plugin-sitemap": "2.0.0-beta.35",
65+
"@rspress/plugin-algolia": "https://pkg.pr.new/@rspress/plugin-algolia@2747",
66+
"@rspress/plugin-client-redirects": "https://pkg.pr.new/@rspress/plugin-client-redirects@2747",
67+
"@rspress/plugin-llms": "https://pkg.pr.new/@rspress/plugin-llms@2747",
68+
"@rspress/plugin-rss": "https://pkg.pr.new/@rspress/plugin-rss@2747",
69+
"@rspress/plugin-sitemap": "https://pkg.pr.new/@rspress/plugin-sitemap@2747",
7070
"@types/node": "^18.11.17",
7171
"@types/react": "^18.2.37",
7272
"@types/react-copy-to-clipboard": "^5.0.1",

pnpm-lock.yaml

Lines changed: 59 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/platform-tabs/PlatformTabs.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ interface PlatformTabProps {
108108
* ```
109109
*/
110110
const PlatformTab = ({ platform, children }: PlatformTabProps) => {
111+
if (process.env.__SSR_MD__) {
112+
return (
113+
<>
114+
<>{`\n**${platform} specific content start**\n`}</>
115+
{children}
116+
<>{`\n**${platform} specific content end**\n`}</>
117+
</>
118+
);
119+
}
111120
return <div data-platform={platform}>{children}</div>;
112121
};
113122

@@ -178,6 +187,9 @@ export const PlatformTabs = ({
178187
className,
179188
queryKey,
180189
}: PlatformTabsProps) => {
190+
if (process.env.__SSR_MD__) {
191+
return <>{children}</>;
192+
}
181193
// Get available platforms from children
182194
const availablePlatforms = React.Children.toArray(children).reduce<
183195
Platform[]

0 commit comments

Comments
 (0)