Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
coderatomy committed Oct 23, 2023
1 parent e86a4fb commit 436e749
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ export const resultModal = (theme) => ({
[theme.breakpoints.down('400')]: {
marginTop: '65%'
}
}
},
containerStylesOverrides: { boxShadow: 'none' },
titleStylesOverrides: { textAlign: 'center'}
})

9 changes: 3 additions & 6 deletions zubhub_frontend/zubhub/src/views/login/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,12 @@ function Login(props) {
};

const { show_password } = state;
const { t } = props;

const styleOverridesPresent = Object.keys(props?.styleOverrides).length > 0
const { t } = props

return (
<Box className={classes.root}>
<Container className={classes.containerStyle} >
<Card className={classes.cardStyle} style={ styleOverridesPresent ? {...props.styleOverrides.containerStyles } : {}}>
<Card className={clsx([classes.cardStyle, props.styleOverrides?.containerStyles])}>
<CardActionArea>
<CardContent>
<form
Expand All @@ -82,8 +80,7 @@ function Login(props) {
variant="h5"
component="h2"
color="textPrimary"
className={classes.titleStyle}
style={{...props.styleOverrides.titleStyles}}
className={clsx([classes.titleStyle, props.styleOverrides?.titleStyles])}
>
{props.primaryTitle ?? t('login.welcomeMsg.primary')}
</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function SearchResults(props) {
} else {
return (
<Grid container spacing={3}>
{results.map(project => (
{results?.map(project => (
<Grid
item
xs={12}
Expand Down Expand Up @@ -203,8 +203,7 @@ function SearchResults(props) {
<Login {...props}
primaryTitle='Log in or Sign up to search for projects'
secondaryTitle=''
styleOverrides={{ containerStyles: {boxShadow: 'none'}, titleStyles: { textAlign: 'center'}}}
withoutShadow
styleOverrides={{containerStyles: modalClasses.containerStylesOverrides, titleStyles: modalClasses.titleStylesOverrides}}
/>
</Grid>
</Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const getQueryParams = url => {
*/
export const fetchPage = (page, props, query_string, type) => {
if (type === SearchType.PROJECTS) {
if (props.auth.token) {
if (props.auth?.token) {
return props.searchProjects({
page,
query_string,
Expand Down

0 comments on commit 436e749

Please sign in to comment.