Skip to content

Commit

Permalink
disable homepage registration button
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleyleal committed Sep 2, 2024
1 parent 6a2c2b5 commit 15758fb
Showing 1 changed file with 40 additions and 16 deletions.
56 changes: 40 additions & 16 deletions client/src/pages/Home/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,48 @@ const HomePageHeader = () => {

const HomeHeaderButton = () => {
const loggedIn = useSelector(loggedInSelector);
const [isRegistrationOpen, setIsRegistrationOpen] = useState(false);

return (
<>
<Link
key={loggedIn ? '/profile' : '/sign-up'}
to={loggedIn ? '/profile' : '/sign-up'}
style={{ textDecoration: 'none' }}
className="no-link-style"
>
{isRegistrationOpen || loggedIn ? (
<Link
key={loggedIn ? '/profile' : '/sign-up'}
to={loggedIn ? '/profile' : '/sign-up'}
style={{ textDecoration: 'none' }}
className="no-link-style"
>
<div className="home-page-header-register-button">
<div className="desktop-only">
<Button
label={loggedIn ? 'View Profile' : 'Register Now!'}
isSecondary
style={{
margin: '0px',
height: '100%',
fontSize: 'unset',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}
/>
</div>
<div className="mobile-only">
<Button
label={loggedIn ? 'View Profile' : 'Register Now!'}
isSecondary
style={{ margin: '0px' }}
/>
</div>
</div>
</Link>
) : (
<div className="home-page-header-register-button">
<div className="desktop-only">
<Button
label={loggedIn ? 'View Profile' : 'Register Now!'}
label="Registration Closed"
isSecondary
isDisabled
style={{
margin: '0px',
height: '100%',
Expand All @@ -91,24 +119,20 @@ const HomeHeaderButton = () => {
justifyContent: 'center',
alignItems: 'center',
}}
// hidden button xD
// style={{
// width: '0.px',
// height: '0.px',
// fontSize: '0px',
// opacity: '0',
// }}
disabled
/>
</div>
<div className="mobile-only">
<Button
label={loggedIn ? 'View Profile' : 'Register Now!'}
label="Registration Closed"
isSecondary
isDisabled
style={{ margin: '0px' }}
disabled
/>
</div>
</div>
</Link>
)}
</>
);
};
Expand Down

0 comments on commit 15758fb

Please sign in to comment.