Skip to content

Commit 940dd98

Browse files
committed
happier rabbit
1 parent f45e265 commit 940dd98

File tree

7 files changed

+121
-226
lines changed

7 files changed

+121
-226
lines changed

packages/typegen/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
},
3737
"./api-app": {
3838
"import": {
39-
"types": "./dist/esm/server/contract.d.ts",
40-
"default": "./dist/esm/server/contract.js"
39+
"types": "./dist/esm/server/app.d.ts",
40+
"default": "./dist/esm/server/app.js"
4141
}
4242
},
4343
"./package.json": "./package.json"

packages/typegen/web/src/App.css

Lines changed: 0 additions & 153 deletions
This file was deleted.

packages/typegen/web/src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useForm, useFieldArray } from "react-hook-form";
44
import { zodResolver } from "@hookform/resolvers/zod";
55
import { client } from "./lib/api";
66
import { ConfigEditor } from "./components/ConfigEditor";
7-
import "./App.css";
87
import {
98
Accordion,
109
AccordionContent,

packages/typegen/web/src/components/ConfigEditor.tsx

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ export function ConfigEditor({ index }: ConfigEditorProps) {
3333
setValue,
3434
} = useFormContext<{ config: SingleConfig[] }>();
3535

36+
const baseId = useId();
37+
const generateClientSwitchId = `${baseId}-generate-client`;
38+
3639
const configErrors = errors.config?.[index];
3740
const webviewerScriptName = useWatch({
3841
control,
@@ -148,44 +151,41 @@ export function ConfigEditor({ index }: ConfigEditorProps) {
148151
<FormField
149152
control={control}
150153
name={`config.${index}.generateClient` as const}
151-
render={({ field }) => {
152-
const switchId = useId();
153-
return (
154-
<FormItem>
155-
<FormLabel>Generate</FormLabel>
156-
<FormControl>
157-
<div className="flex w-full items-center">
158-
<SwitchWrapper
159-
permanent={true}
160-
className="w-full inline-grid"
154+
render={({ field }) => (
155+
<FormItem>
156+
<FormLabel>Generate</FormLabel>
157+
<FormControl>
158+
<div className="flex w-full items-center">
159+
<SwitchWrapper
160+
permanent={true}
161+
className="w-full inline-grid"
162+
>
163+
<Switch
164+
id={generateClientSwitchId}
165+
size="xl"
166+
className="w-full rounded-md h-10"
167+
thumbClassName="rounded-md"
168+
checked={field.value || false}
169+
onCheckedChange={field.onChange}
170+
/>
171+
<SwitchIndicator
172+
state="off"
173+
className="w-1/2 text-accent-foreground peer-data-[state=checked]:text-primary"
161174
>
162-
<Switch
163-
id={switchId}
164-
size="xl"
165-
className="w-full rounded-md h-10"
166-
thumbClassName="rounded-md"
167-
checked={field.value || false}
168-
onCheckedChange={field.onChange}
169-
/>
170-
<SwitchIndicator
171-
state="off"
172-
className="w-1/2 text-accent-foreground peer-data-[state=checked]:text-primary"
173-
>
174-
Full Client
175-
</SwitchIndicator>
176-
<SwitchIndicator
177-
state="on"
178-
className="w-1/2 text-accent-foreground peer-data-[state=unchecked]:text-primary"
179-
>
180-
Types Only
181-
</SwitchIndicator>
182-
</SwitchWrapper>
183-
</div>
184-
</FormControl>
185-
<FormMessage />
186-
</FormItem>
187-
);
188-
}}
175+
Full Client
176+
</SwitchIndicator>
177+
<SwitchIndicator
178+
state="on"
179+
className="w-1/2 text-accent-foreground peer-data-[state=unchecked]:text-primary"
180+
>
181+
Types Only
182+
</SwitchIndicator>
183+
</SwitchWrapper>
184+
</div>
185+
</FormControl>
186+
<FormMessage />
187+
</FormItem>
188+
)}
189189
/>
190190
</div>
191191

0 commit comments

Comments
 (0)