From f3b1e9ea84746cfe910d24f399796d6440b5458d Mon Sep 17 00:00:00 2001 From: ismailToyran Date: Wed, 27 Sep 2023 17:32:51 +0300 Subject: [PATCH 1/2] Section card improvement --- components/HomeSection/Resources.tsx | 3 +++ components/HomeSection/SectionCard.tsx | 22 +++++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/components/HomeSection/Resources.tsx b/components/HomeSection/Resources.tsx index bff44229..4c0fa0f4 100644 --- a/components/HomeSection/Resources.tsx +++ b/components/HomeSection/Resources.tsx @@ -37,8 +37,11 @@ const ResourcesHomeSection: FC = () => { href={item.href} isExternal={item.isExternal} image={item.image} + // imageRatio={16 / 9} title={item.title} + // titleIsTruncated={false} description={item.description} + // descriptionIsTruncated={true} /> )} title={t('home.resources')} diff --git a/components/HomeSection/SectionCard.tsx b/components/HomeSection/SectionCard.tsx index 66d13520..75b70bb9 100644 --- a/components/HomeSection/SectionCard.tsx +++ b/components/HomeSection/SectionCard.tsx @@ -1,22 +1,28 @@ -import { Box, Flex, Heading, Text } from '@chakra-ui/react' +import { AspectRatio, Box, Flex, Heading, Text } from '@chakra-ui/react' import { FC } from 'react' import Image from '../Image/Image' import Link from '../Link/Link' export type Props = { description?: string + descriptionIsTruncated?: boolean href: string isExternal?: boolean image?: string + imageRatio?: number title: string + titleIsTruncated?: boolean } const HomeSectionCard: FC = ({ description, + descriptionIsTruncated, href, isExternal, image, + imageRatio, title, + titleIsTruncated, }) => { return ( @@ -26,9 +32,10 @@ const HomeSectionCard: FC = ({ borderColor="gray.200" shadow="sm" w="full" + h="full" overflow="hidden" > - + {image ? ( = ({ ) : ( )} - + = ({ p={4} gap={1} > - + {title} {description && ( @@ -59,7 +71,7 @@ const HomeSectionCard: FC = ({ variant="subtitle2" color="gray.500" title={description} - noOfLines={2} + noOfLines={descriptionIsTruncated ? 2 : undefined} > {description} From 8be2f86b4c02f80997f07588d580a28bba1136a1 Mon Sep 17 00:00:00 2001 From: Nicolas Mahe Date: Fri, 29 Sep 2023 16:15:59 +0700 Subject: [PATCH 2/2] remove sales and bids from FetchCollectionAssets query --- pages/collection/[chainId]/[id].gql | 36 ----------------------------- 1 file changed, 36 deletions(-) diff --git a/pages/collection/[chainId]/[id].gql b/pages/collection/[chainId]/[id].gql index bb948ab0..1f540cc4 100644 --- a/pages/collection/[chainId]/[id].gql +++ b/pages/collection/[chainId]/[id].gql @@ -168,42 +168,6 @@ query FetchCollectionAssets( } } } - sales( - first: 1 - orderBy: [UNIT_PRICE_IN_REF_ASC, CREATED_AT_ASC] - filter: { expiredAt: { greaterThan: $now } } # This filter should also be applied to the root query if sorting by sales. See getExtraFilterForSort function in utils/post/sorting.ts - ) { - nodes { - id - unitPrice - currency { - id - image - symbol - decimals - } - maker { - address - } - } - } - bids( - first: 1 - orderBy: [UNIT_PRICE_IN_REF_ASC, CREATED_AT_ASC] - filter: { expiredAt: { greaterThan: $now } } # This filter should also be applied to the root query if sorting on by bids - ) { - nodes { - id - unitPrice - amount - currency { - image - id - decimals - symbol - } - } - } } } }