Skip to content

Commit

Permalink
chore(web): create switchfield (#1015)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-abe-dev authored Jun 17, 2024
1 parent 936e65a commit ace8ae8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions web/src/beta/ui/fields/SwitchField.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { FC } from "react";

import { Switcher, SwitcherProps } from "@reearth/beta/lib/reearth-ui";

import CommonField, { CommonFieldProps } from "./CommonField";

export type SwitchFieldProps = CommonFieldProps &
Pick<SwitcherProps, "value" | "onChange" | "disabled">;

const SwitchField: FC<SwitchFieldProps> = ({ title, description, ...props }) => {
return (
<CommonField title={title} description={description}>
<Switcher {...props} />
</CommonField>
);
};

export default SwitchField;
1 change: 1 addition & 0 deletions web/src/beta/ui/fields/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./CommonField";
export * from "./InputField";
export * from "./ColorField";
export * from "./SwitchField";

0 comments on commit ace8ae8

Please sign in to comment.