0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

refactor(console): make the disabled prop of the CheckBox optional (#2933)

This commit is contained in:
Xiao Yijun 2023-01-13 10:41:55 +08:00 committed by GitHub
parent 8624fc8e62
commit 3951724bcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 2 additions and 6 deletions

View file

@ -10,7 +10,7 @@ import * as styles from './index.module.scss';
type Props = {
/* eslint-disable react/boolean-prop-naming */
checked: boolean;
disabled: boolean;
disabled?: boolean;
indeterminate?: boolean;
/* eslint-enable react/boolean-prop-naming */
onChange: (value: boolean) => void;
@ -21,7 +21,7 @@ type Props = {
const Checkbox = ({
checked,
disabled,
disabled = false,
indeterminate,
onChange,
label,

View file

@ -32,7 +32,6 @@ const ResourceItem = ({ resource, selectedScopes, onSelectResource, onSelectScop
<Checkbox
checked={selectedScopesCount === totalScopesCount}
indeterminate={selectedScopesCount > 0 && selectedScopesCount < totalScopesCount}
disabled={false}
onChange={() => {
onSelectResource(resource);
}}

View file

@ -15,7 +15,6 @@ const SourceScopeItem = ({ scope, scope: { name }, isSelected, onSelect }: Props
<div className={styles.sourceScopeItem}>
<Checkbox
checked={isSelected}
disabled={false}
onChange={() => {
onSelect(scope);
}}

View file

@ -30,7 +30,6 @@ const SourceUserItem = ({ user: { avatar, name }, isSelected, onSelect }: Props)
>
<Checkbox
checked={isSelected}
disabled={false}
onChange={() => {
onSelect();
}}

View file

@ -30,7 +30,6 @@ const SourceRoleItem = ({ role, isSelected, onSelect }: Props) => {
>
<Checkbox
checked={isSelected}
disabled={false}
onChange={() => {
onSelect();
}}