diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2024-06-14 11:41:11 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2024-06-18 15:04:34 +0200 |
| commit | 59f21bba30b22a627d77184275a67a4d09daed23 (patch) | |
| tree | 0868fe15307d38ca85aec5a1369f33d4e680ff95 /gui/src/renderer/components | |
| parent | 454df7dd6b0ff70c5eb63da5745e39e2b5c5897e (diff) | |
| download | mullvadvpn-59f21bba30b22a627d77184275a67a4d09daed23.tar.xz mullvadvpn-59f21bba30b22a627d77184275a67a4d09daed23.zip | |
Fix eslint errors
All changes in this commit were produced by running `npm run lint --
--fix`.
Diffstat (limited to 'gui/src/renderer/components')
12 files changed, 31 insertions, 38 deletions
diff --git a/gui/src/renderer/components/CustomDnsSettings.tsx b/gui/src/renderer/components/CustomDnsSettings.tsx index 6b8024c9e2..35acb88a6c 100644 --- a/gui/src/renderer/components/CustomDnsSettings.tsx +++ b/gui/src/renderer/components/CustomDnsSettings.tsx @@ -325,10 +325,10 @@ function CellListItem(props: ICellListItemProps) { const inputContainerRef = useStyledRef<HTMLDivElement>(); - const onRemove = useCallback(() => props.onRemove(props.children), [ - props.onRemove, - props.children, - ]); + const onRemove = useCallback( + () => props.onRemove(props.children), + [props.onRemove, props.children], + ); const onSubmit = useCallback( async (value: string) => { diff --git a/gui/src/renderer/components/EditApiAccessMethod.tsx b/gui/src/renderer/components/EditApiAccessMethod.tsx index 2c53842543..97996d7f42 100644 --- a/gui/src/renderer/components/EditApiAccessMethod.tsx +++ b/gui/src/renderer/components/EditApiAccessMethod.tsx @@ -146,8 +146,8 @@ function TestingDialog(props: TestingDialogProps) { const type = props.testing ? ModalAlertType.loading : props.testResult - ? ModalAlertType.success - : ModalAlertType.failure; + ? ModalAlertType.success + : ModalAlertType.failure; const prevType = useRef<ModalAlertType>(type); const isOpen = props.testing || props.testResult !== undefined; diff --git a/gui/src/renderer/components/ExpiredAccountErrorView.tsx b/gui/src/renderer/components/ExpiredAccountErrorView.tsx index 3049ba8075..2784f64cd2 100644 --- a/gui/src/renderer/components/ExpiredAccountErrorView.tsx +++ b/gui/src/renderer/components/ExpiredAccountErrorView.tsx @@ -215,10 +215,8 @@ function ExternalPaymentButton() { } function BlockWhenDisconnectedAlert() { - const { - showBlockWhenDisconnectedAlert, - setShowBlockWhenDisconnectedAlert, - } = useExpiredAccountContext(); + const { showBlockWhenDisconnectedAlert, setShowBlockWhenDisconnectedAlert } = + useExpiredAccountContext(); const { setBlockWhenDisconnected } = useAppContext(); const blockWhenDisconnected = useSelector((state) => state.settings.blockWhenDisconnected); diff --git a/gui/src/renderer/components/HeaderBar.tsx b/gui/src/renderer/components/HeaderBar.tsx index 98502a6346..d0f2bde6ef 100644 --- a/gui/src/renderer/components/HeaderBar.tsx +++ b/gui/src/renderer/components/HeaderBar.tsx @@ -121,8 +121,8 @@ function HeaderBarDeviceInfo() { const formattedExpiry = isOutOfTime ? sprintf(messages.ngettext('1 day', '%d days', 0), 0) : accountExpiry - ? formatRemainingTime(accountExpiry) - : ''; + ? formatRemainingTime(accountExpiry) + : ''; return ( <StyledAccountInfo> diff --git a/gui/src/renderer/components/NotificationArea.tsx b/gui/src/renderer/components/NotificationArea.tsx index 79c234f71f..ebd87b58b7 100644 --- a/gui/src/renderer/components/NotificationArea.tsx +++ b/gui/src/renderer/components/NotificationArea.tsx @@ -208,9 +208,7 @@ function NotificationActionWrapper(props: INotificationActionWrapperProps) { <ModalMessage>{troubleshootInfo?.details}</ModalMessage> <ModalMessage> <ModalMessageList> - {troubleshootInfo?.steps.map((step) => ( - <li key={step}>{step}</li> - ))} + {troubleshootInfo?.steps.map((step) => <li key={step}>{step}</li>)} </ModalMessageList> </ModalMessage> <ModalMessage> diff --git a/gui/src/renderer/components/Settings.tsx b/gui/src/renderer/components/Settings.tsx index 34fb3eb0c1..211679a76c 100644 --- a/gui/src/renderer/components/Settings.tsx +++ b/gui/src/renderer/components/Settings.tsx @@ -166,10 +166,10 @@ function AppVersionButton() { const isOffline = useSelector((state) => state.connection.isBlocked); const { openUrl } = useAppContext(); - const openDownloadLink = useCallback(() => openUrl(getDownloadUrl(suggestedIsBeta)), [ - openUrl, - suggestedIsBeta, - ]); + const openDownloadLink = useCallback( + () => openUrl(getDownloadUrl(suggestedIsBeta)), + [openUrl, suggestedIsBeta], + ); let icon; let footer; diff --git a/gui/src/renderer/components/SettingsImport.tsx b/gui/src/renderer/components/SettingsImport.tsx index 3f3cc5dd1f..d93064ff2e 100644 --- a/gui/src/renderer/components/SettingsImport.tsx +++ b/gui/src/renderer/components/SettingsImport.tsx @@ -55,9 +55,8 @@ export default function SettingsImport() { showOpenDialog, getPathBaseName, } = useAppContext(); - const { clearSettingsImportForm, unsetSubmitSettingsImportForm } = useActions( - settingsImportActions, - ); + const { clearSettingsImportForm, unsetSubmitSettingsImportForm } = + useActions(settingsImportActions); // Status of the text form which is used to for example submit it. const textForm = useSelector((state) => state.settingsImport); diff --git a/gui/src/renderer/components/TransitionContainer.tsx b/gui/src/renderer/components/TransitionContainer.tsx index 3e7007e3c8..1df9b097c5 100644 --- a/gui/src/renderer/components/TransitionContainer.tsx +++ b/gui/src/renderer/components/TransitionContainer.tsx @@ -98,8 +98,10 @@ export default class TransitionContainer extends React.Component<IProps, IState> private isCycling = false; private isTransitioning = false; - private currentContentRef: React.MutableRefObject<HTMLDivElement | null> = React.createRef<HTMLDivElement>(); - private nextContentRef: React.MutableRefObject<HTMLDivElement | null> = React.createRef<HTMLDivElement>(); + private currentContentRef: React.MutableRefObject<HTMLDivElement | null> = + React.createRef<HTMLDivElement>(); + private nextContentRef: React.MutableRefObject<HTMLDivElement | null> = + React.createRef<HTMLDivElement>(); // The item that should trigger the cycle to finish in onTransitionEnd private transitioningItemRef?: React.RefObject<HTMLDivElement>; diff --git a/gui/src/renderer/components/VpnSettings.tsx b/gui/src/renderer/components/VpnSettings.tsx index 395d1ba183..951b17a567 100644 --- a/gui/src/renderer/components/VpnSettings.tsx +++ b/gui/src/renderer/components/VpnSettings.tsx @@ -588,9 +588,8 @@ function LockdownMode() { const blockWhenDisconnected = useSelector((state) => state.settings.blockWhenDisconnected); const { setBlockWhenDisconnected: setBlockWhenDisconnectedImpl } = useAppContext(); - const [confirmationDialogVisible, showConfirmationDialog, hideConfirmationDialog] = useBoolean( - false, - ); + const [confirmationDialogVisible, showConfirmationDialog, hideConfirmationDialog] = + useBoolean(false); const setBlockWhenDisconnected = useCallback( async (blockWhenDisconnected: boolean) => { diff --git a/gui/src/renderer/components/cell/CellButton.tsx b/gui/src/renderer/components/cell/CellButton.tsx index b0079226f3..cc7a6e1015 100644 --- a/gui/src/renderer/components/cell/CellButton.tsx +++ b/gui/src/renderer/components/cell/CellButton.tsx @@ -16,8 +16,8 @@ const StyledCellButton = styled(Row)<IStyledCellButtonProps>((props) => { const backgroundColor = props.$selected ? colors.green : props.$containedInSection - ? colors.blue40 - : colors.blue; + ? colors.blue40 + : colors.blue; const backgroundColorHover = props.$selected ? colors.green : colors.blue80; return { diff --git a/gui/src/renderer/components/select-location/CustomLists.tsx b/gui/src/renderer/components/select-location/CustomLists.tsx index ca4638360c..eafcb161b2 100644 --- a/gui/src/renderer/components/select-location/CustomLists.tsx +++ b/gui/src/renderer/components/select-location/CustomLists.tsx @@ -57,9 +57,10 @@ const StyledSideButtonIcon = styled(Cell.Icon)({ backgroundColor: colors.white40, }, - [`${StyledCellButton}:not(:disabled):hover &&, ${StyledAddListCellButton}:not(:disabled):hover &&`]: { - backgroundColor: colors.white, - }, + [`${StyledCellButton}:not(:disabled):hover &&, ${StyledAddListCellButton}:not(:disabled):hover &&`]: + { + backgroundColor: colors.white, + }, }); const StyledInput = styled(SimpleInput)<{ $error: boolean }>((props) => ({ diff --git a/gui/src/renderer/components/select-location/SelectLocation.tsx b/gui/src/renderer/components/select-location/SelectLocation.tsx index 3f3535225e..f6cf772019 100644 --- a/gui/src/renderer/components/select-location/SelectLocation.tsx +++ b/gui/src/renderer/components/select-location/SelectLocation.tsx @@ -58,12 +58,8 @@ import { export default function SelectLocation() { const history = useHistory(); const relaySettingsUpdater = useRelaySettingsUpdater(); - const { - saveScrollPosition, - resetScrollPositions, - scrollViewRef, - spacePreAllocationViewRef, - } = useScrollPositionContext(); + const { saveScrollPosition, resetScrollPositions, scrollViewRef, spacePreAllocationViewRef } = + useScrollPositionContext(); const { locationType, setLocationType, setSearchTerm } = useSelectLocationContext(); const { expandSearchResults } = useRelayListContext(); |
