Fix bylaws for mobile

This commit is contained in:
TheMaddax 2024-10-15 07:18:03 -05:00
parent 630ea7d32f
commit 56bd867814

View file

@ -1,7 +1,20 @@
import React from 'react';
import React, { useState, useEffect } from 'react';
import { motion } from 'framer-motion';
const Bylaws: React.FC = () => {
const [isMobile, setIsMobile] = useState(false);
useEffect(() => {
const checkMobile = () => {
setIsMobile(window.innerWidth < 768); // Adjust this breakpoint as needed
};
checkMobile();
window.addEventListener('resize', checkMobile);
return () => window.removeEventListener('resize', checkMobile);
}, []);
return (
<div className="container mx-auto px-4 py-8">
<motion.h1
@ -17,6 +30,19 @@ const Bylaws: React.FC = () => {
transition={{ duration: 0.5 }}
className="bg-white rounded-lg shadow-lg p-4"
>
{isMobile ? (
<div>
<p className="mb-4">Click the link below to view the MCDi Bylaws PDF:</p>
<a
href="/MCD-Inc._AOI_Bylaws.pdf"
target="_blank"
rel="noopener noreferrer"
className="bg-[#8C1D40] text-white font-bold py-2 px-4 rounded hover:bg-[#6B1631] transition duration-300"
>
View Bylaws PDF
</a>
</div>
) : (
<div className="w-full" style={{ height: '800px' }}>
<iframe
src="/MCD-Inc._AOI_Bylaws.pdf#view=FitH"
@ -24,6 +50,7 @@ const Bylaws: React.FC = () => {
title="MCDi Bylaws"
/>
</div>
)}
</motion.div>
</div>
);