Commit b5e35553 authored by Yuri Mikhin's avatar Yuri Mikhin Committed by Yuri Mikhin

Micro fixes to the marketplace.

parent 165787db
...@@ -28,7 +28,6 @@ const AppCard = ({ id, ...@@ -28,7 +28,6 @@ const AppCard = ({ id,
isFavorite, isFavorite,
onFavoriteClick, onFavoriteClick,
}: Props) => { }: Props) => {
const categoriesLabel = categories.map(c => APP_CATEGORIES[c]).filter(notEmpty).join(', '); const categoriesLabel = categories.map(c => APP_CATEGORIES[c]).filter(notEmpty).join(', ');
const handleInfoClick = useCallback((event: MouseEvent) => { const handleInfoClick = useCallback((event: MouseEvent) => {
...@@ -55,6 +54,7 @@ const AppCard = ({ id, ...@@ -55,6 +54,7 @@ const AppCard = ({ id,
padding={{ base: 3, sm: '20px' }} padding={{ base: 3, sm: '20px' }}
border="1px" border="1px"
borderColor={ useColorModeValue('gray.200', 'gray.600') } borderColor={ useColorModeValue('gray.200', 'gray.600') }
role="group"
> >
<Box <Box
display={{ base: 'grid', sm: 'block' }} display={{ base: 'grid', sm: 'block' }}
...@@ -71,6 +71,7 @@ const AppCard = ({ id, ...@@ -71,6 +71,7 @@ const AppCard = ({ id,
h={{ base: '64px', sm: '96px' }} h={{ base: '64px', sm: '96px' }}
> >
<Image <Image
borderRadius={ 8 }
src={ logo } src={ logo }
alt={ `${ title } app icon` } alt={ `${ title } app icon` }
/> />
...@@ -133,9 +134,11 @@ const AppCard = ({ id, ...@@ -133,9 +134,11 @@ const AppCard = ({ id,
</Box> </Box>
<IconButton <IconButton
display={{ base: 'block', sm: isFavorite ? 'block' : 'none' }}
_groupHover={{ display: 'block' }}
position="absolute" position="absolute"
right={{ base: 3, sm: '20px' }} right={{ base: 3, sm: '10px' }}
top={{ base: 3, sm: '20px' }} top={{ base: 3, sm: '14px' }}
aria-label="Mark as favorite" aria-label="Mark as favorite"
title="Mark as favorite" title="Mark as favorite"
variant="ghost" variant="ghost"
......
...@@ -28,7 +28,7 @@ const AppList = ({ apps, onAppClick, displayedAppId, onModalClose, favoriteApps, ...@@ -28,7 +28,7 @@ const AppList = ({ apps, onAppClick, displayedAppId, onModalClose, favoriteApps,
{ apps.length > 0 ? ( { apps.length > 0 ? (
<Grid <Grid
templateColumns={{ templateColumns={{
sm: 'repeat(auto-fill, minmax(170px, 1fr))', sm: 'repeat(auto-fill, minmax(178px, 1fr))',
lg: 'repeat(auto-fill, minmax(260px, 1fr))', lg: 'repeat(auto-fill, minmax(260px, 1fr))',
}} }}
autoRows="1fr" autoRows="1fr"
......
...@@ -100,9 +100,6 @@ const AppModal = ({ ...@@ -100,9 +100,6 @@ const AppModal = ({
fontWeight="medium" fontWeight="medium"
lineHeight={ 1 } lineHeight={ 1 }
color="blue.600" color="blue.600"
whiteSpace="nowrap"
overflow="hidden"
textOverflow="ellipsis"
> >
{ title } { title }
</Heading> </Heading>
......
...@@ -37,7 +37,7 @@ const CategoriesMenu = ({ selectedCategoryId, onSelect }: Props) => { ...@@ -37,7 +37,7 @@ const CategoriesMenu = ({ selectedCategoryId, onSelect }: Props) => {
display="flex" display="flex"
alignItems="center" alignItems="center"
> >
{ selectedCategory ? selectedCategory.name : 'All' } { selectedCategory?.name }
<Icon transform="rotate(-90deg)" ml={{ base: 'auto', sm: 1 }} as={ eastMiniArrowIcon } w={ 5 } h={ 5 }/> <Icon transform="rotate(-90deg)" ml={{ base: 'auto', sm: 1 }} as={ eastMiniArrowIcon } w={ 5 } h={ 5 }/>
</Box> </Box>
</MenuButton> </MenuButton>
......
import { MenuItem } from '@chakra-ui/react'; import { Icon, MenuItem } from '@chakra-ui/react';
import type { FunctionComponent, SVGAttributes } from 'react';
import React, { useCallback } from 'react'; import React, { useCallback } from 'react';
import type { MarketplaceCategoriesIds } from 'types/client/apps'; import type { MarketplaceCategoriesIds } from 'types/client/apps';
import starFilledIcon from 'icons/star_filled.svg';
type Props = { type Props = {
id: MarketplaceCategoriesIds; id: MarketplaceCategoriesIds;
name: string; name: string;
onClick: (category: MarketplaceCategoriesIds) => void; onClick: (category: MarketplaceCategoriesIds) => void;
} }
const ICONS = {
favorites: starFilledIcon,
} as { [key in MarketplaceCategoriesIds]: FunctionComponent<SVGAttributes<SVGElement>> };
const CategoriesMenuItem = ({ id, name, onClick }: Props) => { const CategoriesMenuItem = ({ id, name, onClick }: Props) => {
const handleSelection = useCallback(() => { const handleSelection = useCallback(() => {
onClick(id); onClick(id);
...@@ -18,7 +25,13 @@ const CategoriesMenuItem = ({ id, name, onClick }: Props) => { ...@@ -18,7 +25,13 @@ const CategoriesMenuItem = ({ id, name, onClick }: Props) => {
<MenuItem <MenuItem
key={ id } key={ id }
onClick={ handleSelection } onClick={ handleSelection }
display="flex"
alignItems="center"
> >
{ id in ICONS && (
<Icon mr={ 3 } as={ ICONS[id] } w={ 4 } h={ 4 } color="blackAlpha.800"/>
) }
{ name } { name }
</MenuItem> </MenuItem>
); );
......
import type { MarketplaceCategoriesIds } from 'types/client/apps'; import type { MarketplaceCategoriesIds } from 'types/client/apps';
export const APP_CATEGORIES: {[key in MarketplaceCategoriesIds]: string} = { export const APP_CATEGORIES: {[key in MarketplaceCategoriesIds]: string} = {
all: 'All',
favorites: 'Favorites', favorites: 'Favorites',
all: 'All apps',
defi: 'DeFi', defi: 'DeFi',
exchanges: 'Exchanges', exchanges: 'Exchanges',
finance: 'Finance', finance: 'Finance',
......
...@@ -4,6 +4,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'; ...@@ -4,6 +4,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react';
import type { AppItemOverview } from 'types/client/apps'; import type { AppItemOverview } from 'types/client/apps';
import useNetwork from 'lib/hooks/useNetwork'; import useNetwork from 'lib/hooks/useNetwork';
import ContentLoader from 'ui/shared/ContentLoader';
import Page from 'ui/shared/Page/Page'; import Page from 'ui/shared/Page/Page';
type Props = { type Props = {
...@@ -40,12 +41,7 @@ const MarketplaceApp = ({ app, isLoading }: Props) => { ...@@ -40,12 +41,7 @@ const MarketplaceApp = ({ app, isLoading }: Props) => {
paddingTop={{ base: '138px', lg: 0 }} paddingTop={{ base: '138px', lg: 0 }}
> >
{ (isFrameLoading) && ( { (isFrameLoading) && (
<Center <ContentLoader/>
h="100%"
w="100%"
>
Loading...
</Center>
) } ) }
{ app && ( { app && (
......
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