Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Landing page's card components #369

Merged
merged 43 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
32b5b79
Implement `IconCard` component
kpyszkowski Apr 17, 2024
8df74db
Merge branch 'landing-page' into landing-cards
kpyszkowski Apr 18, 2024
99c7abd
Add IconCard with key icon
kpyszkowski Apr 18, 2024
9358883
Update values to rem units
kpyszkowski Apr 18, 2024
f1644e2
Implement `ValueCard` component
kpyszkowski Apr 18, 2024
2bc02c4
Extract TVL card into separate component
kpyszkowski Apr 18, 2024
55cfc58
Add ContentCard component
kpyszkowski Apr 18, 2024
25a0d69
Rename component, fix missing keys
kpyszkowski Apr 18, 2024
36bb9e6
Implement `CardButton` component
kpyszkowski Apr 18, 2024
3c77258
Apply minor styling adjustments
kpyszkowski Apr 18, 2024
2f02355
Fix typo
kpyszkowski Apr 18, 2024
c6249b5
Refactor styles, update copies in cards
kpyszkowski Apr 19, 2024
36af881
Replace partner logos with SVGs, adjusted sizing
kpyszkowski Apr 19, 2024
127b14e
Merge branch 'landing-page' into landing-cards
kpyszkowski Apr 19, 2024
f1a4860
Merge branch 'landing-page' into landing-cards
kpyszkowski Apr 22, 2024
9fc1beb
Adjust `IconCard` responsive variant
kpyszkowski Apr 22, 2024
eb6b37e
Update `IconCard` icons, adjust styling
kpyszkowski Apr 23, 2024
81afaea
Reuse `ButtonLink` in `CardButton` component
kpyszkowski Apr 25, 2024
d08fc7a
Move partner logos to contants
kpyszkowski Apr 25, 2024
07eda72
Reorder props in `IconCard` component
kpyszkowski Apr 25, 2024
8487f97
Reuse `CurrencyBalance` component
kpyszkowski Apr 25, 2024
d99f126
Remove body prop from `IconCard` component
kpyszkowski Apr 25, 2024
b46a423
Merge branch 'landing-page' into landing-cards
kpyszkowski Apr 25, 2024
7340e46
Resolve ESLint error
kpyszkowski Apr 25, 2024
8942ba1
Define styles as props
kpyszkowski Apr 25, 2024
f2f52cd
Add TODO comment
kpyszkowski Apr 25, 2024
1043664
Remove `<br />` elements
kpyszkowski May 3, 2024
6a4e709
Adjust `IconCard` responsive styles
kpyszkowski May 3, 2024
49bf329
Refactor `Card` theme parts definition
kpyszkowski May 3, 2024
c1493b3
Add missing key while iterating over array
kpyszkowski May 3, 2024
93c22b6
Fix typo
kpyszkowski May 3, 2024
630db96
Refactor `TVLCard` component styles
kpyszkowski May 3, 2024
1b8eab9
Refactor partner logos export
kpyszkowski May 3, 2024
ffadd29
Fix typo
kpyszkowski May 3, 2024
49390ae
Rename component
kpyszkowski May 3, 2024
20659d0
Remove use of `CardFooter` component
kpyszkowski May 6, 2024
b978176
Rename component
kpyszkowski May 6, 2024
d68cb55
Use `TextMd` instead of `Text`
kpyszkowski May 6, 2024
1184455
Remove `value` property
kpyszkowski May 6, 2024
8ca3a0d
Hide unused/not ready cards
kpyszkowski May 6, 2024
b16913a
Merge branch 'landing-page' into landing-cards
kpyszkowski May 6, 2024
23e903b
Add cards wrapper padding for smaller viewports
kpyszkowski May 6, 2024
8cd2590
Merge branch 'landing-page' into landing-cards
kkosiorowska May 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ioay marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dapp/src/assets/images/card-icon-key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dapp/src/assets/images/card-value-decorator.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dapp/src/assets/images/content-card-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dapp/src/assets/images/partner-logos/base-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dapp/src/assets/images/partner-logos/ledger-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dapp/src/assets/images/partner-logos/threshold-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dapp/src/assets/images/partner-logos/wormhole-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions dapp/src/constants/externalHref.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const EXTERNAL_HREF = {
// TODO: Add a correct link
DISCORD: "https://discord.com/",
DOCS: "",
FAQ: "",
kpyszkowski marked this conversation as resolved.
Show resolved Hide resolved
}
27 changes: 27 additions & 0 deletions dapp/src/pages/LandingPage/CardButton.tsx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this name is right. What I mean is that the name CardButton is very generic. I have a feeling that it might be a bit confusing and someone might import it by mistake. It seems to me that we should change the name and be more descriptive here. However, I don't have an idea for a name. 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it's a button that looks like a card
Pretty much descriptive for me 😆
Ain't got any other idea tbh

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right. This button uses the card variant. The only thing this component does is add some additional styles. The name CardButton used here makes it look like a shared component. That's why I'm thinking about changing the name or maybe moving it to shared components. At the moment we don't have a style guide so it's difficult to make decisions. So we can leave it as is and then update it later. Just flagging the issue.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from "react"
import { Link, Button, ButtonProps, LinkProps, Icon } from "@chakra-ui/react"
import { IconArrowUpRight } from "@tabler/icons-react"

type CardButtonProps = ButtonProps & Pick<LinkProps, "isExternal" | "href">

export default function CardButton(props: CardButtonProps) {
const { children, isExternal, ...restProps } = props
return (
<Button
as={Link}
variant="card"
isExternal={isExternal}
{...restProps}
_hover={{ bg: "gold.100" }}
leftIcon={
isExternal ? (
<Icon as={IconArrowUpRight} color="brand.400" w={4} h={4} />
) : undefined
}
iconSpacing={1}
fontWeight="semibold"
>
{children}
</Button>
ioay marked this conversation as resolved.
Show resolved Hide resolved
)
}
18 changes: 18 additions & 0 deletions dapp/src/pages/LandingPage/ContentCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react"
import { Card, CardBody, CardHeader, CardProps } from "@chakra-ui/react"

export type ContentCardProps = CardProps & {
header: React.ReactNode
withBackground?: boolean
}

export default function ContentCard(props: ContentCardProps) {
const { header, children, ...restProps } = props

return (
<Card variant="content" {...restProps}>
<CardHeader>{header}</CardHeader>
<CardBody>{children}</CardBody>
</Card>
)
}
30 changes: 30 additions & 0 deletions dapp/src/pages/LandingPage/IconCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from "react"
import {
Card,
CardBody,
CardFooter,
CardHeader,
CardProps,
Image,
ImageProps,
} from "@chakra-ui/react"

type IconCardProps = CardProps & {
header: React.ReactNode
body: React.ReactNode
icon: ImageProps
}

export default function IconCard(props: IconCardProps) {
const { header, body, icon, ...restProps } = props

return (
<Card variant="icon" {...restProps}>
<CardHeader>{header}</CardHeader>
<CardBody>{body}</CardBody>
<CardFooter>
<Image pointerEvents="none" {...icon} />
</CardFooter>
</Card>
)
}
22 changes: 22 additions & 0 deletions dapp/src/pages/LandingPage/TVLCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react"
import { Text } from "@chakra-ui/react"
import ValueCard from "./ValueCard"

export default function TVLCard() {
return (
<ValueCard
header="Total value locked"
value="2,202.92 BTC"
kkosiorowska marked this conversation as resolved.
Show resolved Hide resolved
color="brand.400"
footer={[
<ValueCard.FooterItem>
<Text as="span" color="green.400" mr={2}>
+2%
</Text>
+24h
</ValueCard.FooterItem>,
<ValueCard.FooterItem>USD 27,202,964.47</ValueCard.FooterItem>,
kkosiorowska marked this conversation as resolved.
Show resolved Hide resolved
]}
/>
)
}
Loading
Loading