Skip to content

Commit

Permalink
added maintainer tag
Browse files Browse the repository at this point in the history
  • Loading branch information
drifter089 committed Apr 25, 2024
1 parent 7c227b1 commit 7868e36
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ jobs:
- name: Install dependencies
run: npm install
- name: generate json of file structure
run: bash generate-table-json.sh
run: bash generate-table-json.sh
- name: fetch team json
run : bash sync-data.sh
- name: Build
run: npm run build
- name: show build size
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package-lock.json

output.json
folder_list.json
team.yaml

# Generated files
.docusaurus
Expand Down
2 changes: 2 additions & 0 deletions docs/Engineering/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ sidebar_label: Engineering
sidebar_class_name: green
---
import DocCardList from '@theme/DocCardList';
import MaintainerTag from "@site/src/components/MaintainerTag";

<MaintainerTag maintainerEmails={["[email protected]","[email protected]","[email protected]"]} />

# Engineering

Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/components/DocsTable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const PageLinkTable = ({ key, title, items }) => {
<thead>
<tr>
<th className={styles.column_width}>
{/* {title} */}
<Link to={pageLink}>{title}</Link>
</th>
</tr>
Expand Down
55 changes: 55 additions & 0 deletions src/components/MaintainerTag/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import React, { useState, useEffect } from "react";
import styles from "./styles.module.css";
import Link from "@docusaurus/Link";
import team_data from "../../../team.json";

function ImageComponent(props) {
const { imageUrl } = props;

return <img className={styles.tag_image} src={imageUrl} alt="Image" />;
}

function NameLink(props) {
const { name, externalLink } = props;

return (
<Link to={externalLink} target="_blank">
{name}
</Link>
);
}

function GenerateTags({ maintainerEmail }) {
const memberData = handleSearch(maintainerEmail);

return (
<>
<ImageComponent imageUrl={memberData.image_link} />
<NameLink
name={memberData.name}
externalLink={memberData.redirect_link}
/>
</>
);
}

const handleSearch = (email) => {
const foundResult = team_data.find((item) => item.mail_id === email);
return foundResult;
};

const MaintainerTag = ({ maintainerEmails }) => {
return (
<div className={styles.tag_container}>
<span className={styles.maintainer}>maintainers -</span>
{maintainerEmails.map((email, index) => (
<React.Fragment key={email}>
<GenerateTags maintainerEmail={email} />
{index < maintainerEmails.length - 1 && <span>, </span>}
</React.Fragment>
))}
</div>
);
};

export default MaintainerTag;
25 changes: 25 additions & 0 deletions src/components/MaintainerTag/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

.tag_container{
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
flex-wrap: wrap;
margin-left: 0.5rem;
margin-bottom: 1rem;
padding: auto;
max-width: 80%;
}

.tag_image{
width: 4vh;
height: 4vh;
border-radius: 50%;
overflow: hidden;
object-fit: cover;
margin: 0.5rem;
}

.maintainer{
font-weight: 500;
}
1 change: 1 addition & 0 deletions sync-data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
wget -N https://raw.githubusercontent.com/open-energy-transition/oet-data-bank/master/team.json
98 changes: 98 additions & 0 deletions team.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
[
{
"name": "akshat mittal",
"designation": "wvgevwvwv",
"description": "afnewfew wefenvwv ewenewiv eiewnii4gv4 4fgi4jg4g4g wffwfgewgieg ewgw ew egwnge weigoegwe weofwe ewgwgwegweg weiwfjefef fwefwefwe ewfewfw",
"image_link": "https://placehold.co/600x400/orange/black?text=akshat+mittal",
"mail_id": "[email protected]",
"redirect_link": "https://www.example.com/akshat_mittal"
},
{
"name": "another_name",
"designation": "another_designation",
"description": "another_description",
"image_link": "https://placehold.co/600x400/orange/black?text=another_name",
"mail_id": "[email protected]",
"redirect_link": "https://www.example.com/another_name"
},
{
"name": "John Doe",
"designation": "Senior Engineer",
"description": "A highly skilled engineer with expertise in various programming languages.",
"image_link": "https://placehold.co/600x400/orange/black?text=John+Doe",
"mail_id": "[email protected]",
"redirect_link": "https://www.example.com/john_doe"
},
{
"name": "Jane Smith",
"designation": "Marketing Manager",
"description": "Experienced marketing professional with a proven track record of successful campaigns.",
"image_link": "https://placehold.co/600x400/orange/black?text=Jane+Smith",
"mail_id": "[email protected]",
"redirect_link": "https://www.example.com/jane_smith"
},
{
"name": "Michael Johnson",
"designation": "Financial Analyst",
"description": "Detail-oriented financial analyst with expertise in financial modeling and forecasting.",
"image_link": "https://placehold.co/600x400/orange/black?text=Michael+Johnson",
"mail_id": "[email protected]",
"redirect_link": "https://www.example.com/michael_johnson"
},
{
"name": "Emily Wang",
"designation": "HR Manager",
"description": "HR professional with extensive experience in recruitment and employee relations.",
"image_link": "https://placehold.co/600x400/orange/black?text=Emily+Wang",
"mail_id": "[email protected]",
"redirect_link": "https://www.example.com/emily_wang"
},
{
"name": "Alex Brown",
"designation": "Product Manager",
"description": "Product management expert with a passion for innovation and customer satisfaction.",
"image_link": "https://placehold.co/600x400/orange/black?text=Alex+Brown",
"mail_id": "[email protected]",
"redirect_link": "https://www.example.com/alex_brown"
},
{
"name": "Sophia Garcia",
"designation": "Graphic Designer",
"description": "Creative graphic designer with a keen eye for detail and a strong aesthetic sense.",
"image_link": "https://placehold.co/600x400/orange/black?text=Sophia+Garcia",
"mail_id": "[email protected]",
"redirect_link": "https://www.example.com/sophia_garcia"
},
{
"name": "William Lee",
"designation": "Sales Executive",
"description": "Results-driven sales executive with a proven ability to exceed targets and drive revenue growth.",
"image_link": "https://placehold.co/600x400/orange/black?text=William+Lee",
"mail_id": "[email protected]",
"redirect_link": "https://www.example.com/william_lee"
},
{
"name": "Olivia Martinez",
"designation": "Project Coordinator",
"description": "Organized project coordinator with excellent communication and coordination skills.",
"image_link": "https://placehold.co/600x400/orange/black?text=Olivia+Martinez",
"mail_id": "[email protected]",
"redirect_link": "https://www.example.com/olivia_martinez"
},
{
"name": "Daniel Kim",
"designation": "Software Developer",
"description": "Skilled software developer with expertise in full-stack web development.",
"image_link": "https://placehold.co/600x400/orange/black?text=Daniel+Kim",
"mail_id": "[email protected]",
"redirect_link": "https://www.example.com/daniel_kim"
},
{
"name": "Michelle Chen",
"designation": "Content Writer",
"description": "Creative content writer with a passion for storytelling and digital marketing.",
"image_link": "https://placehold.co/600x400/orange/black?text=Michelle+Chen",
"mail_id": "[email protected]",
"redirect_link": "https://www.example.com/michelle_chen"
}
]

0 comments on commit 7868e36

Please sign in to comment.