Skip to content

Commit 2cfe8d4

Browse files
committed
fix type error
1 parent d41e168 commit 2cfe8d4

File tree

4 files changed

+51
-37
lines changed

4 files changed

+51
-37
lines changed

src/ui/surfaces/ConnectConfiguration.tsx

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import {
99
} from "@netlify/sdk/ui/react/components";
1010
import { trpc } from "../trpc";
1111
import { useNetlifySDK } from "@netlify/sdk/ui/react";
12-
import { CommonDataSourceSchema, ConnectSettings } from "../../schema/settings-schema";
12+
import {
13+
CommonDataSourceSchema,
14+
ConnectSettings,
15+
} from "../../schema/settings-schema";
1316

1417
export const ConnectConfiguration = () => {
1518
const sdk = useNetlifySDK();
@@ -51,14 +54,17 @@ export const ConnectConfiguration = () => {
5154
<CardTitle>Data Source Configuration</CardTitle>
5255
<Form
5356
defaultValues={
54-
connectSettingsQuery.data ? {
55-
...connectSettingsQuery.data,
56-
numberOfMockItems: connectSettingsQuery.data.config.numberOfMockItems ?? 5,
57-
} : {
58-
numberOfMockItems: 5,
59-
name: "",
60-
prefix: "",
61-
}
57+
connectSettingsQuery.data
58+
? {
59+
...connectSettingsQuery.data,
60+
numberOfMockItems:
61+
connectSettingsQuery.data.config.numberOfMockItems ?? 5,
62+
}
63+
: {
64+
numberOfMockItems: 5,
65+
name: "",
66+
prefix: "",
67+
}
6268
}
6369
schema={ConnectSettings.merge(CommonDataSourceSchema)}
6470
onSubmit={onSubmit}
@@ -78,12 +84,22 @@ export const ConnectConfiguration = () => {
7884
required
7985
/>
8086
</Form>
81-
<hr />
82-
The code for this surface can be seen here:
83-
<ul>
84-
<li>&nbsp;&nbsp;<Link href="https://github.com/netlify/extension-showcase/blob/main/src/ui/surfaces/ConnectConfiguration.tsx" target="_blank">React UI code</Link></li>
85-
<li>&nbsp;&nbsp;<Link href="https://github.com/netlify/extension-showcase/blob/main/src/server/router.ts" target="_blank">Server code</Link></li>
86-
</ul>
87+
<hr />
88+
The code for this surface can be seen here:
89+
<ul>
90+
<li>
91+
&nbsp;&nbsp;
92+
<Link href="https://github.com/netlify/extension-showcase/blob/main/src/ui/surfaces/ConnectConfiguration.tsx">
93+
React UI code
94+
</Link>
95+
</li>
96+
<li>
97+
&nbsp;&nbsp;
98+
<Link href="https://github.com/netlify/extension-showcase/blob/main/src/server/router.ts">
99+
Server code
100+
</Link>
101+
</li>
102+
</ul>
87103
</Card>
88104
)}
89105
</ConnectConfigurationSurface>

src/ui/surfaces/SiteConfiguration.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,22 @@ export const SiteConfiguration = () => {
4848
<code>{accountSettingQuery.data}</code>
4949
</p>
5050
{siteSettingsSummary}
51-
<hr />
52-
The code for this surface can be seen here:
53-
<ul>
54-
<li>&nbsp;&nbsp;<Link href="https://github.com/netlify/extension-showcase/blob/main/src/ui/surfaces/SiteConfiguration.tsx" target="_blank">React UI code</Link></li>
55-
<li>&nbsp;&nbsp;<Link href="https://github.com/netlify/extension-showcase/blob/main/src/server/router.ts" target="_blank">Server code</Link></li>
56-
</ul>
51+
<hr />
52+
The code for this surface can be seen here:
53+
<ul>
54+
<li>
55+
&nbsp;&nbsp;
56+
<Link href="https://github.com/netlify/extension-showcase/blob/main/src/ui/surfaces/SiteConfiguration.tsx">
57+
React UI code
58+
</Link>
59+
</li>
60+
<li>
61+
&nbsp;&nbsp;
62+
<Link href="https://github.com/netlify/extension-showcase/blob/main/src/server/router.ts">
63+
Server code
64+
</Link>
65+
</li>
66+
</ul>
5767
</Card>
5868
)}
5969
</SiteConfigurationSurface>

src/ui/surfaces/SiteGeneralConfiguration.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,13 @@ export const SiteGeneralConfiguration = () => {
6262
<ul>
6363
<li>
6464
&nbsp;&nbsp;
65-
<Link
66-
href="https://github.com/netlify/extension-showcase/blob/main/src/ui/surfaces/SiteGeneralConfiguration.tsx"
67-
target="_blank"
68-
>
65+
<Link href="https://github.com/netlify/extension-showcase/blob/main/src/ui/surfaces/SiteGeneralConfiguration.tsx">
6966
React UI code
7067
</Link>
7168
</li>
7269
<li>
7370
&nbsp;&nbsp;
74-
<Link
75-
href="https://github.com/netlify/extension-showcase/blob/main/src/server/router.ts"
76-
target="_blank"
77-
>
71+
<Link href="https://github.com/netlify/extension-showcase/blob/main/src/server/router.ts">
7872
Server code
7973
</Link>
8074
</li>

src/ui/surfaces/TeamConfiguration.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,13 @@ export const TeamConfiguration = () => {
5454
<ul>
5555
<li>
5656
&nbsp;&nbsp;
57-
<Link
58-
href="https://github.com/netlify/extension-showcase/blob/main/src/ui/surfaces/TeamConfiguration.tsx"
59-
target="_blank"
60-
>
57+
<Link href="https://github.com/netlify/extension-showcase/blob/main/src/ui/surfaces/TeamConfiguration.tsx">
6158
React UI code
6259
</Link>
6360
</li>
6461
<li>
6562
&nbsp;&nbsp;
66-
<Link
67-
href="https://github.com/netlify/extension-showcase/blob/main/src/server/router.ts"
68-
target="_blank"
69-
>
63+
<Link href="https://github.com/netlify/extension-showcase/blob/main/src/server/router.ts">
7064
Server code
7165
</Link>
7266
</li>

0 commit comments

Comments
 (0)