Skip to content

Commit f0194da

Browse files
authored
Merge pull request #242 from GeekyAnts/staging
Staging
2 parents 4867d63 + c62edaf commit f0194da

File tree

7 files changed

+32
-23
lines changed

7 files changed

+32
-23
lines changed

src/new-components/MainContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const SubMainContent2 = React.memo(({ props }: any) => {
124124
{/* */}
125125
<VStack>
126126
{!isLatestVersionSlug(activeVersion) && <Badge rounded="4" flexDir="row" alignSelf='flex-start'>version: {activeVersion}</Badge>}
127-
<Heading mb="6" size="xl" _dark={{ color: "coolGray.50" }}>
127+
<Heading nativeID="DocSearch-h1" mb="6" size="xl" _dark={{ color: "coolGray.50" }}>
128128
{frontMatter && frontMatter.title
129129
? frontMatter.title
130130
: pages.currentPage.title}

src/new-components/markdown-components/CodeBlock/Playground.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import React, { useRef } from "react";
22
import LiveCodeEditorScope from "./LiveCodeEditorScope";
33
import { getParsedCode, addExportsToCode } from "./utils";
44
import {
@@ -48,6 +48,7 @@ export const Playground = ({ children, ...props }: any) => {
4848
const [parsedCode, setParsedCode] = React.useState(getParsedCode(children));
4949
// const [parsedCode, setParsedCode] = React.useState(children);
5050
const [copied, setCopied] = React.useState(false);
51+
const formRef = useRef(null)
5152

5253
const { onCopy } = useClipboard();
5354

@@ -71,7 +72,7 @@ export const Playground = ({ children, ...props }: any) => {
7172

7273
function submitExpoForm() {
7374
// @ts-ignore
74-
document.getElementById("expo-form")?.submit();
75+
formRef.current?.submit();
7576
}
7677
return (
7778
<LiveProvider
@@ -153,7 +154,7 @@ export const Playground = ({ children, ...props }: any) => {
153154
action={SNACK_URL}
154155
method="POST"
155156
target="_blank"
156-
id="expo-form"
157+
ref={formRef}
157158
>
158159
<input
159160
type="hidden"

src/new-components/markdown-components/Heading1.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ import { getHeadingMeta } from "../../utils";
55
export const Heading1 = ({ children }: any) => {
66
const [content, id] = getHeadingMeta(children);
77
return (
8-
<Heading fontSize="3xl" color={useColorModeValue("gray.700", "gray.300")} />
8+
<Heading nativeID="DocSearch-h1" fontSize="3xl" color={useColorModeValue("gray.700", "gray.300")} />
99
);
1010
};

src/new-components/markdown-components/Heading2.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const Heading2 = ({ children }: any) => {
1111
{({ isHovered }) => {
1212
return (
1313
<HStack alignItems="center" space="2">
14+
<Heading display="none" nativeID="DocSearch-h2" >{content}</Heading>
1415
<Heading
1516
fontSize="2xl"
1617
_dark={{ color: "gray.300" }}

src/new-components/markdown-components/Heading3.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const Heading3 = ({ children }: any) => {
1010
{({ isHovered }) => {
1111
return (
1212
<HStack alignItems="center" space="2">
13+
<Heading display="none" nativeID="DocSearch-h3" >{content}</Heading>
1314
<Heading
1415
fontSize="xl"
1516
fontWeight="normal"

src/new-components/markdown-components/Heading4.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ import { getHeadingMeta } from "../../utils";
55
export const Heading4 = ({ children }: any) => {
66
const [content, id] = getHeadingMeta(children);
77
return (
8-
<Heading
9-
my="2"
10-
fontSize="md"
11-
color={useColorModeValue("gray.700", "gray.300")}
12-
// @ts-ignore
13-
nativeID={id}
14-
>
15-
{content}
16-
</Heading>
8+
<>
9+
<Heading display="none" nativeID="DocSearch-h4" >{content}</Heading>
10+
<Heading
11+
my="2"
12+
fontSize="md"
13+
color={useColorModeValue("gray.700", "gray.300")}
14+
// @ts-ignore
15+
nativeID={id}
16+
>
17+
{content}
18+
</Heading>
19+
</>
1720
);
1821
};

src/new-components/markdown-components/Heading5.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ import { Heading, useColorModeValue } from "native-base";
33
import { getHeadingMeta } from "../../utils";
44

55
export const Heading5 = ({ children }: any) => {
6-
const [content,id] = getHeadingMeta(children);
6+
const [content, id] = getHeadingMeta(children);
77
return (
8-
<Heading
9-
fontSize="md"
10-
color={useColorModeValue("gray.700", "gray.300")}
11-
// @ts-ignore
12-
nativeID={id}
13-
>
14-
{content}
15-
</Heading>
8+
<>
9+
<Heading display="none" nativeID="DocSearch-h5" >{content}</Heading>
10+
<Heading
11+
fontSize="md"
12+
color={useColorModeValue("gray.700", "gray.300")}
13+
// @ts-ignore
14+
nativeID={id}
15+
>
16+
{content}
17+
</Heading>
18+
</>
1619
);
1720
};

0 commit comments

Comments
 (0)