Skip to content

Commit

Permalink
Merge branch 'feature_291_marketing-text-context-creation' of https:/…
Browse files Browse the repository at this point in the history
…/github.com/Nonprofit-Exchange-Hub/web-app into feature_291_marketing-text-context-creation
  • Loading branch information
denniswangcodes committed Mar 24, 2024
2 parents 51ee779 + 20d8ba9 commit 2435e6c
Show file tree
Hide file tree
Showing 34 changed files with 6,894 additions and 948 deletions.
4 changes: 0 additions & 4 deletions .husky/pre-push

This file was deleted.

12 changes: 11 additions & 1 deletion client/src/components/BannerSection.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React, { useContext } from 'react';
import { Grid, Typography, Box } from '@mui/material';
import { makeStyles } from 'tss-react/mui';
import type { Theme } from '@mui/material/styles';
import MainImage from '../assets/banner-section-main.svg';
import { CTAHeroButton } from './Buttons/Button';
import { useHistory } from 'react-router-dom';

Check warning on line 7 in client/src/components/BannerSection.tsx

View workflow job for this annotation

GitHub Actions / linting

'useHistory' is defined but never used

Check failure on line 7 in client/src/components/BannerSection.tsx

View workflow job for this annotation

GitHub Actions / linting

'useHistory' is defined but never used
import { useMarketingText } from './../providers/MarketingTextProvider';
import { ModalContext } from './../providers/ModalProvider';

const useStyles = makeStyles()((theme: Theme) => ({
gridTitle: {
Expand Down Expand Up @@ -47,8 +49,16 @@ function BannerText() {
function BannerSection() {
const { banner } = useMarketingText();
const { classes } = useStyles();
const history = useHistory();
const modalContext = useContext(ModalContext);
const { openModal } = modalContext;

const handleOpenModal = (modalType: 'SignIn' | 'SignUp') => {

Check warning on line 55 in client/src/components/BannerSection.tsx

View workflow job for this annotation

GitHub Actions / linting

'handleOpenModal' is assigned a value but never used

Check failure on line 55 in client/src/components/BannerSection.tsx

View workflow job for this annotation

GitHub Actions / linting

'handleOpenModal' is assigned a value but never used
if (modalType === 'SignIn') {
openModal('SignIn');
} else if (modalType === 'SignUp') {
openModal('SignUp');
}
};
return (
<Box>
<Grid container spacing={3} sx={{ height: '600px' }}>
Expand Down
45 changes: 45 additions & 0 deletions client/src/components/Buttons/CTAButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { makeStyles } from 'tss-react/mui';
import { Typography } from '@mui/material';
import type { Theme } from '@mui/material/styles';
import React, { useContext } from 'react';
import { ModalContext } from '../../providers/ModalProvider';

const useStyles = makeStyles()((theme: Theme) => ({
CTAButton: {
color: 'white',
backgroundColor: '#EF6A60',
borderRadius: '10px',
fontFamily: 'Poppins',
fontWeight: 'semi-bold',
border: 'none',
'&:hover': {
backgroundColor: '#EF6A60',
cursor: 'pointer',
},
},
}));

type Props = {
text: string;
};

function CTAButton({ text }: Props) {
const { classes } = useStyles();
const modalContext = useContext(ModalContext);
const { openModal } = modalContext;

return (
<button onClick={() => openModal('SignUp')} className={classes.CTAButton}>
<Typography
sx={{
fontSize: '22px',
padding: '15px 25px 15px 25px',
}}
>
{text}
</Typography>
</button>
);
}

export default CTAButton;
10 changes: 4 additions & 6 deletions client/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function Header() {
const modalContext = useContext(ModalContext);
const { openModal } = modalContext;

const handleoOpenModal = (modalType: 'SignIn' | 'SignUp') => {
const handleOpenModal = (modalType: 'SignIn' | 'SignUp') => {
if (modalType === 'SignIn') {
openModal('SignIn');
} else if (modalType === 'SignUp') {
Expand Down Expand Up @@ -423,12 +423,11 @@ function Header() {
aria-haspopup="true"
aria-expanded={isProfileMenuOpen ? 'true' : undefined}
onClick={handleClick}
sx={{ marginRight: '.5em', fill: 'black' }}
sx={{ marginRight: '.5em' }}
>
<UserAvatar
userFirstName={user.firstName}
profileImageUrl={user.profile_image_url ?? ''}
style={{ backgroundColor: 'black' }}
/>
</IconButton>
<Menu
Expand Down Expand Up @@ -489,12 +488,11 @@ function Header() {
</>
) : (
<>
{/* TODO: Use () => handleoOpenModal('SignUp') when implemented */}
<PrimaryCTAButton
text="Join Now"
onClick={() => history.push('/signup-citizen')}
onClick={() => handleOpenModal('SignUp')}
></PrimaryCTAButton>
<Button className={classes.signInButton} onClick={() => handleoOpenModal('SignIn')}>
<Button className={classes.signInButton} onClick={() => handleOpenModal('SignIn')}>
Sign In
</Button>
</>
Expand Down
Loading

0 comments on commit 2435e6c

Please sign in to comment.