Skip to content

Commit

Permalink
index.js file in pages directory is optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
m-Jawa-d committed Sep 10, 2024
1 parent 88b4c54 commit bcf2620
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 70 deletions.
84 changes: 20 additions & 64 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,85 +6,41 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import styles from './index.module.css';
import HomepageFeatures from '../components/HomepageFeatures';

const buttonLinks = [
{ to: './docs/Process/how-to-apply', text: 'Apply', className: styles.buttonDark },
{ to: './docs/office-hours', text: 'Office Hours' },
{ to: './docs/rfps', text: 'Browse RFPs' },
{ to: 'https://futures.web3.foundation', text: 'Decentralized Futures ↗', className: styles.buttonCustom },
{ to: 'https://jam.web3.foundation', text: 'JAM Prize ↗', className: styles.buttonCustom },
];


function HomepageHeader() {
const {siteConfig} = useDocusaurusContext();
function HomepageHeader({ siteConfig }) {
return (
<header className={clsx('hero hero--primary', styles.heroBanner)}>
<div className="container">
{/* <h1 className="hero__title">{siteConfig.title} </h1> */}
<img src="img/web3 foundation grants_black.jpg"></img>
<img src="img/web3 foundation grants_black.jpg" alt="Web3 Foundation Grants" width="500" height="300" />
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}
style={{
display: "block"
}}
>
<div>
<Link
className="button button--secondary button--lg"
to="./docs/Process/how-to-apply"
style={{
marginLeft: "10px",
marginBottom: "5px",
backgroundColor: "rgb(0, 0, 0)",
color: "rgb(250, 250, 250)"
}}>
Apply
</Link>
<Link
className="button button--secondary button--lg"
to="./docs/office-hours"
style={{
marginLeft: "10px",
marginBottom: "5px"
}}>
Office Hours
</Link>
<Link
className="button button--secondary button--lg"
to="./docs/rfps"
style={{
marginLeft: "10px",
marginBottom: "5px",
}}>
Browse RFPs
</Link>
<Link
className="button button--secondary button--lg"
to="https://futures.web3.foundation"
style={{
marginLeft: "10px",
marginBottom: "5px",
backgroundColor: "rgb(250, 250, 250)"
}}>
Decentralized Futures ↗
</Link>
<div className={styles.buttons}>
{buttonLinks.map((link, idx) => (
<Link
className="button button--secondary button--lg"
to="https://jam.web3.foundation"
style={{
marginLeft: "10px",
marginBottom: "5px",
backgroundColor: "rgb(250, 250, 250)"
}}>
JAM Prize ↗
key={idx}
className={clsx("button button--secondary button--lg", link.className || "")}
to={link.to}
>
{link.text}
</Link>
</div>
))}
</div>
</div>
</header>
);
}

export default function Home() {
const {siteConfig} = useDocusaurusContext();
const { siteConfig } = useDocusaurusContext();
return (
<Layout
title={`${siteConfig.title}`}
description="Web3 Foundation Grants">
<HomepageHeader />
<Layout title={`${siteConfig.title}`} description="Web3 Foundation Grants">
<HomepageHeader siteConfig={siteConfig} />
<main>
<HomepageFeatures />
</main>
Expand Down
24 changes: 18 additions & 6 deletions src/pages/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,26 @@
overflow: hidden;
}

@media screen and (max-width: 966px) {
.heroBanner {
padding: 2rem;
}
}

.buttons {
display: flex;
align-items: center;
justify-content: center;
}

.buttonCustom {
margin-left: 10px;
margin-bottom: 5px;
background-color: rgb(250, 250, 250);
color: rgb(0, 0, 0);
}

.buttonDark {
background-color: rgb(0, 0, 0);
color: rgb(250, 250, 250);
}

@media screen and (max-width: 966px) {
.heroBanner {
padding: 2rem;
}
}

0 comments on commit bcf2620

Please sign in to comment.