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

Contributors.tsx migrated to Chakra.UI #8695

Merged
merged 6 commits into from
Dec 22, 2022
Merged
Changes from all commits
Commits
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
86 changes: 49 additions & 37 deletions src/components/Contributors.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,11 @@
import React, { useEffect, useState } from "react"
import styled from "@emotion/styled"
import { shuffle } from "lodash"

import ActionCard from "./ActionCard"
import data from "../data/contributors.json"

const Container = styled.div`
display: flex;
flex-wrap: wrap;
`
import { Box, Flex, Image, LinkBox, LinkOverlay, Text } from "@chakra-ui/react"

const ContributorCard = styled(ActionCard)`
max-width: 132px;
margin: 0.5rem;
import data from "../data/contributors.json"

.action-card-image-wrapper {
min-height: 100px;
}
.action-card-image {
width: 132px;
height: 132px;
}
.action-card-content {
padding: 1rem;
h3 {
font-size: ${(props) => props.theme.fontSizes.m};
}
p {
margin-bottom: 0;
}
}
`
import Link from "./Link"

export interface IProps {}

Expand Down Expand Up @@ -59,17 +34,54 @@ const Contributors: React.FC<IProps> = () => {
have contributed so far!
</p>

<Container>
<Flex flexWrap="wrap">
{contributorsList.map((contributor, idx) => (
<ContributorCard
key={idx}
image={contributor.avatar_url}
to={contributor.profile}
title={contributor.name}
alt={contributor.name}
/>
<LinkBox
as="div"
maxWidth="132px"
margin="2"
boxShadow="0px 14px 66px rgba(0, 0, 0, 0.07), 0px 10px 17px rgba(0, 0, 0, 0.03), 0px 4px 7px rgba(0, 0, 0, 0.05)"
_hover={{
textDecoration: "none",
borderRadius: "base",
boxShadow: "0px 8px 17px rgba(0, 0, 0, 0.15)",
background: "tableBackgroundHover",
transition: "transform 0.1s",
transform: "scale(1.02)",
}}
_focus={{
textDecoration: "none",
borderRadius: "base",
boxShadow: "0px 8px 17px rgba(0, 0, 0, 0.15)",
background: "tableBackgroundHover",
transition: "transform 0.1s",
transform: "scale(1.02)",
}}
>
<Image
width="132px"
height="132px"
src={contributor.avatar_url}
alt={contributor.name}
/>
<Box padding="1rem">
<Text as="h3" fontSize="md" marginTop="2" marginBottom="4">
<LinkOverlay
as={Link}
href={contributor.profile}
hideArrow
color="text"
textDecoration="none"
_hover={{ textDecoration: "none" }}
isExternal={true}
>
{contributor.name}
</LinkOverlay>
</Text>
</Box>
</LinkBox>
))}
</Container>
</Flex>
</>
)
}
Expand Down