Skip to content

Commit

Permalink
simplified Hero component
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-defi committed Jul 19, 2024
1 parent 0ecaba0 commit 26bcdc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 157 deletions.
67 changes: 4 additions & 63 deletions apps/base-docs/src/components/Hero/index.tsx
Original file line number Diff line number Diff line change
@@ -1,68 +1,9 @@
import React, { useEffect, useState } from 'react';

import styles from './styles.module.css';
import BarChart from './BarChart/BarChart';
import ControlHero from './ControlHero';
import TreatmentHero from './TreatmentHero';

export default function Hero() {
const [windowWidth, setWindowWidth] = useState(window.innerWidth);

useEffect(() => {
const handleWindowResize = () => setWindowWidth(window.innerWidth);
window.addEventListener('resize', handleWindowResize);
return () => window.removeEventListener('resize', handleWindowResize);
}, []);

if (windowWidth <= 500) {
return <MobileHero />;
}
return <DesktopHero />;
}

function DesktopHero() {
return (
<header className={styles.heroContainer}>
<div>
<h1 className={styles.heroTitle}>Build onchain</h1>
</div>
<div className={styles.chartContainer}>
<BarChart />
</div>
<div className={styles.secondaryContentContainer}>
<div>
<div className={styles.ctaText}>
Keep your costs low and save on gas with every transaction when you build on Base.
</div>
<button className={styles.ctaButton}>
<a href="/docs">LEARN MORE</a>
</button>
</div>
<div className={styles.secondaryTitleContainer}>
<h1 className={styles.heroTitle}>for less</h1>
</div>
</div>
</header>
);
}

function MobileHero() {
return (
<header className={styles.heroContainer}>
<div className={styles.titleContainer}>
<h1 className={styles.heroTitle}>Build onchain for less</h1>
</div>
<div className={styles.chartContainerMobile}>
<BarChart />
</div>
<div className={styles.secondaryContentContainerMobile}>
<div className={styles.ctaContainer}>
<div className={styles.ctaText}>
Keep your costs low and save on gas with every transaction when you build on Base.
</div>
<button className={styles.ctaButton}>
<a href="/docs">LEARN MORE</a>
</button>
</div>
</div>
</header>
);
return <ControlHero />;
// return <TreatmentHero />;
}
94 changes: 0 additions & 94 deletions apps/base-docs/src/components/Hero/styles.module.css

This file was deleted.

0 comments on commit 26bcdc2

Please sign in to comment.