Skip to content

Commit

Permalink
chore: update infinite discovery app entry point (#11530)
Browse files Browse the repository at this point in the history
* chore: add superscript to card

* chore: rename hint to text
  • Loading branch information
MounirDhahri authored Feb 12, 2025
1 parent ffec087 commit f32e41f
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/app/Scenes/HomeView/Sections/HomeViewSectionCard.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { ContextModule, OwnerType } from "@artsy/cohesion"
import {
ArrowRightIcon,
Button,
Flex,
FlexProps,
Skeleton,
SkeletonBox,
Text,
Touchable,
useColor,
useScreenDimensions,
useSpace,
} from "@artsy/palette-mobile"
import { HomeViewSectionCardQuery } from "__generated__/HomeViewSectionCardQuery.graphql"
import { HomeViewSectionCard_section$key } from "__generated__/HomeViewSectionCard_section.graphql"
Expand Down Expand Up @@ -35,6 +38,8 @@ export const HomeViewSectionCard: React.FC<HomeViewSectionCardProps> = ({
...flexProps
}) => {
const tracking = useHomeViewTracking()
const space = useSpace()
const color = useColor()

const { width, height } = useScreenDimensions()
const section = useFragment(HomeViewSectionCardFragment, sectionProp)
Expand All @@ -43,7 +48,7 @@ export const HomeViewSectionCard: React.FC<HomeViewSectionCardProps> = ({
return null
}

const { title, subtitle, image, buttonText: btnText } = section.card
const { title, subtitle, image, buttonText: btnText, badgeText } = section.card

const imageHeight = height * 0.5

Expand Down Expand Up @@ -97,6 +102,19 @@ export const HomeViewSectionCard: React.FC<HomeViewSectionCardProps> = ({
)}

<Flex justifyContent="flex-end" px={2} pb={2} height={hasImage ? imageHeight : undefined}>
{!!badgeText && (
<Flex flexDirection="row" mb={0.5}>
<Text
color="white100"
backgroundColor={color("blue100")}
style={{ paddingHorizontal: space(0.5) }}
variant="xs"
>
{badgeText}
</Text>
</Flex>
)}

<Text variant="lg-display" color={textColor}>
{title}
</Text>
Expand All @@ -114,6 +132,8 @@ export const HomeViewSectionCard: React.FC<HomeViewSectionCardProps> = ({
variant={hasImage ? "outlineLight" : "fillDark"}
size="small"
onPress={onPress}
icon={<ArrowRightIcon fill="white100" height={14} width={14} />}
iconPosition="right"
>
{buttonText}
</Button>
Expand Down Expand Up @@ -141,6 +161,7 @@ const HomeViewSectionCardFragment = graphql`
title
subtitle
href
badgeText
buttonText
image {
imageURL
Expand Down

0 comments on commit f32e41f

Please sign in to comment.