Commit 0526882e authored by tom's avatar tom

enhance network menu skeleton

parent ebb7808d
import { PopoverContent, PopoverBody, Text, Tabs, TabList, TabPanels, TabPanel, Tab, VStack, Skeleton, Flex } from '@chakra-ui/react'; import { PopoverContent, PopoverBody, Text, Tabs, TabList, TabPanels, TabPanel, Tab, VStack, Skeleton, Flex, useColorModeValue } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import type { FeaturedNetwork, NetworkGroup } from 'types/networks'; import type { FeaturedNetwork, NetworkGroup } from 'types/networks';
...@@ -13,12 +13,15 @@ interface Props { ...@@ -13,12 +13,15 @@ interface Props {
const NetworkMenuPopup = ({ items, tabs }: Props) => { const NetworkMenuPopup = ({ items, tabs }: Props) => {
const selectedNetwork = items?.find(({ isActive }) => isActive); const selectedNetwork = items?.find(({ isActive }) => isActive);
const selectedTab = tabs.findIndex((tab) => selectedNetwork?.group === tab); const selectedTab = tabs.findIndex((tab) => selectedNetwork?.group === tab);
const bgColor = useColorModeValue('blackAlpha.50', 'whiteAlpha.50');
const content = !items || items.length === 0 ? ( const content = !items || items.length === 0 ? (
<> <>
<Skeleton h="30px" w="120px"/> <Skeleton h="30px" w="120px"/>
<Flex mt={ 4 } alignItems="center"> <Flex mt={ 4 } alignItems="center">
<Skeleton h="40px" w="105px"/> <Flex h="40px" w="105px" bgColor={ bgColor } borderRadius="base" px={ 4 } py={ 2 }>
<Skeleton h="24px" w="100%"/>
</Flex>
<Skeleton h="24px" w="68px" mx={ 4 }/> <Skeleton h="24px" w="68px" mx={ 4 }/>
<Skeleton h="24px" w="45px" mx={ 4 }/> <Skeleton h="24px" w="45px" mx={ 4 }/>
</Flex> </Flex>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment