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