Skip to content

Commit

Permalink
fix: misc changes to keep header and hero style consistent (unstructu…
Browse files Browse the repository at this point in the history
  • Loading branch information
aqsaaqeel authored Nov 6, 2023
1 parent e202e45 commit c814cd1
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 30 deletions.
1 change: 1 addition & 0 deletions zubhub_frontend/zubhub/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
"2": "Create, Share!",
"shareProject": "Share your work",
"exploreIdeas": "Explore Ideas",
"heroAlt": "Six animated children happily walking",
"zubhubAmbassadors": "Become an Ambassador",
"newStuff": "New Stuff",
"login":"Login to view more",
Expand Down
1 change: 1 addition & 0 deletions zubhub_frontend/zubhub/public/locales/hi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@
"2":"बनाएं, शेयर करें!",
"shareProject": "एक परियोजना साझा करें",
"exploreIdeas": "विचारों का अन्वेषण करें",
"heroAlt": "छह एनिमेटेड बच्चे खुशी से चल रहे हैं",
"zubhubAmbassadors": "हमारे राजदूत बनें",
"newStuff": "नयी चीज़",
"allProjects": "सभी परियोजनाएं",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ const styles = theme => ({
projectGridStyle: {
marginBottom: '2em',
},
MessagePrimaryStyle: {
fontSize: '2.5rem',
fontWeight: 1000,
},
});

export default styles;
3 changes: 1 addition & 2 deletions zubhub_frontend/zubhub/src/assets/js/styles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ const styles = theme => ({
borderRadius: 20,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
alignItems: 'center',
cursor: 'pointer',
backgroundColor: 'white',
},
flexColumn: {
flexDirection: 'column'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const styles = theme => ({
fontSize: '1.15rem',
},
mainContainerStyle: {
maxWidth: '100vw',
// maxWidth: '100vw',
zIndex: 1,
// boxShadow:
// '0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,27 @@ const styles = theme => ({
// '& .MuiGrid-root.MuiGrid-container': {
// width: '100%',
[theme.breakpoints.down('sm')]: {
padding: '0 24px',
// padding: '0 24px',
width: '100%',
},
},
heroMainSectionStyle: {
backgroundColor: 'var(--primary-color1)',
display: 'flex',
paddingTop: '2.3em',
paddingBottom: '2.8em',
padding: '0 calc((100vw - 1350px) / 2)',
paddingTop: '2em',
paddingBottom: '2em',
justifyContent: 'center',
width: '100vw',
// width: '100%',
// maxWidth: '1230px',
marginBottom: '2em',
height:'100vh',
[theme.breakpoints.down('1000')]: {
width: '100%',
padding: '0 1em'
},
[theme.breakpoints.down('sm')]: {
width: '100',
width: '100%',
height:'fit-content',
},
},
Expand Down Expand Up @@ -146,13 +152,19 @@ const styles = theme => ({
heroMainMessageSecondaryStyle: {
fontSize: '4.5rem',
fontWeight: '700',
[theme.breakpoints.down('1480')]: {
fontSize: '3.5rem'
},
[theme.breakpoints.down('sm')]: {
fontSize: '2.5rem'
},
},
heroMainMessagePrimaryStyle: {
fontSize: '2.2rem',
fontWeight: 500,
[theme.breakpoints.down('1480')]: {
fontSize: '1.7rem'
},
[theme.breakpoints.down('sm')]: {
fontSize: '1.2rem'
},
Expand Down Expand Up @@ -310,6 +322,7 @@ const styles = theme => ({
// marginTop: '3em',
maxWidth: '1190px',
width: '100%',
padding: '0 2rem',
},
projectGridStyle: {
marginBottom: '2em',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const AvatarButton = props => {
const commonClasses = makeStyles(commonStyles)();
const classes = makeStyles(styles)();
const [dropdownOpen, setDropdownOpen] = useState(false);
const [signupStyles, setsignupStyles] = useState(false)
const [signupStyles, setsignupStyles] = useState(false);
const buttonRef = useRef();
const auth = useSelector(state => state.auth);
const goToProfile = () => {
Expand All @@ -23,25 +23,25 @@ const AvatarButton = props => {
}
};

const onClickSignUp = () =>{
(!auth.token ? setDropdownOpen(!dropdownOpen) : goToProfile())
setsignupStyles(true)
}
const onClickSignUp = () => {
!auth.token ? setDropdownOpen(!dropdownOpen) : goToProfile();
setsignupStyles(true);
};

const oncloseSignUp = () =>{
setDropdownOpen(false)
setsignupStyles(false)
}
const oncloseSignUp = () => {
setDropdownOpen(false);
setsignupStyles(false);
};
return (
<ClickAwayListener onClickAway={oncloseSignUp}>
<div>
<Avatar
ref={buttonRef}
onClick={onClickSignUp}
className={commonClasses.iconBox}
alt={auth?.username?.toUpperCase()}
src={auth?.avatar}
/>
<Avatar
ref={buttonRef}
onClick={onClickSignUp}
className={`${commonClasses.iconBox} ${auth.token && classes.avatarIconStyle}`}
alt={auth?.username?.toUpperCase()}
src={!auth.token ? "/static/images/avatar/1.jpg" : auth?.avatar}
/>
<PanelPopper open={dropdownOpen} anchorEl={buttonRef} signUpStyles={signupStyles}>
<div className={classes.container}>
<Avatar style={{ fontSize: 35, color: colors.primary, backgroundColor: colors.white }} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ export const styles = theme => ({
height: '86%',
},
},
avatarIconStyle:{
backgroundColor: 'white'
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function StaffPick(props) {
// component="h2"
// variant="h6"
// color="textPrimary"
className={classes.titleStyle}
className={classes.MessagePrimaryStyle}
>
{staff_pick.title}
{/* <CustomButton
Expand Down
10 changes: 5 additions & 5 deletions zubhub_frontend/zubhub/src/views/home/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import new_stuff from '../../assets/images/new_stuff.svg';
import styles from '../../assets/js/styles/views/projects/projectsStyles';
import commonStyles from '../../assets/js/styles';
import hikingIcon from '../../assets/images/hiking.svg';
import heroMainImage from '../../assets/images/heroMainImage.svg'
import heroMainImage from '../../assets/images/heroMainImage.svg';
const useStyles = makeStyles(styles);
const useCommonStyles = makeStyles(commonStyles);

Expand Down Expand Up @@ -161,8 +161,8 @@ function Projects(props) {
<Box className={classes.heroImageContainerStyle}>
<img
className={classes.heroImageStyle}
src={hero.image_url}
alt=""
src={hero.image_url ? hero.image_url : heroMainImage}
alt={t('projects.heroAlt')}
/>
</Box>
)}
Expand Down Expand Up @@ -193,7 +193,7 @@ function Projects(props) {
<img
className={classes.heroImageStyle}
src={hero.image_url ? hero.image_url : heroMainImage}
alt="Six animated children happily walking"
alt={t('projects.heroAlt')}
/>
</Box>
)}
Expand All @@ -216,7 +216,7 @@ function Projects(props) {
/>
))}
<CustomButton
className={classes.heroBtnStyle}
className={classes.heroButtonStyle}
size="small"
primaryButtonStyle
onClick={() => props.history.push('/login')}
Expand Down

0 comments on commit c814cd1

Please sign in to comment.