Skip to content

Commit

Permalink
refactor: remove true from boolean attribute (#54)
Browse files Browse the repository at this point in the history
When using a boolean attribute in JSX, you can set the attribute value to true or omit the value. This helps to keep consistency in code.

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
  • Loading branch information
deepsource-autofix[bot] authored Nov 21, 2023
1 parent 61e067e commit 3d2ad21
Show file tree
Hide file tree
Showing 23 changed files with 71 additions and 71 deletions.
2 changes: 1 addition & 1 deletion app/components/NetworkState.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default function NetworkState() {
<div className={cardClassName}>
<TitledValue title={t("root.lbl_best_block")} value={networkState.bestNumber.toLocaleString()} />
<TitledValue title={t("root.lbl_finalized")} value={networkState.bestNumberFinalized.toLocaleString()} />
<TitledValue title={t("root.lbl_latest_block")} value={<TimeAgo date={networkState.timestamp} live={true} />} />
<TitledValue title={t("root.lbl_latest_block")} value={<TimeAgo date={networkState.timestamp} live />} />
<TitledValue title={t("root.lbl_target")} value={formatDuration(networkState.targetBlockTime)} />
<TitledValue title={t("root.lbl_total_issuance")} value={<FormattedAmount value={networkState.totalIssuance} />} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/components/block/Object.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function Object({ geometry }: IProps) {
<pointLight intensity={2} position={[-10, -10, -10]} />
<spotLight position={[10, 10, 10]} angle={0.15} penumbra={1} />
<mesh ref={meshRef} geometry={geometry}>
<meshPhongMaterial color="#fff" envMap={textureCube} refractionRatio={0.7} reflectivity={1} flatShading={true} />
<meshPhongMaterial color="#fff" envMap={textureCube} refractionRatio={0.7} reflectivity={1} flatShading />
</mesh>
</>
);
Expand Down
8 changes: 4 additions & 4 deletions app/components/common/AmountInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ export default function AmountInput({ disabled, onValueChange, placeholder, form
return (
<NumericInput
disabled={disabled}
selectAllOnFocus={true}
large={true}
selectAllOnFocus
large
buttonPosition={"none"}
leftIcon="send-to"
placeholder={placeholder || "Amount"}
onValueChange={handleAmountChange}
value={amount}
fill={true}
fill
min={0}
minorStepSize={0.001}
rightElement={<Tag minimal={true}>{formatOptionsUnit || (formatOptions?.unit)}</Tag>}
rightElement={<Tag minimal>{formatOptionsUnit || (formatOptions?.unit)}</Tag>}
/>
);
}
4 changes: 2 additions & 2 deletions app/components/dialogs/DialogAddMiner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ export default function DialogAddMiner({ pair, isOpen, onClose }: IProps) {
const addressIcon = isValidPolkadotAddress(data) ? <AddressIcon address={data} className="m-2" /> : <Icon icon="asterisk" />;

return (
<Dialog isOpen={isOpen} usePortal={true} onOpening={handleOnOpening} onClose={onClose} className="w-[90%] sm:w-[640px]">
<Dialog isOpen={isOpen} usePortal onOpening={handleOnOpening} onClose={onClose} className="w-[90%] sm:w-[640px]">
<div className={`${Classes.DIALOG_BODY} flex flex-col gap-3`}>
<InputGroup
disabled={isLoading}
large={true}
large
className="font-mono"
spellCheck={false}
placeholder={t("dlg_miner.lbl_miner_address")}
Expand Down
2 changes: 1 addition & 1 deletion app/components/dialogs/DialogClosePool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function DialogClosePool({ isOpen, onClose, pair }: IProps) {
return (
<Dialog
isOpen={isOpen}
usePortal={true}
usePortal
onOpening={handleOnOpening}
title={t("dlg_close_pool.lbl_title")}
onClose={onClose}
Expand Down
6 changes: 3 additions & 3 deletions app/components/dialogs/DialogCreateAddress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ export default function DialogCreateAddress({ isOpen, onClose }: IProps) {

return (
<>
<Dialog isOpen={isOpen} usePortal={true} onOpening={handleOpening} onClose={onClose} className="w-[90%] sm:w-[640px]">
<Dialog isOpen={isOpen} usePortal onOpening={handleOpening} onClose={onClose} className="w-[90%] sm:w-[640px]">
<div className={`${Classes.DIALOG_BODY} flex flex-col gap-3`}>
<TitledValue title={t("dlg_wallet.lbl_title")} value={data.address} fontMono={true} />
<TitledValue title={t("dlg_wallet.lbl_title")} value={data.address} fontMono />
<div className="text-gray-500">{t("dlg_wallet.lbl_keep_seed")}</div>
<Card>
<div className="text-center font-mono text-xl">{data.mnemonic}</div>
Expand All @@ -60,7 +60,7 @@ export default function DialogCreateAddress({ isOpen, onClose }: IProps) {
</Card>
<InputGroup
type="password"
large={true}
large
className="font-mono"
spellCheck={false}
placeholder={t("dlg_wallet.lbl_password")}
Expand Down
20 changes: 10 additions & 10 deletions app/components/dialogs/DialogIdentity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export default function DialogIdentity({ isOpen, onClose, pair, hasIdentity, isR
return (
<Dialog
isOpen={isOpen}
usePortal={true}
usePortal
onOpening={handleOnOpening}
title={t("dlg_identity.lbl_title")}
onClose={onClose}
Expand All @@ -220,10 +220,10 @@ export default function DialogIdentity({ isOpen, onClose, pair, hasIdentity, isR
items={dataState.registrarList}
itemPredicate={filterRegistrar}
itemRenderer={renderRegistrar}
noResults={<MenuItem disabled={true} text={t("dlg_identity.lbl_no_results")} roleStructure="listoption" />}
noResults={<MenuItem disabled text={t("dlg_identity.lbl_no_results")} roleStructure="listoption" />}
onItemSelect={setRegistrar}
popoverProps={{ matchTargetWidth: true }}
fill={true}
fill
disabled={isIdentityLoading}
>
<Button
Expand All @@ -237,7 +237,7 @@ export default function DialogIdentity({ isOpen, onClose, pair, hasIdentity, isR
<>
<InputGroup
disabled={isIdentityLoading}
large={true}
large
className="font-mono"
spellCheck={false}
placeholder={t("dlg_identity.lbl_placeholder_display_name")}
Expand All @@ -250,7 +250,7 @@ export default function DialogIdentity({ isOpen, onClose, pair, hasIdentity, isR
/>
<InputGroup
disabled={isIdentityLoading}
large={true}
large
className="font-mono"
spellCheck={false}
placeholder={t("dlg_identity.lbl_placeholder_legal_name")}
Expand All @@ -263,7 +263,7 @@ export default function DialogIdentity({ isOpen, onClose, pair, hasIdentity, isR
/>
<InputGroup
disabled={isIdentityLoading}
large={true}
large
className="font-mono"
spellCheck={false}
placeholder={t("dlg_identity.lbl_placeholder_email")}
Expand All @@ -276,7 +276,7 @@ export default function DialogIdentity({ isOpen, onClose, pair, hasIdentity, isR
/>
<InputGroup
disabled={isIdentityLoading}
large={true}
large
className="font-mono"
spellCheck={false}
placeholder={t("dlg_identity.lbl_placeholder_web_address")}
Expand All @@ -289,7 +289,7 @@ export default function DialogIdentity({ isOpen, onClose, pair, hasIdentity, isR
/>
<InputGroup
disabled={isIdentityLoading}
large={true}
large
className="font-mono"
spellCheck={false}
placeholder={t("dlg_identity.lbl_placeholder_twitter")}
Expand All @@ -302,7 +302,7 @@ export default function DialogIdentity({ isOpen, onClose, pair, hasIdentity, isR
/>
<InputGroup
disabled={isIdentityLoading}
large={true}
large
className="font-mono"
spellCheck={false}
placeholder={t("dlg_identity.lbl_placeholder_discord")}
Expand All @@ -315,7 +315,7 @@ export default function DialogIdentity({ isOpen, onClose, pair, hasIdentity, isR
/>
<InputGroup
disabled={isIdentityLoading}
large={true}
large
className="font-mono"
spellCheck={false}
placeholder={t("dlg_identity.lbl_placeholder_riot_name")}
Expand Down
4 changes: 2 additions & 2 deletions app/components/dialogs/DialogImportAddress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function DialogImportAddress({ isOpen, showPassword, onImport, on

return (
<>
<Dialog isOpen={isOpen} usePortal={true} onOpening={handleOnOpening} onClose={onClose} className="w-[90%] sm:w-[640px]">
<Dialog isOpen={isOpen} usePortal onOpening={handleOnOpening} onClose={onClose} className="w-[90%] sm:w-[640px]">
<div className={`${Classes.DIALOG_BODY} flex flex-col gap-3`}>
<TextArea className="w-full font-mono" rows={5} onChange={handleSeedPhraseChange} value={data.seed_phrase} />
{canPaste && (
Expand All @@ -44,7 +44,7 @@ export default function DialogImportAddress({ isOpen, showPassword, onImport, on
{showPassword && (
<InputGroup
type="password"
large={true}
large
className="font-mono"
spellCheck={false}
placeholder={t("dlg_import_address.lbl_passphrase")}
Expand Down
6 changes: 3 additions & 3 deletions app/components/dialogs/DialogJoinPool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default function DialogJoinPool({ isOpen, onClose, pair }: IProps) {
return (
<Dialog
isOpen={isOpen}
usePortal={true}
usePortal
onOpening={handleOnOpening}
title={t("dlg_join_pool.lbl_title")}
onClose={onClose}
Expand All @@ -136,10 +136,10 @@ export default function DialogJoinPool({ isOpen, onClose, pair }: IProps) {
itemPredicate={filterPool}
itemRenderer={renderPool}
menuProps={{ className: "max-h-[300px] overflow-auto" }}
noResults={<MenuItem disabled={true} text={t("dlg_join_pool.lbl_no_results")} roleStructure="listoption" />}
noResults={<MenuItem disabled text={t("dlg_join_pool.lbl_no_results")} roleStructure="listoption" />}
onItemSelect={setPool}
popoverProps={{ matchTargetWidth: true }}
fill={true}
fill
>
<Button
text={data.poolToJoin}
Expand Down
6 changes: 3 additions & 3 deletions app/components/dialogs/DialogLeavePool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default function DialogLeavePool({ isOpen, onClose, pair }: IProps) {
return (
<Dialog
isOpen={isOpen}
usePortal={true}
usePortal
onOpening={handleOnOpening}
title={t("dlg_leave_pool.lbl_title")}
onClose={onClose}
Expand All @@ -136,10 +136,10 @@ export default function DialogLeavePool({ isOpen, onClose, pair }: IProps) {
items={data.poolIds}
itemPredicate={filterPool}
itemRenderer={renderPoolId}
noResults={<MenuItem disabled={true} text={t("dlg_leave_pool.lbl_no_results")} roleStructure="listoption" />}
noResults={<MenuItem disabled text={t("dlg_leave_pool.lbl_no_results")} roleStructure="listoption" />}
onItemSelect={setPool}
popoverProps={{ matchTargetWidth: true }}
fill={true}
fill
>
<Button
text={data.poolToLeave}
Expand Down
10 changes: 5 additions & 5 deletions app/components/dialogs/DialogLockFunds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,21 @@ export default function DialogLockFunds({ pair, isOpen, onClose, onAfterSubmit }
}, [api, data, onAfterSubmit, pair, toaster]);

return (
<Dialog isOpen={isOpen} usePortal={true} onClose={onClose} onOpening={handleOnOpening} className="w-[90%] sm:w-[640px]">
<Dialog isOpen={isOpen} usePortal onClose={onClose} onOpening={handleOnOpening} className="w-[90%] sm:w-[640px]">
<div className={`${Classes.DIALOG_BODY} flex flex-col gap-3`}>
<AmountInput disabled={isLoading} onValueChange={handleAmountChange} placeholder={t("commons.lbl_amount")} />
<NumericInput
disabled={isLoading}
buttonPosition={"none"}
large={true}
fill={true}
large
fill
placeholder={t("dlg_lock_funds.lbl_release_lock_after")}
leftIcon="cube"
onValueChange={handleBlockChange}
value={data.block}
rightElement={<Tag minimal={true}>{t("dlg_lock_funds.lbl_block_number")}</Tag>}
rightElement={<Tag minimal>{t("dlg_lock_funds.lbl_block_number")}</Tag>}
/>
<Checkbox checked={data.auto_extend} large={true} onChange={handleAutoExtendChange}>
<Checkbox checked={data.auto_extend} large onChange={handleAutoExtendChange}>
{t("dlg_lock_funds.lbl_chk_extended")} {autoExtendPeriod} {t("dlg_lock_funds.lbl_chk_extended_1")}
</Checkbox>
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/components/dialogs/DialogRemoveMiner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default function DialogRemoveMiner({ isOpen, onClose, pair }: IProps) {
return (
<Dialog
isOpen={isOpen}
usePortal={true}
usePortal
onOpening={handleOnOpening}
title={t("dlg_remove_miner.lbl_title")}
onClose={onClose}
Expand All @@ -134,10 +134,10 @@ export default function DialogRemoveMiner({ isOpen, onClose, pair }: IProps) {
items={data.miners}
itemPredicate={filterMember}
itemRenderer={renderMemberId}
noResults={<MenuItem disabled={true} text={t("dlg_remove_miner.lbl_no_results")} roleStructure="listoption" />}
noResults={<MenuItem disabled text={t("dlg_remove_miner.lbl_no_results")} roleStructure="listoption" />}
onItemSelect={setMember}
popoverProps={{ matchTargetWidth: true }}
fill={true}
fill
>
<Button
text={data.memberToRemove}
Expand Down
4 changes: 2 additions & 2 deletions app/components/dialogs/DialogSendFunds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ export default function DialogSendFunds({ pair, isOpen, onClose, onAfterSubmit }
const addressIcon = isValidPolkadotAddress(data.address) ? <AddressIcon address={data.address} className="m-2" /> : <Icon icon="asterisk" />;

return (
<Dialog isOpen={isOpen} usePortal={true} onOpening={handleOnOpening} onClose={onClose} className="w-[90%] sm:w-[640px]">
<Dialog isOpen={isOpen} usePortal onOpening={handleOnOpening} onClose={onClose} className="w-[90%] sm:w-[640px]">
<div className={`${Classes.DIALOG_BODY} flex flex-col gap-3`}>
<InputGroup
disabled={isLoading}
large={true}
large
className="font-mono"
spellCheck={false}
placeholder={t("dlg_send.lbl_address")}
Expand Down
6 changes: 3 additions & 3 deletions app/components/dialogs/DialogSetPoolDifficulty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function DialogSetPoolDifficulty({ isOpen, onClose, pair }: IProp
return (
<Dialog
isOpen={isOpen}
usePortal={true}
usePortal
onOpening={handleOnOpening}
title={t("dlg_pool_difficulty.lbl_title")}
onClose={onClose}
Expand All @@ -88,8 +88,8 @@ export default function DialogSetPoolDifficulty({ isOpen, onClose, pair }: IProp
<NumericInput
disabled={isLoading}
buttonPosition={"none"}
large={true}
fill={true}
large
fill
placeholder={t("dlg_pool_difficulty.lbl_pool_difficulty")}
onValueChange={handleDifficultyChange}
value={data.difficulty}
Expand Down
2 changes: 1 addition & 1 deletion app/components/dialogs/DialogSetPoolInterest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function DialogSetPoolInterest({ isOpen, onClose, pair }: IProps)
return (
<Dialog
isOpen={isOpen}
usePortal={true}
usePortal
onOpening={handleOnOpening}
title={t("dlg_pool_interest.lbl_title")}
onClose={onClose}
Expand Down
6 changes: 3 additions & 3 deletions app/components/dialogs/DialogSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function DialogSettings({ isOpen, onClose }: IProps) {

return (
<>
<Dialog isOpen={isOpen} usePortal={true} onOpening={handleOnOpening} onClose={onClose} className="w-[90%] sm:w-[640px]">
<Dialog isOpen={isOpen} usePortal onOpening={handleOnOpening} onClose={onClose} className="w-[90%] sm:w-[640px]">
<div className={`${Classes.DIALOG_BODY} flex flex-col gap-3`}>
<TitledValue
title={t("dlg_settings.lbl_api_address")}
Expand All @@ -46,7 +46,7 @@ export default function DialogSettings({ isOpen, onClose }: IProps) {
onChange={(e) => setData((prev) => ({ ...prev, api_endpoint: e.target.value }))}
/>
}
fontMono={true}
fontMono
/>
<TitledValue
title={t("dlg_settings.lbl_explorer_graphql")}
Expand All @@ -57,7 +57,7 @@ export default function DialogSettings({ isOpen, onClose }: IProps) {
onChange={(e) => setData((prev) => ({ ...prev, api_explorer_endpoint: e.target.value }))}
/>
}
fontMono={true}
fontMono
/>
</div>
<div className={Classes.DIALOG_FOOTER}>
Expand Down
2 changes: 1 addition & 1 deletion app/components/dialogs/DialogSignVerify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default function DialogSignAndVerify({ pair, isOpen, onClose }: IProps) {
<Label>
{t("dlg_sign_verify.lbl_placeholder_message")}
<InputGroup
large={true}
large
spellCheck={false}
placeholder={t("dlg_sign_verify.lbl_placeholder_message")}
onChange={handleMessageChange}
Expand Down
2 changes: 1 addition & 1 deletion app/components/dialogs/DialogUnlockAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function DialogUnlockAccount({ pair, isOpen, onClose }: IProps) {
<div className={`${Classes.DIALOG_BODY} flex flex-col gap-3`}>
<InputGroup
type="password"
large={true}
large
className="font-mono"
spellCheck={false}
placeholder={t("commons.lbl_passphrase")}
Expand Down
Loading

0 comments on commit 3d2ad21

Please sign in to comment.