Files
js/components/homepage/CaseStudyCard.tsx
T
480ef20905 New landing (#113)
* New header

* GeneralCta wip

* Add right image

* Mobile fixes

* Prettify

* Update static gradient

* Add union

* Add dashboard section

* Add supported chains section

* Add free section

* Finish merge

* Fix stuff

* Add case studies section

* Gradients shananigans

* Fix borders

* Use ChakraNextImage

* Add Partners

* Fix lgtm

* Fix lgtm 2.0

* Change position

* Add footer and newsletter

* Delete old components

* Add contracts section

* Add get started section (kinda)

* Add union

* no union

* Fix spacing

* Fix copy

* Spacing and stuff

* Add sdk section

* Language selector for SDK section

* Add LinkButton

* Unused imports

* Update Link imports

* Update embed width

* Set active status

* Set active status

* Fix button width

* Add links to case studies

* Add links to partners

* Fix spacing

* Fix react warning

* Fix title/subtitle center issues

* Fix broken link

* Delete start building from menu

* Fix buttons on mobile

* Update images

* Update text

* Add external icon to tw-link

* Make icon a one-off

* Add hover

* small improvements, also make landing page way leaner in terms of size

* iframe a bit better again

* Add tracking everywhere

* Add tracking to CodeSelector

* clean up a bunch of small things everywhere

* doing more things more better

* Clean up, fix textAlign

* Fix lgtm

* Fix leftAlign

* Fix graphic centerAligned

* Fix cta padding

* Change CTA hover behavior

* Button adjustments

* LeftAlign?

* Change header bg with blur

* Fix icon size

* cleanup homepage section (#121)

* cleanup homepage section

* cleanup case-sudy stuff

* thirdweb deploy new design

* Rename union to bottomPattern

* Fix gap on mobile

* Update copy

* Footer isExternal

* Make TrackedLink generic and reuse it

* Fix mobile layout

* Update dashboard section

* Add opacity bg

* Update ContractCard

* Spacing and mobile hero image

* Fix aria-label_

* Fix pre-built contracts

* Latest changes

* Use tracked components

* Small renaming

* add examples scection, update lots of copy

* cheating lol

* nit pick

* Add github urls to example items

* homepage copy & random other fixes

* new multi chain graphic

* Fix typo

* Developer portal -> Docs

* Small fixes

* More small fixes

* Fix subscribe

* iPad fixes

* No italics anymore

* Multichain mobile svg

* Delete unused component

* changes

* Replace png with svg

Co-authored-by: Jonas Daniels <[email protected]>
Co-authored-by: Jarrod Watts <[email protected]>
2022-05-17 16:36:59 -07:00

87 lines
2.0 KiB
TypeScript

import { Box, Flex } from "@chakra-ui/react";
import { ChakraNextImage } from "components/Image";
import { useTrack } from "hooks/analytics/useTrack";
import * as React from "react";
import { Link, Text } from "tw-components";
interface CaseStudyCardProps {
title: string;
description: string;
href: string;
}
export const CaseStudyCard: React.FC<CaseStudyCardProps> = ({
title,
description,
href,
}) => {
const { trackEvent } = useTrack();
return (
<Link
href={href}
isExternal
onClick={() =>
trackEvent({
category: "case-study",
action: "click",
label: title,
})
}
>
<Flex
flexDir="column"
borderRadius="2xl"
overflow="hidden"
position="relative"
h={96}
role="group"
>
<ChakraNextImage
alt=""
w="100%"
h="100%"
src={require(`/public/assets/case-studies/${title}.png`)}
objectFit="cover"
layout="fill"
/>
<Box
position="absolute"
top={0}
bottom={0}
left={0}
right={0}
bg="#000"
opacity={0}
willChange="opacity"
transition="opacity 0.1s"
_groupHover={{
opacity: 0.3,
}}
/>
<Box p={6} position="absolute" top="0" left="0">
<ChakraNextImage
alt=""
w={title === "yestheory" ? 16 : 32}
placeholder="empty"
src={require(`/public/assets/case-studies/${title}-logo.png`)}
/>
</Box>
<Box
bgGradient="linear(rgba(0,0,0,.0) 0%,rgba(0,0,0,.5) 25%, rgba(0,0,0,.9) 100%)"
backdropFilter="blur(10px)"
p={6}
borderBottomRadius="2xl"
position="absolute"
bottom="-1px"
left="0"
right="0"
>
<Text size="body.xl" color="white">
{description}
</Text>
</Box>
</Flex>
</Link>
);
};