Skip to content

Commit

Permalink
Merge branch 'dev' into feature/drops
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailToyran committed Oct 2, 2023
2 parents 25ccef2 + 3ef367d commit 4207a36
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 41 deletions.
3 changes: 3 additions & 0 deletions components/HomeSection/Resources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ const ResourcesHomeSection: FC<Props> = () => {
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')}
Expand Down
22 changes: 17 additions & 5 deletions components/HomeSection/SectionCard.tsx
Original file line number Diff line number Diff line change
@@ -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<Props> = ({
description,
descriptionIsTruncated,
href,
isExternal,
image,
imageRatio,
title,
titleIsTruncated,
}) => {
return (
<Link href={href} isExternal={isExternal} w="full">
Expand All @@ -26,9 +32,10 @@ const HomeSectionCard: FC<Props> = ({
borderColor="gray.200"
shadow="sm"
w="full"
h="full"
overflow="hidden"
>
<Box position="relative" height="7.5rem">
<AspectRatio ratio={imageRatio || 16 / 9}>
{image ? (
<Image
src={image}
Expand All @@ -43,23 +50,28 @@ const HomeSectionCard: FC<Props> = ({
) : (
<Box bg="gray.200" height="full" />
)}
</Box>
</AspectRatio>
<Flex
direction="column"
justify="center"
overflow="hidden"
p={4}
gap={1}
>
<Heading as="h3" variant="heading2" title={title} isTruncated>
<Heading
as="h3"
variant="heading2"
title={title}
isTruncated={titleIsTruncated ? true : false}
>
{title}
</Heading>
{description && (
<Text
variant="subtitle2"
color="gray.500"
title={description}
noOfLines={2}
noOfLines={descriptionIsTruncated ? 2 : undefined}
>
{description}
</Text>
Expand Down
36 changes: 0 additions & 36 deletions pages/collection/[chainId]/[id]/index.gql
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}
}
}

0 comments on commit 4207a36

Please sign in to comment.