Skip to content

Commit

Permalink
Merge pull request #25 from nairobi-gophers/pdf-fix
Browse files Browse the repository at this point in the history
revert
  • Loading branch information
nutcas3 authored Jul 1, 2024
2 parents bb06268 + efba452 commit 3d37c6c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
21 changes: 13 additions & 8 deletions frontend/src/components/Sponsors.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// src/Sponsors.tsx
export default function Sponsors() {
const handleLinkClick = (event: React.MouseEvent<HTMLAnchorElement>) => {
event.preventDefault();
import React from 'react';

window.open('/Gophercon Africa 2024 Sponsorship Prospectus.pdf', '_blank');
export default function Sponsors() {
const handleButtonClick = (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
event.preventDefault(); // Prevents the default behavior of the anchor tag (navigation)

};

return (
<section
id="sponsors"
Expand All @@ -15,16 +15,21 @@ export default function Sponsors() {
Sponsor The Event
</h2>
<p className="max-w-lg mb-8 text-sm md:text-base">
Don't miss this chance to supercharge your brand and tap into the vibrant energy of Nairobi's Go programming community. Contact us today to explore more sponsorship opportunities and join us in creating an unforgettable event.</p>
Don't miss this chance to supercharge your brand and tap into the vibrant energy of Nairobi's Go programming community. Contact us today to explore more sponsorship opportunities and join us in creating an unforgettable event.
</p>

<div className="flex flex-col md:flex-row gap-4">
<a
className="button w-full md:w-auto mb-4 md:mb-0"
onClick={handleLinkClick}
href="/sponsorship"
onClick={handleButtonClick} // Call the function to handle button click
>
Sponsorship Details
</a>
<a className="button w-full md:w-auto" href="mailto:[email protected]?subject=GopherCon%20Africa%20Sponsorship">
<a
className="button w-full md:w-auto"
href="mailto:[email protected]?subject=GopherCon%20Africa%20Sponsorship"
>
Become a Sponsor
</a>
</div>
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import './index.css'
import {createBrowserRouter, RouterProvider} from "react-router-dom";
import Home from "./pages/Home.tsx";
import Error from "./pages/Error.tsx";
import SponsorshipRedirect from './pages/SponsorshipRedirect';


const router = createBrowserRouter([
Expand All @@ -12,6 +13,10 @@ const router = createBrowserRouter([
element: <Home />,
errorElement: <Error />,
},
{
path: "/sponsorship",
element: <SponsorshipRedirect />,
},
]);

ReactDOM.createRoot(document.getElementById('root')!).render(
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/pages/SponsorshipRedirect.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// src/SponsorshipRedirect.tsx
import React from 'react';

const SponsorshipRedirect: React.FC = () => {
React.useEffect(() => {
window.location.href = '/Gophercon Africa 2024 Sponsorship Prospectus.pdf';
}, []);

return null;
};

export default SponsorshipRedirect;

0 comments on commit 3d37c6c

Please sign in to comment.