Skip to content

Commit

Permalink
allow button titles for InfoBlock.js to be anything - changed home.js
Browse files Browse the repository at this point in the history
  • Loading branch information
eggliot committed May 29, 2024
1 parent cd9bf5e commit 8363aba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/src/components/InfoBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Button from "./Button";
import {useNavigate} from "react-router-dom";
import LazyImage from "./LazyImage";

const InfoBlock = ({title, text, image, imageAlt, buttonPath}) => {
const InfoBlock = ({title, text, image, imageAlt, buttonPath, buttonText}) => {
const navigate = useNavigate();

function handleClick() {
Expand All @@ -18,7 +18,8 @@ const InfoBlock = ({title, text, image, imageAlt, buttonPath}) => {
{image ? (<br/>) : ""}
<p className="textColor font-productsans text-center font-light pb-8 flex-grow">{text}</p>
{(buttonPath ? <div className="text-center">
<Button text="Read More" onClick={handleClick} color="bg-blue-900"/>
<Button text={buttonText ? buttonText : "Read More"} onClick={handleClick} color="bg-blue-900"/>
{/* NEED to check if the button text is passed in if not make it Read More*/}
</div> : "")}
</div>
);
Expand Down
3 changes: 3 additions & 0 deletions client/src/pages/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,21 @@ const Home = () => {
title="Our Sponsors"
text="The Spartabots wouldn't exist without the support of our gracious sponsors, who help us in a variety of ways from granting money to donating parts."
buttonPath="/sponsors"
buttonText="Sponsors" // Make this be Sponsor Us? and then include info on that page about how to sponsor us
/>
<div className="border-l-[1px] border-gray-300 min-h-[350px] mx-4"></div>
<InfoBlock
title="Community"
text="Our goal is to raise awareness and interest among the people of our community about our club as well as the field of science and technology. Partnering with community members and local companies will allow us to raise sufficient funds to support our club mission and objectives."
buttonPath="/about"
buttonText="About Us"
/>
<div className="border-l-[1px] border-gray-300 min-h-[350px] mx-4"></div>
<InfoBlock
title="Get Involved"
text="We are always looking for any help within the club. Whether it be new students to join us, new mentors, or new sponsors to support our team."
buttonPath="/join"
buttonText="Join Us"
/>
</div>

Expand Down

0 comments on commit 8363aba

Please sign in to comment.