Skip to content

Commit

Permalink
feat: add profile cards components
Browse files Browse the repository at this point in the history
  • Loading branch information
jinhojang6 committed Oct 5, 2023
1 parent 5d4f688 commit 56fa77b
Show file tree
Hide file tree
Showing 7 changed files with 309 additions and 3 deletions.
73 changes: 70 additions & 3 deletions packages/docusaurus-playground/src/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
Showcase,
HeroInfo,
Box,
ProfileCards,
} from '../components/mdx'

<Hero size="large">
Expand Down Expand Up @@ -81,13 +82,79 @@ import {

<Box top={{ xs: 144, lg: 216 }}>
<CallToActionSection
title="Contributors"
title="Team"
columns={1}
description="The contributors building Codex draw on decades of collective software development experience with household names from within the traditional technology and blockchain sectors."
label="Read more"
description="Codex is powering the data storage layer of the Logos Network State. Logos is a grassroots movement to provide trust-minimized, corruption-resistant governing services and social institutions to peaceful people worldwide. Learn more about our ambitious vision."
label="Explore Logos"
href="/about/team"
target="_self"
/>
<ProfileCards
items={[
{
name: 'Jeremy',
githubUsername: 'jeremyjeremyjeremy',
githubLink: 'https://github.com/acid-info',
discordUsername: 'jeremyjeremyjeremy#0001',
discordLink: 'https://discord.gg/2NXGrsqmDq',
},
{
name: 'Dimitriy',
imgSrc:
'https://statusim.bamboohr.com/employees/photos/?h=297aeedfad6fed82ed60a93a9d850762',
githubUsername: 'dimitriy',
githubLink: 'https://github.com/acid-info',
discordUsername: 'dimitriy#0001',
discordLink: 'https://discord.gg/2NXGrsqmDq',
},
{
name: 'Slava',
imgSrc:
'https://statusim.bamboohr.com/employees/photos/?h=c9028ddcd6da2b7b0aaaf6fabbad7b31',
githubUsername: 'slava',
githubLink: 'https://discord.gg/2NXGrsqmDq',
},
{
name: 'Eric',
imgSrc:
'https://statusim.bamboohr.com/employees/photos/?h=a620c567ee3da938757bb0a43eda4ec9',
discordUsername: 'eric#0001',
discordLink: 'https://discord.gg/2NXGrsqmDq',
},
{
name: 'Tomas',
imgSrc:
'https://statusim.bamboohr.com/employees/photos/?h=8f6066f7e4b7517702c86d85f3ad828d',
},
{
name: 'Adam',
imgSrc:
'https://statusim.bamboohr.com/employees/photos/?h=5edf032c2d62576d36090cf09b5939e5',
githubUsername: 'adam',
githubLink: 'https://github.com/acid-info',
discordUsername: 'adam#0001',
discordLink: 'https://discord.gg/2NXGrsqmDq',
},
{
name: 'Ben',
imgSrc:
'https://statusim.bamboohr.com/employees/photos/?h=406fd339da77e69aeef5f357ece3ff3d',
githubUsername: 'ben',
githubLink: 'https://github.com/acid-info',
discordUsername: 'ben#0001',
discordLink: 'https://discord.gg/2NXGrsqmDq',
},
{
name: 'Leo',
imgSrc:
'https://statusim.bamboohr.com/employees/photos/?h=4d6fcc7c245ca327414ab4d282b509f2',
githubUsername: 'leo',
githubLink: 'https://github.com/acid-info',
discordUsername: 'leo#0001',
discordLink: 'https://discord.gg/2NXGrsqmDq',
},
]}
/>
</Box>

<Box top={{ xs: 144, lg: 216 }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import TwitterSvg from '../../static/icons/twitter.svg'
import DiscordWhiteSvg from '../../static/icons/discord-white.svg'
import TelegramWhiteSvg from '../../static/icons/telegram-white.svg'
import XSvg from '../../static/icons/x.svg'
import Avatar from '../../static/icons/avatar.svg'

type TIconProps = {
size?: 's' | 'm' | 'l'
Expand Down Expand Up @@ -220,3 +221,9 @@ export const IconX = (props: TIconProps): JSX.Element => (
<XSvg />
</Icon>
)

export const IconAvatar = (props: TIconProps): JSX.Element => (
<Icon {...props}>
<Avatar />
</Icon>
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
@use '../../../css/utils';
@use '../../../css/lsd';

:root {
--card-height: 188px;
--mobile-width: 253px;
--mobile-height: 176px;
}

.mdx-profile-cards {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 1rem;
margin-block: 80px;
}

.mdx-profile-card__card {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
padding: 1rem;
border: 1px solid rgb(var(--lsd-border-primary));
height: var(--card-height);
}

.mdx-profile-card__profile {
display: flex;
flex-direction: column;
gap: 20px;
}

.mdx-profile-card__avatar {
width: 40px !important;
height: 40px !important;
border-radius: 50%;

svg {
width: 40px !important;
height: 40px !important;

rect {
fill: unset !important;
}
}
}

.mdx-profile-card__name {
@include lsd.typography('h4');
}

.mdx-profile-card__buttons {
display: flex;
flex-direction: row;
gap: 8px;
width: 100%;
}

.mdx-profile-card__link {
text-decoration: none;
height: fit-content;
position: relative;
max-width: calc(50% - 4px);
}

.mdx-profile-card__button {
padding: 4px 12px 4px 10px !important;
height: 28px !important;
max-width: 100% !important;

> span {
display: flex;
gap: 12px;
align-items: center;
}

svg {
width: 14px;
height: 14px;
}
}

.mdx-profile-card__link__label {
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}

.mdx-profile-card__label {
text-align: center;
}

@include utils.responsive('lg', 'down') {
.mdx-profile-card {
grid-template-columns: 1fr;
}
}

@include utils.responsive('md', 'down') {
.mdx-profile-cards {
display: flex;
flex-wrap: nowrap;
overflow-x: scroll;
overflow-y: hidden;
gap: 1rem;
scroll-snap-type: x mandatory;
margin-block: 40px;
}

.mdx-profile-card__card {
flex: 0 0 var(--mobile-width);
width: var(--mobile-width);
height: var(--mobile-height);
scroll-snap-align: start !important;
}

.mdx-profile-card__profile {
gap: 16px;
}

.mdx-profile-card__name {
@include lsd.typography('h6');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import { Button, Typography } from '@acid-info/lsd-react'
import React from 'react'
import './ProfileCards.scss'
import { IconAvatar, IconDiscordWhite, IconGithub } from '../../Icon' // '@logos-theme/components/Icon' doesn't work
import Link from '@docusaurus/Link'

export type ProfileCardItem = {
imgSrc?: string
name?: string
githubUsername?: string
githubLink?: string
discordUsername?: string
discordLink?: string
}

export type ProfileCardsProps = React.HTMLProps<HTMLDivElement> & {
items?: ProfileCardItem[]
}

export const ProfileCards: React.FC<ProfileCardsProps> = ({
items = [],
...props
}) => {
return (
<div className="mdx-profile-cards hidden-scrollbar" {...props}>
{items.map((item, index) => {
return (
<div key={index} className="mdx-profile-card__card">
<div className="mdx-profile-card__profile">
{typeof item.imgSrc === 'undefined' ? (
<IconAvatar className="mdx-profile-card__avatar" />
) : (
<img
alt={typeof item.name === 'string' ? item.name : ''}
className="mdx-profile-card__avatar"
src={item.imgSrc}
/>
)}
<Typography
className="mdx-profile-card__name"
variant="h4"
component="h4"
>
{item.name}
</Typography>
</div>

<div className="mdx-profile-card__buttons">
{item?.githubUsername && item?.githubLink && (
<Link
href={item.githubLink}
target="_blank"
className={'mdx-profile-card__link'}
>
<Button
size={'small'}
variant={'outlined'}
className={'mdx-profile-card__button'}
>
<IconGithub />
<Typography
variant="body2"
className="mdx-profile-card__link__label"
>
{item?.githubUsername}
</Typography>
</Button>
</Link>
)}

{item?.discordUsername && item?.discordLink && (
<Link
href={item.discordLink}
target="_blank"
className={'mdx-profile-card__link'}
>
<Button
size={'small'}
variant={'outlined'}
className={'mdx-profile-card__button'}
>
<IconDiscordWhite />
<Typography
variant="body2"
className="mdx-profile-card__link__label"
>
{item?.discordUsername}
</Typography>
</Button>
</Link>
)}
</div>
</div>
)
})}
</div>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './ProfileCards'
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ export * from './ScrollToBottom'
export * from './Showcase'
export * from './Roadmap'
export * from './HeroVideo'
export * from './ProfileCards'
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 56fa77b

Please sign in to comment.