From fbb0dae0003e8bb8d6627d9a4e5576e6df49c77c Mon Sep 17 00:00:00 2001 From: SeanM322 Date: Thu, 18 Jul 2024 17:25:27 +0300 Subject: [PATCH 1/2] syncing is disabled in server settings --- .../src/components/Dropdown/Dropdown.tsx | 80 ++++++++++--------- rair-front/src/components/Dropdown/index.ts | 1 + .../GlobalModal/FilterModal/FilterModal.tsx | 47 +++++------ .../PaginationBox/PaginationBox.tsx | 5 -- rair-front/src/utils/blockchainData.ts | 2 +- 5 files changed, 64 insertions(+), 71 deletions(-) diff --git a/rair-front/src/components/Dropdown/Dropdown.tsx b/rair-front/src/components/Dropdown/Dropdown.tsx index 9bdcfd395..6e3e7ddcf 100644 --- a/rair-front/src/components/Dropdown/Dropdown.tsx +++ b/rair-front/src/components/Dropdown/Dropdown.tsx @@ -18,50 +18,52 @@ const Dropdown = ({ const isChecked = !!selectedOptions?.find( (selectedOption) => selectedOption?.optionId === option.optionId ); - return ( -
  • - {option?.dropDownImg && ( -
    - + {option?.dropDownImg && ( +
    + blockchain-img +
    + )} + {dropdownIMG} +
    + + {option.name} + +
    - )} - {dropdownIMG} -
    - - {option.name} - - -
    -
  • - ); + + ); + } })} diff --git a/rair-front/src/components/Dropdown/index.ts b/rair-front/src/components/Dropdown/index.ts index 3bdf86f9c..d52d58c02 100644 --- a/rair-front/src/components/Dropdown/index.ts +++ b/rair-front/src/components/Dropdown/index.ts @@ -4,6 +4,7 @@ export type TOption = { clicked?: boolean; dropDownImg?: boolean; optionId?: number; + display?: boolean; }; export type TDropdownProps = { options: Array; diff --git a/rair-front/src/components/GlobalModal/FilterModal/FilterModal.tsx b/rair-front/src/components/GlobalModal/FilterModal/FilterModal.tsx index 134ace8f8..eb071318b 100644 --- a/rair-front/src/components/GlobalModal/FilterModal/FilterModal.tsx +++ b/rair-front/src/components/GlobalModal/FilterModal/FilterModal.tsx @@ -38,6 +38,7 @@ import Dropdown from '../../Dropdown/Dropdown'; import { closeModal, openModal } from '../helpers/OnOpenModal'; import './styles.css'; +import useServerSettings from '../../adminViews/useServerSettings'; export type THomePageFilterModalProps = { isMobileDesign?: boolean; className?: stirng; @@ -56,32 +57,9 @@ const HomePageFilterModal: FC = ({ }; }); - // const categories = [ - // { - // name: 'Music', - // clicked: false, - // optionId: 7, - // categoryId: '62b459f9a64260001c1e205e' - // }, - // { - // name: 'Art', - // clicked: false, - // optionId: 8, - // categoryId: '62b459f9a64260001c1e205f' - // }, - // { - // name: 'Conference', - // clicked: false, - // optionId: 9, - // categoryId: '62b459f9a64260001c1e2060' - // }, - // { - // name: 'Science', - // clicked: false, - // optionId: 10, - // categoryId: '62b459f9a64260001c1e2061' - // } - // ]; + const serverSettings = useServerSettings(); + + const [blockchainsArray, setBlockchainsArray] = useState(undefined); const [categories, setCategories] = useState([]); const { globalModalState, globalModaldispatch } = @@ -163,6 +141,23 @@ const HomePageFilterModal: FC = ({ } }, [selectedBchItems, setFilterText, setIsShow]); + useEffect(() => { + if(serverSettings.blockchainSettings) { + const filteredblockchainSettings = serverSettings.blockchainSettings.filter((el) => { + if(Object.keys(blockchainData).includes(el.hash)) { + return el; + } + }).map((item) => { + const itemBlockchain = blockchains.find(element => element.chainId === item.hash); + return { + ...itemBlockchain, + display: item.sync + } + }) + setBlockchainsArray(filteredblockchainSettings); + } + }, [serverSettings.blockchainSettings]); + useEffect(() => { if (selectedCatItems) { setSelectedCategories(selectedCatItems); diff --git a/rair-front/src/components/MockUpPage/PaginationBox/PaginationBox.tsx b/rair-front/src/components/MockUpPage/PaginationBox/PaginationBox.tsx index 081e3bd7b..61dde88e5 100644 --- a/rair-front/src/components/MockUpPage/PaginationBox/PaginationBox.tsx +++ b/rair-front/src/components/MockUpPage/PaginationBox/PaginationBox.tsx @@ -18,9 +18,6 @@ const PaginationBox: React.FC = ({ (store) => store.nftDataStore.itemsPerPage ); - console.info(totalPageForPagination, 'totalPageForPagination'); - console.info(itemsPerPageNotifications, 'itemsPerPageNotifications') - const { primaryColor, primaryButtonColor } = useSelector< RootState, ColorStoreType @@ -30,8 +27,6 @@ const PaginationBox: React.FC = ({ const [totalPage, setTotalPages] = useState(); const [totalPageVideo, setTotalPagesVideo] = useState(); - console.info(totalPage, 'totalPage') - // const hotdropsVar = import.meta.env.VITE_TESTNET; const pagesArray: number[] = []; diff --git a/rair-front/src/utils/blockchainData.ts b/rair-front/src/utils/blockchainData.ts index c80b55c67..4b298098d 100644 --- a/rair-front/src/utils/blockchainData.ts +++ b/rair-front/src/utils/blockchainData.ts @@ -172,7 +172,7 @@ const chainData: TChainData = { image: BaseLogo, name: 'Base Mainnet', chainId: '0x2105', - symbol: 'ETH', + symbol: 'bETH', addChainData: { chainId: '0x2105', chainName: 'Base', From b6e10fb499322015da965780aa49f71ea7750555 Mon Sep 17 00:00:00 2001 From: SeanM322 Date: Mon, 22 Jul 2024 11:43:18 +0300 Subject: [PATCH 2/2] Dropdown uses another state --- .../src/components/GlobalModal/FilterModal/FilterModal.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rair-front/src/components/GlobalModal/FilterModal/FilterModal.tsx b/rair-front/src/components/GlobalModal/FilterModal/FilterModal.tsx index eb071318b..511f6e83c 100644 --- a/rair-front/src/components/GlobalModal/FilterModal/FilterModal.tsx +++ b/rair-front/src/components/GlobalModal/FilterModal/FilterModal.tsx @@ -558,13 +558,13 @@ const HomePageFilterModal: FC = ({ primaryColor={primaryColor} /> }> - + />}