mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* UI customizations: new features Fixes #2905 * colors for graphs * introduce env variable * colors for topbar, stats, selected state and tabs * fix build * fix validator * refactor link.primary.hover color token * refactor selected colors * update styles for switch and fix some color tokens * change color for selectable controls * icon color tokens refactoring * UI customizations: new features Fixes #2905 * test for common components * tweaks * migrate from color-mode-hex cookie to color-theme cookie * clean up * update screenshots * more screenshot updates * update default color of chart line * update envs for mega eth
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { Box, HStack, Flex } from '@chakra-ui/react';
|
|
import React from 'react';
|
|
|
|
import { Skeleton } from 'toolkit/chakra/skeleton';
|
|
import CopyToClipboard from 'ui/shared/CopyToClipboard';
|
|
import IconSvg from 'ui/shared/IconSvg';
|
|
|
|
interface Props {
|
|
apiKey: string;
|
|
name: string;
|
|
isLoading?: boolean;
|
|
}
|
|
|
|
const ApiKeySnippet = ({ apiKey, name, isLoading }: Props) => {
|
|
return (
|
|
<HStack gap={ 2 } alignItems="start">
|
|
<IconSvg name="key" boxSize={ 6 } color="icon.primary" isLoading={ isLoading }/>
|
|
<Box>
|
|
<Flex alignItems={{ base: 'flex-start', lg: 'center' }}>
|
|
<Skeleton loading={ isLoading } display="inline-block" fontWeight={ 600 } mr={ 1 }>
|
|
<span>{ apiKey }</span>
|
|
</Skeleton>
|
|
<CopyToClipboard text={ apiKey } isLoading={ isLoading }/>
|
|
</Flex>
|
|
{ name && (
|
|
<Skeleton loading={ isLoading } display="inline-block" fontSize="sm" color="text.secondary" mt={ 1 }>
|
|
<span>{ name }</span>
|
|
</Skeleton>
|
|
) }
|
|
</Box>
|
|
</HStack>
|
|
);
|
|
};
|
|
|
|
export default React.memo(ApiKeySnippet);
|