Skip to content

Commit

Permalink
fix: use isDisabled if its nextui (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
escapedcat authored Dec 22, 2024
1 parent 1ad75f3 commit 01d30b5
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/components/ConfirmModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ export const ConfirmModal: ConfirmModalComponent = ({
<ConfirmModalBody>{children || props.body}</ConfirmModalBody>

<ConfirmModalFooter>
<Button onClick={onClose} disabled={isLoading}>
<Button onClick={onClose} isDisabled={isLoading}>
{cancelText || t("settings.cancel")}
</Button>
<Button
color="primary"
onClick={onConfirm}
disabled={isLoading || !onConfirm}
isDisabled={isLoading || !onConfirm}
isLoading={isLoading}
>
{confirmText || t("settings.confirm")}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Apps/AppCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const AppCard: FC<Props> = ({
installingApp.result === "fail") &&
!installed && (
<Button
disabled={
isDisabled={
isInstallWaiting ||
(installingApp !== null && installingApp?.result !== "fail")
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Apps/AppInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const AppInfo: FC = () => {
{(installingApp == null || installingApp.appId !== appId) &&
!installed && (
<Button
disabled={!!installingApp}
isDisabled={!!installingApp}
color="primary"
onClick={installHandler}
startContent={<PlusIcon className="inline h-6 w-6" />}
Expand Down Expand Up @@ -140,7 +140,7 @@ export const AppInfo: FC = () => {
{(installingApp == null || installingApp.appId !== appId) &&
installed && (
<Button
disabled={!!installingApp}
isDisabled={!!installingApp}
color="danger"
onClick={uninstallHandler}
startContent={<TrashIcon className="inline h-6 w-6" />}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Home/OpenChannelModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ export default function OpenChannelModal({ balance, disclosure }: Props) {
</ConfirmModal.Body>

<ConfirmModal.Footer>
<Button onClick={disclosure.onClose} disabled={isLoading}>
<Button onClick={disclosure.onClose} isDisabled={isLoading}>
{t("settings.cancel")}
</Button>

<Button
color="primary"
type="submit"
disabled={isLoading || !isValid}
isDisabled={isLoading || !isValid}
isLoading={isLoading}
>
{t("home.open_channel")}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Home/ReceiveModal/ReceiveLN.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const ReceiveLN: FC<Props> = ({ isLoading, error, onSubmitHandler }) => {
<Button
color="primary"
type="submit"
disabled={isLoading || (!isValid && submitCount > 0)}
isDisabled={isLoading || (!isValid && submitCount > 0)}
isLoading={isLoading}
>
{t("wallet.create_invoice")}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Home/SendModal/ConfirmSend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,14 @@ const ConfirmSend: FC<Props> = ({ confirmData, back, balance, close }) => {
</ConfirmModal.Body>

<ConfirmModal.Footer>
<Button onClick={() => close()} disabled={isLoading}>
<Button onClick={() => close()} isDisabled={isLoading}>
{t("settings.cancel")}
</Button>

<Button
color="primary"
type="submit"
disabled={
isDisabled={
!isValid || !isValidLnInvoice || isInvoiceAmountBiggerThanBalance
}
isLoading={isLoading}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Home/SendModal/SendLN.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const SendLn: FC<Props> = ({
errorMessage={errors.invoice?.message}
label={t("wallet.invoice")}
placeholder="lnbc..."
disabled={isLoading}
isDisabled={isLoading}
{...register("invoice", {
required: t("forms.validation.lnInvoice.required"),
pattern: {
Expand All @@ -88,7 +88,7 @@ const SendLn: FC<Props> = ({
<Button
color="primary"
type="submit"
disabled={isLoading || !isValid}
isDisabled={isLoading || !isValid}
isLoading={isLoading}
>
{t("wallet.send")}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Home/UnlockModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function UnlockModal({
inputWrapper:
"bg-tertiary group-data-[focus=true]:bg-tertiary group-data-[hover=true]:bg-tertiary",
}}
disabled={isLoading}
isDisabled={isLoading}
type="password"
label={t("forms.validation.unlock.pass_c")}
placeholder={t("forms.validation.unlock.pass_c")}
Expand All @@ -95,7 +95,7 @@ export default function UnlockModal({
<Button
color="primary"
type="submit"
disabled={isLoading || !isValid}
isDisabled={isLoading || !isValid}
isLoading={isLoading}
>
{isLoading ? t("wallet.unlocking") : t("wallet.unlock")}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Settings/ChangePwModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ const ChangePwModal: FC = () => {
confirmModal.onClose();
reset();
}}
disabled={isLoading}
isDisabled={isLoading}
>
{t("settings.cancel")}
</Button>
<Button
color="primary"
type="submit"
disabled={isLoading || !isValid}
isDisabled={isLoading || !isValid}
isLoading={isLoading}
>
{t("settings.confirm")}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Setup/SyncScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default function SyncScreen({ data, callback }: Props) {
}}
type="password"
label={t("setup.sync_wallet_info")}
disabled={runningUnlock}
isDisabled={runningUnlock}
isInvalid={!!errors.passwordInput}
errorMessage={errors.passwordInput?.message}
value={password}
Expand Down

0 comments on commit 01d30b5

Please sign in to comment.