diff --git a/packages/ui/src/ImportScreen.tsx b/packages/ui/src/ImportScreen.tsx index 4f7351b2..c35d04fa 100644 --- a/packages/ui/src/ImportScreen.tsx +++ b/packages/ui/src/ImportScreen.tsx @@ -233,26 +233,21 @@ export default function ImportScreen({
+ + Import Validator Keystore(s) + - - Import Validator Keystore(s) - Upload any keystore JSON file(s). + - {acceptedFiles.length > 1 && ( - <> - - handleSwitchToggle("password")} />} - label="Use same password for every file" - /> - handleSwitchToggle("feerecipient")} />} - label="Use same fee recipient for every file" - /> - handleSwitchToggle("tag")} />} - label="Use same tag for every file" - /> - - {(useSameTag || useSameFeerecipient || useSamePassword) && ( - - {useSamePassword && ( - <> - setPasswords(Array(acceptedFiles.length).fill(e.target.value))} - helperText={"Password to decrypt the keystore(s)"} - /> - - )} - {useSameTag && ( - <> - - Staking protocol - - )} - {useSameFeerecipient && ( - <> - 1 && ( + <> + + handleSwitchToggle("password")} />} + label="Use same password for every file" + /> + handleSwitchToggle("feerecipient")} />} + label="Use same fee recipient for every file" + /> + handleSwitchToggle("tag")} />} + label="Use same tag for every file" + /> + + {(useSameTag || useSameFeerecipient || useSamePassword) && ( + + {useSamePassword && ( + <> + setPasswords(Array(acceptedFiles.length).fill(e.target.value))} + helperText={"Password to decrypt the keystore(s)"} + /> + + )} + {useSameTag && ( + <> + + Staking protocol + + )} + {useSameFeerecipient && ( + <> + { + setFeeRecipients(Array(acceptedFiles.length).fill(e.target.value)); + }} + error={isFeeRecipientFieldWrong(0)} + helperText={getFeeRecipientFieldHelperText(0)} + value={feeRecipients[0]} + disabled={!isFeeRecipientEditable(tags[0])} + /> + {!areAllFeeRecipientsEditable(tags) && !useSameTag && ( + This field will only apply to the editable fee recipients + )} + + )} + + )} + + )} + + {FileCardList( + acceptedFiles, + setAcceptedFiles, + passwords, + setPasswords, + useSamePassword, + tags, + setTags, + useSameTag, + feeRecipients, + setFeeRecipients, + useSameFeerecipient, + getFeeRecipientFieldHelperText, + isFeeRecipientFieldWrong, + tagSelectOptions + )} + + + + Import slashing protection data? (recommended) + + + + {slashingProtectionIncluded ? ( + - - Import slashing protection data? (recommended) - - - - {slashingProtectionIncluded ? ( -
- Upload your slashing protection file to protect your keystore(s). - - - {slashingFile ? ( - Upload your slashing protection file to protect your keystore(s). + + + {slashingFile ? ( + + - - - ✅ {slashingFile.name} -
-
- - -
-
- ) : ( - - )} -
- ) : null} - + + ✅ {slashingFile.name} +
+
+ + + + + ) : ( + + )} + + ) : null} {showMevWarning && ( diff --git a/packages/ui/src/components/Dialogs/EditFeesDialog.tsx b/packages/ui/src/components/Dialogs/EditFeesDialog.tsx index 5b2d3d2f..89a0185d 100644 --- a/packages/ui/src/components/Dialogs/EditFeesDialog.tsx +++ b/packages/ui/src/components/Dialogs/EditFeesDialog.tsx @@ -39,6 +39,7 @@ import { SlideTransition } from "./Transitions"; import { AlertType, NonEcdsaValidatorsData } from "../../types"; import { getSmoothUrlByNetwork, getStakersLink } from "../../params"; import { getSmoothAddressByNetwork } from "../../utils/addresses"; +import { useTheme, useMediaQuery } from "@mui/material"; export default function FeeRecipientDialog({ open, @@ -65,6 +66,8 @@ export default function FeeRecipientDialog({ const [nonEcdsaValidatorsData, setNonEcdsaValidatorsData] = useState([]); const [smoothValidatorsPubkeys, setSmoothValidatorsPubkeys] = useState([]); const [withdrawalAccessCheck, setWithdrawalAccessCheck] = useState(false); + const theme = useTheme(); + const isMobile = useMediaQuery(theme.breakpoints.down("sm")); useEffect(() => { isAnyWithdrawalCredentialsDiff("ecdsa") && getNonEcdsaValidatorsData(); @@ -601,7 +604,8 @@ export default function FeeRecipientDialog({ { if (!reason) { handleClose(); diff --git a/packages/ui/src/components/Dialogs/KeystoresDeleteDialog.tsx b/packages/ui/src/components/Dialogs/KeystoresDeleteDialog.tsx index 39d04d3e..46d71fad 100644 --- a/packages/ui/src/components/Dialogs/KeystoresDeleteDialog.tsx +++ b/packages/ui/src/components/Dialogs/KeystoresDeleteDialog.tsx @@ -19,6 +19,7 @@ import { rpcClient } from "../../socket"; import { SlideTransition } from "./Transitions"; import { getEmoji } from "../../utils/dataUtils"; import type { CustomValidatorGetResponse, Web3signerDeleteResponse } from "@stakingbrain/brain"; +import { useTheme, useMediaQuery } from "@mui/material"; export default function KeystoresDeleteDialog({ rows, @@ -36,6 +37,8 @@ export default function KeystoresDeleteDialog({ const [keystoresDelete, setKeystoresDelete] = useState(); const [keystoresDeleteError, setKeystoresDeleteError] = useState(); const [loading, setLoading] = useState(false); + const theme = useTheme(); + const isMobile = useMediaQuery(theme.breakpoints.down("sm")); async function deleteSelectedKeystores() { try { @@ -62,7 +65,8 @@ export default function KeystoresDeleteDialog({ { if (!reason) { handleClose(); diff --git a/packages/ui/src/components/Dialogs/KeystoresExitDialog.tsx b/packages/ui/src/components/Dialogs/KeystoresExitDialog.tsx index dd2f21ce..7be69ad5 100644 --- a/packages/ui/src/components/Dialogs/KeystoresExitDialog.tsx +++ b/packages/ui/src/components/Dialogs/KeystoresExitDialog.tsx @@ -19,6 +19,7 @@ import { rpcClient } from "../../socket"; import { SlideTransition } from "./Transitions"; import { getEmoji } from "../../utils/dataUtils"; import type { CustomValidatorGetResponse, ValidatorExitExecute } from "@stakingbrain/brain"; +import { useTheme, useMediaQuery } from "@mui/material"; export default function KeystoresExitDialog({ rows, @@ -37,6 +38,8 @@ export default function KeystoresExitDialog({ const [validatorsExitError, setValidatorsExitError] = useState(); const [loading, setLoading] = useState(false); const [userConfirmText, setUserConfirmText] = useState(""); + const theme = useTheme(); + const isMobile = useMediaQuery(theme.breakpoints.down("sm")); const exitConfirmationMessage = "I want to exit"; @@ -89,7 +92,8 @@ export default function KeystoresExitDialog({ { if (!reason) { handleClose(); diff --git a/packages/ui/src/components/StakerConfig/StakerConfig.tsx b/packages/ui/src/components/StakerConfig/StakerConfig.tsx index 53220bd5..7e85f688 100644 --- a/packages/ui/src/components/StakerConfig/StakerConfig.tsx +++ b/packages/ui/src/components/StakerConfig/StakerConfig.tsx @@ -36,10 +36,7 @@ export default function StakerConfig({ stakerConfig }: { stakerConfig: StakerCon > - + {prettyClientDnpName(stakerConfig.executionClient)} @@ -88,7 +85,7 @@ export default function StakerConfig({ stakerConfig }: { stakerConfig: StakerCon alignItems: "center" }} > - + - + {prettyClientDnpName(stakerConfig.consensusClient)} @@ -126,7 +123,7 @@ export default function StakerConfig({ stakerConfig }: { stakerConfig: StakerCon alignItems: "center" }} > - + - Signer + Signer diff --git a/packages/ui/src/components/TopBar/ToolBar.tsx b/packages/ui/src/components/TopBar/ToolBar.tsx index 7c2ebb3c..a6d5a1a3 100644 --- a/packages/ui/src/components/TopBar/ToolBar.tsx +++ b/packages/ui/src/components/TopBar/ToolBar.tsx @@ -1,6 +1,6 @@ import Toolbar from "@mui/material/Toolbar"; import { HeaderTypography } from "../../Styles/Typographies"; -import { Box, Chip } from "@mui/material"; +import { Box, capitalize, Typography } from "@mui/material"; import IconButton from "@mui/material/IconButton"; import LightModeIcon from "@mui/icons-material/LightMode"; import DarkModeIcon from "@mui/icons-material/DarkMode"; @@ -23,23 +23,37 @@ export default function ToolBar({ }): JSX.Element { return ( -
- logo - - {network && ( - <> -    - - - )} -
+ logo + + + + {network && ( + + {capitalize(network)} + + )} + +
} {(network === "hoodi" || network === "mainnet") && } - + {validatorsGetError ? ( {validatorsGetError} @@ -167,7 +162,7 @@ export default function ValidatorList({ There are no keystores to display. )} - +
);