Commit 6e328915 authored by Max Alekseenko's avatar Max Alekseenko

lock marketplace action bar at the top of the page

parent 6000e9cd
......@@ -38,6 +38,7 @@ const semanticTokens = {
},
shadows: {
action_bar: '0 4px 4px -4px rgb(0 0 0 / 10%), 0 2px 4px -4px rgb(0 0 0 / 6%)',
action_bar_large: '0 30px 25px -25px rgb(0 0 0 / 10%), 0 15px 10px -25px rgb(0 0 0 / 4%)',
},
};
......
......@@ -64,7 +64,7 @@ const FeaturedApp = ({
height="136px"
padding={ 5 }
background={ backgroundColor }
mb={ 6 }
mb={ 2 }
>
<Skeleton
isLoaded={ !isLoading }
......
......@@ -43,7 +43,6 @@ const FeaturedAppMobile = ({
padding={{ base: 3, sm: '20px' }}
role="group"
background={ useColorModeValue('purple.50', 'whiteAlpha.100') }
mb={ 4 }
>
<Flex
flexDirection="row"
......
......@@ -21,7 +21,7 @@ const IframeBanner = ({ contentUrl, linkUrl }: { contentUrl: string; linkUrl: st
h="136px"
w="100%"
borderRadius="md"
mb={{ base: 4, sm: 6 }}
mb={{ base: 0, sm: 2 }}
overflow="hidden"
>
<Link
......
......@@ -38,6 +38,7 @@ const MarketplaceList = ({ apps, showAppInfo, favoriteApps, onFavoriteClick, isL
}}
autoRows="1fr"
gap={{ base: '16px', md: '24px' }}
marginTop={{ base: 0, lg: 3 }}
>
{ apps.map((app, index) => (
<MarketplaceAppCard
......
import { Box, MenuButton, MenuItem, MenuList, Flex, IconButton } from '@chakra-ui/react';
import { MenuButton, MenuItem, MenuList, Flex, IconButton } from '@chakra-ui/react';
import React from 'react';
import type { MouseEvent } from 'react';
......@@ -14,6 +14,7 @@ import MarketplaceAppModal from 'ui/marketplace/MarketplaceAppModal';
import MarketplaceDisclaimerModal from 'ui/marketplace/MarketplaceDisclaimerModal';
import MarketplaceList from 'ui/marketplace/MarketplaceList';
import { SORT_OPTIONS } from 'ui/marketplace/utils';
import ActionBar from 'ui/shared/ActionBar';
import Menu from 'ui/shared/chakra/Menu';
import FilterInput from 'ui/shared/filters/FilterInput';
import IconSvg from 'ui/shared/IconSvg';
......@@ -176,7 +177,16 @@ const Marketplace = () => {
onAppClick={ handleAppClick }
/>
<Box marginTop={{ base: 0, lg: 8 }}>
<ActionBar
showShadow
isLargeShadow
display="flex"
flexDirection="column"
mx={{ base: -3, lg: -12 }}
px={{ base: 3, lg: 12 }}
pt={{ base: 4, lg: 6 }}
pb={{ base: 4, lg: 3 }}
>
<TabsWithScroll
tabs={ categoryTabs }
onTabChange={ handleCategoryChange }
......@@ -184,26 +194,26 @@ const Marketplace = () => {
marginBottom={ -2 }
isLoading={ isCategoriesPlaceholderData }
/>
</Box>
<Flex mb={{ base: 4, lg: 6 }} gap={{ base: 2, lg: 3 }}>
{ feature.securityReportsUrl && (
<Sort
name="dapps_sorting"
options={ SORT_OPTIONS }
onChange={ setSorting }
<Flex gap={{ base: 2, lg: 3 }}>
{ feature.securityReportsUrl && (
<Sort
name="dapps_sorting"
options={ SORT_OPTIONS }
onChange={ setSorting }
isLoading={ isPlaceholderData }
/>
) }
<FilterInput
initialValue={ filterQuery }
onChange={ onSearchInputChange }
placeholder="Find app by name or keyword..."
isLoading={ isPlaceholderData }
size={ feature.securityReportsUrl ? 'xs' : 'sm' }
w={{ base: '100%', lg: '350px' }}
/>
) }
<FilterInput
initialValue={ filterQuery }
onChange={ onSearchInputChange }
placeholder="Find app by name or keyword..."
isLoading={ isPlaceholderData }
size={ feature.securityReportsUrl ? 'xs' : 'sm' }
w={{ base: '100%', lg: '350px' }}
/>
</Flex>
</Flex>
</ActionBar>
<MarketplaceList
apps={ displayedApps }
......
......@@ -8,6 +8,7 @@ type Props = {
children: React.ReactNode;
className?: string;
showShadow?: boolean;
isLargeShadow?: boolean;
}
const TOP_UP = 106;
......@@ -15,12 +16,14 @@ const TOP_DOWN = 0;
export const ACTION_BAR_HEIGHT_DESKTOP = 24 + 32 + 12;
export const ACTION_BAR_HEIGHT_MOBILE = 24 + 32 + 24;
const ActionBar = ({ children, className, showShadow }: Props) => {
const ActionBar = ({ children, className, showShadow, isLargeShadow }: Props) => {
const ref = React.useRef<HTMLDivElement>(null);
const scrollDirection = useScrollDirection();
const isSticky = useIsSticky(ref, TOP_UP + 5);
const bgColor = useColorModeValue('white', 'black');
const shadow = isLargeShadow ? 'action_bar_large' : 'action_bar';
if (!React.Children.toArray(children).filter(Boolean).length) {
return null;
}
......@@ -42,7 +45,7 @@ const ActionBar = ({ children, className, showShadow }: Props) => {
zIndex={{ base: 'sticky2', lg: 'docked' }}
boxShadow={{
base: isSticky ? 'md' : 'none',
lg: isSticky && showShadow ? 'action_bar' : 'none',
lg: isSticky && showShadow ? shadow : 'none',
}}
ref={ ref }
>
......
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