feat(@ui): migrate checkbox component

This commit is contained in:
Paul Makles
2022-05-29 16:34:54 +01:00
parent 52ad0b2095
commit 0fbbde0acb
18 changed files with 239 additions and 361 deletions

View File

@@ -3,14 +3,14 @@ import { observer } from "mobx-react-lite";
import styles from "./Panes.module.scss";
import { Text } from "preact-i18n";
import { Checkbox } from "@revoltchat/ui";
import { useApplicationState } from "../../../mobx/State";
import {
AVAILABLE_EXPERIMENTS,
EXPERIMENTS,
} from "../../../mobx/stores/Experiments";
import Checkbox from "../../../components/ui/Checkbox";
export const ExperimentsPage = observer(() => {
const experiments = useApplicationState().experiments;
@@ -22,11 +22,11 @@ export const ExperimentsPage = observer(() => {
{AVAILABLE_EXPERIMENTS.map((key) => (
<Checkbox
key={key}
checked={experiments.isEnabled(key)}
value={experiments.isEnabled(key)}
onChange={(enabled) => experiments.setEnabled(key, enabled)}
description={EXPERIMENTS[key].description}>
{EXPERIMENTS[key].title}
</Checkbox>
description={EXPERIMENTS[key].description}
title={EXPERIMENTS[key].title}
/>
))}
{AVAILABLE_EXPERIMENTS.length === 0 && (
<div className={styles.empty}>