import { Text, View, Box, useBreakpointValue } from "native-base"; import React, { FC, useCallback } from "react"; import { ClaimCardContent } from "../buttons"; import { Image } from "../images"; import Title from "./Title"; import BasePressable from "../buttons/BasePressable"; import { openLink } from "@gooddollar/web3sdk-v2"; interface ClaimCardProps { bgColor: string; title: { text: string; color: string; }; content?: ClaimCardContent[]; externalLink?: string; } const ClaimCard: FC = ({ content = [], title, bgColor, externalLink }) => { const { subTitle, description, imageUrl, imgSrc } = content[0] || []; const handlePress = useCallback(async () => { if (externalLink) { await openLink(externalLink, "_blank"); } }, [externalLink]); const cardStyles = useBreakpointValue({ base: { width: 330, height: 290 }, md: { width: "70%", height: "auto", marginLeft: "auto", marginRight: "auto" }, lg: { width: "100%", height: "auto" }, "2xl": { width: 650, height: "auto" } }); const descHeight = useBreakpointValue({ base: 129, md: "auto" }); return ( {title.text} {!!subTitle && ( {subTitle.text} )} {!!description && ( {description.text} )} {imageUrl || imgSrc ? ( {imageUrl ? ( GoodDollar ) : ( )} ) : null} ); }; export default ClaimCard;