refactor(button): rename loading to isLoading for clarity (#11058)

Updated all instances of the loading prop to isLoading across Button and
related components. This improves readability and ensures consistency in
the codebase.
This commit is contained in:
Antoine Moreaux
2025-03-20 12:57:19 +01:00
committed by GitHub
parent 548597bfd0
commit 5f390d75b0
7 changed files with 59 additions and 55 deletions

View File

@ -29,13 +29,13 @@ const StyledRecordsWrapper = styled.div`
`;
export const SettingsCustomDomain = () => {
const { customDomainRecords, loading } = useRecoilValue(
const { customDomainRecords, isLoading } = useRecoilValue(
customDomainRecordsState,
);
const { checkCustomDomainRecords } = useCheckCustomDomainValidRecords();
if (!customDomainRecords && !loading) {
if (!customDomainRecords && !isLoading) {
checkCustomDomainRecords();
}
@ -69,7 +69,7 @@ export const SettingsCustomDomain = () => {
)}
/>
<StyledButton
loading={loading}
isLoading={isLoading}
Icon={IconReload}
title={t`Reload`}
variant="primary"

View File

@ -12,13 +12,13 @@ export const useCheckCustomDomainValidRecords = () => {
const checkCustomDomainRecords = () => {
setCustomDomainRecords((currentState) => ({
...currentState,
loading: true,
isLoading: true,
}));
checkCustomDomainValidRecords({
onCompleted: (data) => {
if (isDefined(data.checkCustomDomainValidRecords)) {
setCustomDomainRecords({
loading: false,
isLoading: false,
customDomainRecords: data.checkCustomDomainValidRecords,
});
}

View File

@ -3,8 +3,8 @@ import { CustomDomainValidRecords } from '~/generated/graphql';
export const customDomainRecordsState = createState<{
customDomainRecords: CustomDomainValidRecords | null;
loading: boolean;
isLoading: boolean;
}>({
key: 'customDomainRecordsState',
defaultValue: { loading: false, customDomainRecords: null },
defaultValue: { isLoading: false, customDomainRecords: null },
});