Skip to content

Commit

Permalink
[website][upgrade]feat: team page and some bug fix about version swit…
Browse files Browse the repository at this point in the history
…ch (apache#13731)
  • Loading branch information
urfreespace authored Jan 14, 2022
1 parent 2955430 commit a9f810c
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 7 deletions.
8 changes: 4 additions & 4 deletions site2/website-next/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ module.exports = {
// label: "Resources",
// to: "/:locale/resources",
// },
// {
// label: "Team",
// to: "/:locale/team",
// },
{
label: "Team",
to: "/:locale/team",
},
// {
// label: "Powered By",
// to: "/:locale/powered-by",
Expand Down
55 changes: 55 additions & 0 deletions site2/website-next/src/components/TeamTable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import * as React from "react";
import Table from "@mui/material/Table";
import TableBody from "@mui/material/TableBody";
import TableCell from "@mui/material/TableCell";
import TableRow from "@mui/material/TableRow";
import Link from "@mui/material/Link";
// import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import Translate, { translate } from "@docusaurus/Translate";

export default function VersionsTable(props) {
// const { siteConfig } = useDocusaurusContext();
return (
<Table size="small">
<TableBody>
<TableRow key="header">
{["Name", "Apache Id", "Roles"].map((header) => (
<TableCell
className="border-gray-300 font-bold"
sx={{ border: 1, color: "inherit" }}
align="left"
key={header}
>
<Translate>{header}</Translate>
</TableCell>
))}
</TableRow>
{props.data.map((row, index) => (
<TableRow key={index}>
<TableCell
className="border-gray-300 font-bold"
sx={{ border: 1, color: "inherit" }}
align="left"
>
{row.name}
</TableCell>
<TableCell
className="border-gray-300 font-bold"
sx={{ border: 1, color: "inherit" }}
align="left"
>
{row.apacheId}
</TableCell>
<TableCell
className="border-gray-300 font-bold"
sx={{ border: 1, color: "inherit" }}
align="left"
>
{row.roles}
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
);
}
5 changes: 4 additions & 1 deletion site2/website-next/src/components/VersionsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ export default function VersionsTable(props) {
)}
underline="none"
onClick={() => {
localStorage.setItem("version", row.name);
localStorage.setItem(
"version",
row.name == "next" ? "master" : row.name
);
}}
>
<Translate>Documentation</Translate>
Expand Down
52 changes: 52 additions & 0 deletions site2/website-next/src/pages/team.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import * as React from "react";
import Layout from "@theme/Layout";
import TeamTable from "../components/TeamTable";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import Translate, { translate } from "@docusaurus/Translate";
import team from "../../data/team";

export default function page(props) {
return (
<Layout>
<div className="tailwind">
<div className="my-12 container">
<header className="postHeader">
<h1>
<translate>Team</translate>
</h1>
<hr />
</header>
<p>
<translate>
A successful project requires many people to play many roles. Some
write code or documentation, while others are valuable as testers,
submitting patches and suggestions.
</translate>
</p>
<p>
<translate>
The team is comprised of PMC members, Committers and Contributors.
Committers have direct access to the source of a project and
actively evolve the codebase. Contributors improve the project
through submission of patches and suggestions to be reviewed by
the Committers. The number of Committers and Contributors to the
project is unbounded. Get involved today. All contributions to the
project are greatly appreciated.
</translate>
</p>

<h2>
<translate>Committers</translate>
</h2>
<p>
<translate>
The following is a list of developers with commit privileges that
have directly contributed to the project in one way or another.
</translate>
</p>
<TeamTable data={team.committers} />
</div>
</div>
</Layout>
);
}
4 changes: 2 additions & 2 deletions site2/website-next/src/theme/Navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const restApiVersions = require("../../../static/swagger/restApiVersions.json");
const latestStableVersion = versions[0];

function setVersion(version) {
localStorage.setItem("version", latestStableVersion);
localStorage.setItem("version", version == "next" ? "master" : version);
}

function getVersion() {
Expand Down Expand Up @@ -313,7 +313,7 @@ function Navbar() {
}}
/>
<a className="font-bold underline mr-4 -ml-4" href="/versions/">
{getVersion()}
{getVersion() == "master" ? "next" : getVersion()}
</a>
{leftItems.map((item, i) => {
if (item.label == "REST APIs") {
Expand Down

0 comments on commit a9f810c

Please sign in to comment.