Fix building by addressing missing labels/props for inputs

This commit is contained in:
Max Leiter 2022-12-05 16:42:36 -08:00
parent 7ef45c28f0
commit aee2330e21
3 changed files with 8 additions and 2 deletions

View file

@ -10,7 +10,7 @@ type Props = React.HTMLProps<HTMLInputElement> & {
} }
// we have two special rules on top of the props: // we have two special rules on top of the props:
// if onChange or value is passed, we require both // if onChange or value is passed, we require both, unless `disabled`
// if label is passed, we forbid aria-label and vice versa // if label is passed, we forbid aria-label and vice versa
type InputProps = Omit<Props, "onChange" | "value" | "label" | "aria-label"> & type InputProps = Omit<Props, "onChange" | "value" | "label" | "aria-label"> &
( (
@ -22,6 +22,11 @@ type InputProps = Omit<Props, "onChange" | "value" | "label" | "aria-label"> &
onChange?: never onChange?: never
value?: never value?: never
} }
| {
value: Props["value"]
disabled: true
onChange?: never
}
) & ) &
( (
| { | {

View file

@ -66,6 +66,7 @@ const PasswordModal = ({
label="Password" label="Password"
type="password" type="password"
placeholder="Password" placeholder="Password"
value={password}
onChange={(e) => setPassword(e.currentTarget.value)} onChange={(e) => setPassword(e.currentTarget.value)}
/> />
{creating && ( {creating && (
@ -74,6 +75,7 @@ const PasswordModal = ({
label="Confirm" label="Confirm"
type="password" type="password"
placeholder="Confirm Password" placeholder="Confirm Password"
value={confirmPassword}
onChange={(e) => setConfirmPassword(e.currentTarget.value)} onChange={(e) => setConfirmPassword(e.currentTarget.value)}
/> />
)} )}

View file

@ -17,7 +17,6 @@ export function LayoutWrapper({ children }: { children: React.ReactNode }) {
enableSystem={true} enableSystem={true}
defaultTheme="dark" defaultTheme="dark"
disableTransitionOnChange disableTransitionOnChange
cookieName={"drift-theme"}
attribute="data-theme" attribute="data-theme"
enableColorScheme={true} enableColorScheme={true}
> >