-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d4f688
commit 56fa77b
Showing
7 changed files
with
309 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 125 additions & 0 deletions
125
packages/logos-docusaurus-theme/src/client/components/mdx/ProfileCards/ProfileCards.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} | ||
} |
98 changes: 98 additions & 0 deletions
98
packages/logos-docusaurus-theme/src/client/components/mdx/ProfileCards/ProfileCards.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
) | ||
} |
1 change: 1 addition & 0 deletions
1
packages/logos-docusaurus-theme/src/client/components/mdx/ProfileCards/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ProfileCards' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/logos-docusaurus-theme/src/client/static/icons/avatar.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.