Commit 240f9d9b authored by Max Alekseenko's avatar Max Alekseenko Committed by GitHub

Merge pull request #2106 from blockscout/lock-marketplace-action-bar

Lock marketplace action bar at the top of the page
parents 035256aa 1ad4f2f6
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
<path d="M15.713 20a.724.724 0 0 1-.354-.09L10 16.956 4.64 19.91a.728.728 0 0 1-.796-.061.788.788 0 0 1-.256-.342.827.827 0 0 1-.045-.432l1.024-6.252L.229 8.394a.802.802 0 0 1-.207-.377.829.829 0 0 1 .015-.435.795.795 0 0 1 .232-.361.741.741 0 0 1 .379-.179L6.64 6.13 9.321.442a.78.78 0 0 1 .28-.323.731.731 0 0 1 .798 0 .78.78 0 0 1 .28.323l2.68 5.688 5.993.912a.74.74 0 0 1 .379.178c.108.096.188.22.232.361a.828.828 0 0 1-.192.813l-4.338 4.428 1.024 6.252a.83.83 0 0 1-.167.644.762.762 0 0 1-.26.208.728.728 0 0 1-.319.074h.002Z" fill="currentColor"/> <path d="M15.713 20a.724.724 0 0 1-.354-.09L10 16.956 4.64 19.91a.728.728 0 0 1-.796-.061.788.788 0 0 1-.256-.342.827.827 0 0 1-.045-.432l1.024-6.252L.229 8.394a.802.802 0 0 1-.207-.377.829.829 0 0 1 .015-.435.795.795 0 0 1 .232-.361.741.741 0 0 1 .379-.179L6.64 6.13 9.321.442a.78.78 0 0 1 .28-.323.731.731 0 0 1 .798 0 .78.78 0 0 1 .28.323l2.68 5.688 5.993.912a.74.74 0 0 1 .379.178.8.8 0 0 1 .232.361.828.828 0 0 1-.192.813l-4.338 4.428 1.024 6.252a.83.83 0 0 1-.167.644.762.762 0 0 1-.26.208.728.728 0 0 1-.319.074h.002Z" fill="currentColor"/>
</svg> </svg>
...@@ -64,7 +64,8 @@ const FeaturedApp = ({ ...@@ -64,7 +64,8 @@ const FeaturedApp = ({
height="136px" height="136px"
padding={ 5 } padding={ 5 }
background={ backgroundColor } background={ backgroundColor }
mb={ 6 } mb={ 2 }
mt={ 6 }
> >
<Skeleton <Skeleton
isLoaded={ !isLoading } isLoaded={ !isLoading }
......
...@@ -42,7 +42,7 @@ const FeaturedAppMobile = ({ ...@@ -42,7 +42,7 @@ 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 } mt={ 6 }
> >
<Flex <Flex
flexDirection="row" flexDirection="row"
......
...@@ -21,7 +21,8 @@ const IframeBanner = ({ contentUrl, linkUrl }: { contentUrl: string; linkUrl: st ...@@ -21,7 +21,8 @@ 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 }}
mt={ 6 }
overflow="hidden" overflow="hidden"
> >
<Link <Link
......
...@@ -51,6 +51,7 @@ const MarketplaceList = ({ ...@@ -51,6 +51,7 @@ const MarketplaceList = ({
}} }}
autoRows="1fr" autoRows="1fr"
gap={{ base: '16px', md: '24px' }} gap={{ base: '16px', md: '24px' }}
marginTop={{ base: 0, lg: 3 }}
> >
{ apps.slice(0, renderedItemsNum).map((app, index) => ( { apps.slice(0, renderedItemsNum).map((app, index) => (
<MarketplaceAppCard <MarketplaceAppCard
......
import { Box } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import { apps as appsMock } from 'mocks/apps/apps'; import { apps as appsMock } from 'mocks/apps/apps';
...@@ -62,7 +63,15 @@ test.describe('mobile', () => { ...@@ -62,7 +63,15 @@ test.describe('mobile', () => {
test.use({ viewport: devices['iPhone 13 Pro'].viewport }); test.use({ viewport: devices['iPhone 13 Pro'].viewport });
test('base view', async({ render }) => { test('base view', async({ render }) => {
const component = await render(<Marketplace/>); const component = await render(
<Box>
{ /* Added a fake header because without the ActionBar works incorrectly without it */ }
<Box h="100px" backgroundColor="#dbdbdb" p={ 1 }>
Header
</Box>
<Marketplace/>
</Box>,
);
await expect(component).toHaveScreenshot(); await expect(component).toHaveScreenshot();
}); });
......
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';
...@@ -140,6 +141,7 @@ const Marketplace = () => { ...@@ -140,6 +141,7 @@ const Marketplace = () => {
<> <>
<PageTitle <PageTitle
title="DAppscout" title="DAppscout"
mb={ 2 }
contentAfter={ (isMobile && links.length > 1) ? ( contentAfter={ (isMobile && links.length > 1) ? (
<Menu> <Menu>
<MenuButton <MenuButton
...@@ -181,7 +183,15 @@ const Marketplace = () => { ...@@ -181,7 +183,15 @@ const Marketplace = () => {
onAppClick={ handleAppClick } onAppClick={ handleAppClick }
/> />
<Box marginTop={{ base: 0, lg: 8 }}> <ActionBar
showShadow
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 }
...@@ -189,26 +199,26 @@ const Marketplace = () => { ...@@ -189,26 +199,26 @@ const Marketplace = () => {
marginBottom={ -2 } marginBottom={ -2 }
isLoading={ isCategoriesPlaceholderData } isLoading={ isCategoriesPlaceholderData }
/> />
</Box>
<Flex mb={{ base: 4, lg: 6 }} gap={{ base: 2, lg: 3 }}> <Flex 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 }
......
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