From 93bd61db3a7e3300434256bada0f2de3b86099e9 Mon Sep 17 00:00:00 2001 From: Inokentii Mazhara Date: Tue, 17 Sep 2024 12:35:34 +0300 Subject: [PATCH] TW-1543 Apply design updates --- public/_locales/en/messages.json | 4 ++-- public/_locales/en_GB/messages.json | 4 ++-- .../select-with-modal/select-modal-option.tsx | 4 +++- .../components/select-with-modal/select-modal.tsx | 15 ++++++++++----- src/lib/popup-mode/index.ts | 2 +- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 7efd29bbba..1c0069e6ec 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -1983,10 +1983,10 @@ } }, "popupSettings": { - "message": "Popup mode" + "message": "Pop-up mode" }, "popupSettingsDescription": { - "message": "Here you can configure the popup which appears on plugin's icon click in extensions panel." + "message": "Here you can configure the pop-up which appears on plugin's icon click in extensions panel." }, "analyticsSettings": { "message": "Anonymous Analytics" diff --git a/public/_locales/en_GB/messages.json b/public/_locales/en_GB/messages.json index cb7642df55..bbd923bd80 100644 --- a/public/_locales/en_GB/messages.json +++ b/public/_locales/en_GB/messages.json @@ -1359,10 +1359,10 @@ } }, "popupSettings": { - "message": "Popup mode" + "message": "Pop-up mode" }, "popupSettingsDescription": { - "message": "Here you can configure the popup which appears on plugin's icon click in extensions panel." + "message": "Here you can configure the pop-up which appears on plugin's icon click in extensions panel." }, "referredByTokenContractNotFound": { "message": "Contract $address$, which is referred by token contract to, was not found.", diff --git a/src/app/templates/SettingsGeneral/components/select-with-modal/select-modal-option.tsx b/src/app/templates/SettingsGeneral/components/select-with-modal/select-modal-option.tsx index d67a424c80..6639e2a073 100644 --- a/src/app/templates/SettingsGeneral/components/select-with-modal/select-modal-option.tsx +++ b/src/app/templates/SettingsGeneral/components/select-with-modal/select-modal-option.tsx @@ -12,6 +12,7 @@ export interface CellPartProps { export interface SelectModalOptionProps { option: T; + className?: string; isSelected: boolean; CellIcon: ComponentType>; CellName: ComponentType>; @@ -22,6 +23,7 @@ export interface SelectModalOptionProps { // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint export const SelectModalOption = ({ option, + className, isSelected, CellIcon, CellName, @@ -31,7 +33,7 @@ export const SelectModalOption = ({ const handleClick = useCallback(() => onSelect(option), [onSelect, option]); return ( - + } diff --git a/src/app/templates/SettingsGeneral/components/select-with-modal/select-modal.tsx b/src/app/templates/SettingsGeneral/components/select-with-modal/select-modal.tsx index a674e6b3d5..b84daffd36 100644 --- a/src/app/templates/SettingsGeneral/components/select-with-modal/select-modal.tsx +++ b/src/app/templates/SettingsGeneral/components/select-with-modal/select-modal.tsx @@ -1,7 +1,10 @@ import React, { useMemo, useState } from 'react'; +import clsx from 'clsx'; + import { EmptyState } from 'app/atoms/EmptyState'; import { PageModal } from 'app/atoms/PageModal'; +import { ScrollView } from 'app/atoms/PageModal/scroll-view'; import { SearchBarField } from 'app/templates/SearchField'; import { t } from 'lib/i18n'; import { searchAndFilterItems } from 'lib/utils/search-items'; @@ -36,6 +39,7 @@ export const SelectModal = >({ itemTestID }: SelectModalProps) => { const [searchValue, setSearchValue] = useState(''); + const [topEdgeIsVisible, setTopEdgeIsVisible] = useState(true); const filteredOptions = useMemo( () => searchAndFilterItems(options, searchValue, searchKeys, searchPrepare, searchThreshold), @@ -44,15 +48,16 @@ export const SelectModal = >({ return ( -
- +
+
-
+ {filteredOptions.length === 0 && } - {filteredOptions.map(option => ( + {filteredOptions.map((option, index) => ( + className={index === 0 ? 'mt-1' : ''} key={keyFn(option)} option={option} isSelected={keyFn(option) === keyFn(value)} @@ -62,7 +67,7 @@ export const SelectModal = >({ testID={itemTestID} /> ))} -
+ ); }; diff --git a/src/lib/popup-mode/index.ts b/src/lib/popup-mode/index.ts index 058077eb0a..c4860a5f04 100644 --- a/src/lib/popup-mode/index.ts +++ b/src/lib/popup-mode/index.ts @@ -1,5 +1,5 @@ const POPUP_MODE_STORAGE_KEY = 'popup_mode'; -const DEFAULT_POPUP_MODE = true; +const DEFAULT_POPUP_MODE = false; export function setPopupMode(enabled: boolean) { localStorage.setItem(POPUP_MODE_STORAGE_KEY, String(enabled));