chore: Move to Typescript (#2783)
This PR moves the entire project to Typescript. Due to the ~1000 ignores this will lead to a messy codebase for a while, but the churn is worth it – all of those ignore comments are places that were never type-safe previously. closes #1282
This commit is contained in:
34
app/scenes/Settings/components/NotificationListItem.tsx
Normal file
34
app/scenes/Settings/components/NotificationListItem.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import * as React from "react";
|
||||
import NotificationSetting from "~/models/NotificationSetting";
|
||||
import Checkbox from "~/components/Checkbox";
|
||||
|
||||
type Props = {
|
||||
setting?: NotificationSetting;
|
||||
title: string;
|
||||
event: string;
|
||||
description: string;
|
||||
disabled: boolean;
|
||||
onChange: (ev: React.SyntheticEvent) => void | Promise<void>;
|
||||
};
|
||||
|
||||
const NotificationListItem = ({
|
||||
setting,
|
||||
title,
|
||||
event,
|
||||
onChange,
|
||||
disabled,
|
||||
description,
|
||||
}: Props) => {
|
||||
return (
|
||||
<Checkbox
|
||||
label={title}
|
||||
name={event}
|
||||
checked={!!setting}
|
||||
onChange={onChange}
|
||||
note={description}
|
||||
disabled={disabled}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default NotificationListItem;
|
||||
Reference in New Issue
Block a user