Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove showcase from home page #646

Merged
merged 1 commit into from
Oct 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 1 addition & 61 deletions website/src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React, { useState, useEffect, useLayoutEffect } from "react";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import React, { useState, useLayoutEffect } from "react";
import Layout from "@theme/Layout";
import useThemeContext from '@theme/hooks/useThemeContext';

import HeroSection from "./sections/heroSection";
import Architecture from "./sections/architecture";
Expand All @@ -26,71 +24,13 @@ const useWindowSize = () => {
return size;
}

const Showcase = () => {
const {isDarkTheme, setLightTheme, setDarkTheme} = useThemeContext();

useEffect(() => {
if(isDarkTheme) {
setLightTheme(true);
}
}, [])

const { siteConfig } = useDocusaurusContext();
if (!(siteConfig.customFields.showcases || []).length) {
return null;
}
const showcases = siteConfig.customFields.showcases.map((user) => (
<a href={user.infoLink} key={user.infoLink} target="_blank">
<img className="user-logo" src={'https://cdn.jsdelivr.net/gh/apache/apisix-website@master/website/static/img/' + user.image} alt={user.caption} />
</a>
));
const middleIndex = (showcases.length / 2).toFixed(0);

return (
<div className="hero text--center showcase">
<div className="container">
<p>
A wide variety of Companies and Organizations use APISIX for Research, Production and Commercial products
<br />&nbsp;
<a
href="https://github.com/apache/apisix/blob/master/powered-by.md"
target="_blank"
rel="noopener"
>
<u>Add your company</u>
</a>
</p>
<div className="user-logos">
<div className="logo-row">
<span className="user-logos-container">
<section>
<span>{showcases.slice(0, middleIndex)}</span>
<span>{showcases.slice(0, middleIndex)}</span>
</section>
</span>
</div>
<div className="logo-row">
<span className="user-logos-container">
<section>
<span>{showcases.slice(middleIndex, showcases.length)}</span>
<span>{showcases.slice(middleIndex, showcases.length)}</span>
</section>
</span>
</div>
</div>
</div>
</div>
);
};

const Index = (props) => {

const [screenWidth, screenHeight] = useWindowSize();

return (
<Layout>
<HeroSection />
<Showcase />
<Architecture screenWidth={screenWidth} screenHeight={screenHeight}/>
<Features screenWidth={screenWidth} screenHeight={screenHeight}/>
<Benefits screenWidth={screenWidth} screenHeight={screenHeight}/>
Expand Down