Skip to content

Commit

Permalink
chore: remove showcase from home page (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
juzhiyuan authored Oct 9, 2021
1 parent 61d5c13 commit e52ae41
Showing 1 changed file with 1 addition and 61 deletions.
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

0 comments on commit e52ae41

Please sign in to comment.