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:
@ -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"
|
||||
|
||||
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
@ -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 },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user