Skip to content

Commit

Permalink
Resolves team page for Docusaurus. Closes #4587
Browse files Browse the repository at this point in the history
  • Loading branch information
milanholemans committed Apr 14, 2023
1 parent 1f7c1b8 commit 9e9f76d
Show file tree
Hide file tree
Showing 6 changed files with 212 additions and 110 deletions.
43 changes: 0 additions & 43 deletions docs/docs/about/team.md

This file was deleted.

89 changes: 22 additions & 67 deletions docs/docs/about/generate-team-cards.js → docs/docs/about/team.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
const maintainers = [{
---
sidebar_position: 5
hide_table_of_contents: true
---

import TeamCardOverview from '../../src/components/TeamCardOverview';

# Meet the Team

Do you want to know the curious and bright minds behind the CLI for Microsoft 365? Look no further! Below you will find a list of all our hard-working maintainers and brilliant contributors.

## Maintainers

<TeamCardOverview individuals={[
{
name: 'Adam Wojcik',
company: '',
github: 'Adam-it',
Expand Down Expand Up @@ -58,9 +72,12 @@ const maintainers = [{
github: 'waldekmastykarz',
twitter: 'waldekm'
}
];
]} />

## Contributors

const contributors = [{
<TeamCardOverview individuals={[
{
name: 'Aakash Bhardwaj',
company: '',
github: 'aakashbhardwaj619',
Expand Down Expand Up @@ -681,7 +698,7 @@ const contributors = [{
{
name: 'Tanmay Rathi',
company: 'Intuit',
github: ' Tanmay-21',
github: 'Tanmay-21',
twitter: ''
},
{
Expand Down Expand Up @@ -774,66 +791,4 @@ const contributors = [{
github: 'strafe',
twitter: ''
}
];

function generateGridCard(profile) {
const template = document.getElementById('cli-grid-item-template');
const profileCard = template.cloneNode(true);

// Configure profile image
const imgElement = profileCard.getElementsByClassName("cli-grid-item-img")[0];
imgElement.setAttribute("alt", profile.name);

if (profile.github) {
imgElement.setAttribute("src", `https://github.com/${profile.github}.png`);
} else {
imgElement.setAttribute("src", `https://ui-avatars.com/api/?name=${profile.name}`);
}

// Configure profile name
const nameElement = profileCard.getElementsByClassName("cli-grid-item-name")[0];
nameElement.innerHTML = profile.name;

// Configure profile company
const companyElement = profileCard.getElementsByClassName("cli-grid-item-company")[0];
if (profile.company) {
companyElement.innerHTML = profile.company;
} else {
companyElement.remove();
}

// Configure profile links
const githubElement = profileCard.querySelector('[title="GitHub"]');
const twitterElement = profileCard.querySelector('[title="Twitter"]');
if (profile.github) {
githubElement.setAttribute("href", `https://github.com/${profile.github}`);
} else {
githubElement.remove();
}

if (profile.twitter) {
twitterElement.setAttribute("href", `https://twitter.com/${profile.twitter}`);
} else {
twitterElement.remove();
}

// Remove id
profileCard.removeAttribute('id');

return profileCard;
}

const maintainersGrid = document.getElementById('cli-grid-maintainers');
const contributorsGrid = document.getElementById('cli-grid-contributors');

maintainers.forEach((profile) => {
const profileCard = generateGridCard(profile);

maintainersGrid.appendChild(profileCard);
});

contributors.forEach((profile) => {
const profileCard = generateGridCard(profile);

contributorsGrid.append(profileCard);
});
]} />
54 changes: 54 additions & 0 deletions docs/src/components/TeamCardOverview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React from 'react';
import useBaseUrl from '@docusaurus/useBaseUrl';
import styles from '../scss/TeamCard.module.scss';

interface IIndividual {
name: string;
company?: string;
github?: string;
twitter?: string;
}

interface ITeamCardOverview {
individuals: IIndividual[];
}

const TeamCardOverview = ({individuals}: ITeamCardOverview): JSX.Element => (
<div className={styles.grid}>
{
individuals.map(individual =>
<div className={styles.gridItemContainer}>
<div className={styles.gridItem}>
<div className={styles.gridItemAlignCenter}>
<img src={individual.github ? `https://github.com/${individual.github}.png` : `https://ui-avatars.com/api/?name=${individual.name}`} className={styles.gridItemImg} />
</div>
<div className={styles.gridItemAlignCenter}>
<div className={styles.gridItemText}>
<div className={styles.gridItemName}>{individual.name}</div>
<div className={styles.gridItemCompany}>{individual.company}</div>
</div>
</div>
<div className={styles.gridItemAlignCenter}>
{
individual.github
&&
<a href={`https://github.com/${individual.github}`} title='GitHub' className={styles.gridItemLink}>
<img alt='GitHub' src={useBaseUrl('/img/github-icon.svg')} className={styles.gridItemLinkImg} />
</a>
}
{
individual.twitter
&&
<a href={`https://twitter.com/${individual.twitter}`} title='Twitter' className={styles.gridItemLink}>
<img alt='Twitter' src={useBaseUrl('/img/twitter-icon.svg')} className={styles.gridItemLinkImg} />
</a>
}
</div>
</div>
</div>
)
}
</div>
);

export default TeamCardOverview;
136 changes: 136 additions & 0 deletions docs/src/scss/TeamCard.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
.grid {
display: grid;
grid-auto-columns: 1fr;
justify-content: space-around;
align-content: start;
grid-column-gap: 36px;
grid-row-gap: 36px;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
grid-template-rows: auto;
}

.gridItemContainer {
max-width: 100%;
display: inline-block;
}

.gridItem {
position: relative;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
border: 1px solid #ecebea;
border-radius: 6px;
background-color: #fff;
padding: 10px;
box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.02);
height: 100%;
}

.gridItemAlignCenter {
display: flex;
width: 100%;
-webkit-box-align: center;
align-items: center;
justify-content: center;
flex-wrap: wrap;

&:last-of-type {
margin-top: auto;
}
}

.gridItemImg {
width: 42px;
-webkit-box-flex: 0;
flex: 0 0 auto;
margin-left: auto;
margin-right: auto;
border-radius: 50%;
display: inline-block;
}

.gridItemText {
width: 100%;
text-align: center;
}

.gridItemName {
margin-top: 0px;
margin-bottom: 4px;
font-size: 12px;
line-height: 20px;
font-weight: 600;
letter-spacing: 0.5px;
text-decoration: none;
text-transform: uppercase;
}

.gridItemCompany {
color: #636e72;
font-size: 14px;
line-height: 20px;
}

.gridItemLink, .gridItemLinkImg {
opacity: 0.5;
-webkit-transition: opacity 200ms ease-in-out;
transition: opacity 200ms ease-in-out;
}

.gridItemLink {
color: #636e72;
margin-bottom: 0px;
padding-top: 10px;
padding-bottom: 8px;
padding-left: 4px;
padding-right: 4px;
font-size: 13px;
font-weight: 300;
text-decoration: none;
cursor: pointer;
max-width: 100%;
display: inline-block;

&:hover {
opacity: 1;
}
}

.gridItemLinkImg {
min-height: 24px;
fill: #636e72;
display: block;
}

@media screen and (max-width: 964px) {
.grid {
grid-template-columns: 1fr 1fr;
}
}

/* Apply different styles when dark mode is selected */
[data-theme='dark'] {
.gridItemLink {
color: #c5c5c5;
}

.gridItemLinkImg {
filter: invert(1);
}

.gridItemCompany {
color: #c5c5c5;
}

.gridItemName {
color: #fff;
}

.gridItem {
border: 1px solid #505050;
background-color: transparent;
box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.02);
}
}
File renamed without changes
File renamed without changes

0 comments on commit 9e9f76d

Please sign in to comment.