[Rename] is_loading to is_pending.

This commit is contained in:
Sakamoto Shiina
2024-09-24 10:00:15 +09:00
parent 97b047a09e
commit c0c826b443
9 changed files with 16 additions and 16 deletions

View File

@@ -29,7 +29,7 @@ export const DropdownMenu = (props) => {
}); });
const dropdown_toggle_button_class_name = clsx(styles["dropdown_toggle_button"], { const dropdown_toggle_button_class_name = clsx(styles["dropdown_toggle_button"], {
[styles.is_loading]: (props.state === "pending") ? true : false, [styles.is_pending]: (props.state === "pending") ? true : false,
[styles.is_disabled]: props.is_disabled, [styles.is_disabled]: props.is_disabled,
}); });

View File

@@ -17,7 +17,7 @@
&:active { &:active {
background-color: var(--dark_975_color); background-color: var(--dark_975_color);
} }
&.is_loading { &.is_pending {
pointer-events: none; pointer-events: none;
} }
&.is_disabled { &.is_disabled {

View File

@@ -6,11 +6,11 @@ export const Switchbox = (props) => {
const [is_hovered, setIsHovered] = useState(false); const [is_hovered, setIsHovered] = useState(false);
const [is_mouse_down, setIsMouseDown] = useState(false); const [is_mouse_down, setIsMouseDown] = useState(false);
const is_loading = (props.variable.state === "pending"); const is_pending = (props.variable.state === "pending");
const getClassNames = (base_class) => clsx(base_class, { const getClassNames = (base_class) => clsx(base_class, {
[styles.is_active]: (props.variable.data === true), [styles.is_active]: (props.variable.data === true),
[styles.is_loading]: is_loading, [styles.is_pending]: is_pending,
[styles.is_hovered]: is_hovered, [styles.is_hovered]: is_hovered,
[styles.is_mouse_down]: is_mouse_down, [styles.is_mouse_down]: is_mouse_down,
}); });
@@ -36,7 +36,7 @@ export const Switchbox = (props) => {
> >
<div className={getClassNames(styles.toggle_control)}> <div className={getClassNames(styles.toggle_control)}>
<span className={getClassNames(styles.control)}></span> <span className={getClassNames(styles.control)}></span>
{is_loading && <span className={styles.loader}></span>} {is_pending && <span className={styles.loader}></span>}
</div> </div>
</div> </div>
</div> </div>

View File

@@ -16,7 +16,7 @@
padding: 2rem; padding: 2rem;
height: 100%; height: 100%;
flex-shrink: 0; flex-shrink: 0;
&.is_loading { &.is_pending {
pointer-events: none; pointer-events: none;
} }
} }

View File

@@ -5,7 +5,7 @@ import clsx from "clsx";
export const VolumeCheckButton = React.memo((props) => { export const VolumeCheckButton = React.memo((props) => {
const getClassNames = (baseClass) => clsx(baseClass, { const getClassNames = (baseClass) => clsx(baseClass, {
[styles.is_active]: (props.isChecking?.data === true), [styles.is_active]: (props.isChecking?.data === true),
[styles.is_loading]: (props.isChecking.state === "pending"), [styles.is_pending]: (props.isChecking.state === "pending"),
}); });
const toggleFunction = () => { const toggleFunction = () => {

View File

@@ -17,7 +17,7 @@
background-color: var(--primary_550_color); background-color: var(--primary_550_color);
} }
} }
&.is_loading { &.is_pending {
background-color: var(--dark_850_color); background-color: var(--dark_850_color);
pointer-events: none; pointer-events: none;
.button_svg, .button_text { .button_svg, .button_text {

View File

@@ -79,7 +79,7 @@ export const SwitchContainer = ({ switchLabel, switch_id, children, currentState
const getClassNames = (baseClass) => clsx(baseClass, { const getClassNames = (baseClass) => clsx(baseClass, {
[styles.is_compact_mode]: currentIsMainPageCompactMode.data, [styles.is_compact_mode]: currentIsMainPageCompactMode.data,
[styles.is_active]: (currentState.data === true), [styles.is_active]: (currentState.data === true),
[styles.is_loading]: (currentState.state === "pending"), [styles.is_pending]: (currentState.state === "pending"),
[styles.is_hovered]: is_hovered, [styles.is_hovered]: is_hovered,
[styles.is_mouse_down]: is_mouse_down, [styles.is_mouse_down]: is_mouse_down,
}); });

View File

@@ -23,7 +23,7 @@
&.is_compact_mode { &.is_compact_mode {
padding: 1.5rem; padding: 1.5rem;
} }
&.is_loading { &.is_pending {
pointer-events: none; pointer-events: none;
} }
} }
@@ -36,23 +36,23 @@
} }
$basic_label_color: var(--dark_basic_text_color); $basic_label_color: var(--dark_basic_text_color);
$loading_label_color: var(--dark_500_color); $pending_label_color: var(--dark_500_color);
.switch_label { .switch_label {
font-size: 1.4rem; font-size: 1.4rem;
color: $basic_label_color; color: $basic_label_color;
&.is_compact_mode { &.is_compact_mode {
display: none; display: none;
} }
&.is_loading { &.is_pending {
color: $loading_label_color; color: $pending_label_color;
} }
} }
.switch_svg { .switch_svg {
width: 1.8rem; width: 1.8rem;
color: $basic_label_color; color: $basic_label_color;
&.is_loading { &.is_pending {
color: $loading_label_color; color: $pending_label_color;
} }
&:not(.is_compact_mode) { &:not(.is_compact_mode) {
width: 1.6rem; width: 1.6rem;

View File

@@ -76,7 +76,7 @@ $toggle_control_size: $toggle_height - calc($toggle_gutter * 2);
background: $toggle_control_color; background: $toggle_control_color;
transition: left $toggle_control_speed $toggle_control_ease; transition: left $toggle_control_speed $toggle_control_ease;
} }
&.is_loading:after{ &.is_pending:after{
background-color: var(--dark_600_color); background-color: var(--dark_600_color);
} }
&.is_hovered { &.is_hovered {