Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue 211 #390

Merged
merged 9 commits into from
Apr 15, 2022
6 changes: 3 additions & 3 deletions zubhub_frontend/zubhub/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,25 @@ const styles = theme => ({
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',

boxShadow:
'0px 3px 1px -2px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12)',
[theme.breakpoints.down('1080')]: {
position: 'static',
height: '3.5em',
width: '100%',
width: 'fit-content',
flexDirection: 'row',
justifyContent: 'flex-start',
justifyContent: 'flex-end',
paddingRight: 12,
},
},
iconsBoxStyle: {
[theme.breakpoints.down('1080')]: {
display: 'flex',
paddingRight: 4,
},
},

actionBoxButtonStyle: {
margin: '0.5em',
display: 'flex',
Expand All @@ -117,7 +126,8 @@ const styles = theme => ({
'& span': { display: 'flex', flexDirection: 'column' },
[theme.breakpoints.down('1080')]: {
flexDirection: 'row',
marginBottom: '1em',
margin: '0.2em',
padding: '7px',
'& span': {
flexDirection: 'row',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ const buildMaterialUsedNodes = ({ props, refs, classes, common_classes }) => {
* @todo - describe function's signature
*/
function CreateProject(props) {
console.log(props.values.category);
const [category, setCategory] = React.useState([]);

const classes = useStyles();
const common_classes = useCommonStyles();

Expand Down Expand Up @@ -660,9 +663,11 @@ function CreateProject(props) {
labelId="category"
id="category"
name="category"
multiple={true}
className={classes.customInputStyle}
value={
props.values.category ? props.values.category : ''
[...category]
// props.values.category ? props.values.category : ''
}
onChange={props.handleChange}
onBlur={props.handleBlur}
Expand Down
151 changes: 77 additions & 74 deletions zubhub_frontend/zubhub/src/views/project_details/ProjectDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function ProjectDetails(props) {
</Typography>
</Link>
{project.creator.id === props.auth.id ? (
<>
<Grid container justify="flex-end">
<Link
className={classes.textDecorationNone}
to={`/projects/${project.id}/edit`}
Expand All @@ -219,7 +219,7 @@ function ProjectDetails(props) {
>
{t('projectDetails.project.delete.label')}
</CustomButton>
</>
</Grid>
) : (
<CustomButton
className={common_classes.marginLeft1em}
Expand All @@ -246,10 +246,7 @@ function ProjectDetails(props) {
xs={12}
sm={12}
md={12}
className={clsx(
classes.positionRelative,
classes.marginBottom1em,
)}
className={clsx(classes.positionRelative)}
>
<Grid
item
Expand Down Expand Up @@ -306,68 +303,76 @@ function ProjectDetails(props) {
</a>
) : null}
</Grid>
<Box className={classes.actionBoxStyle}>
<CustomButton
className={classes.actionBoxButtonStyle}
size="small"
aria-label={t(
'projectDetails.ariaLabels.likeButton.label',
)}
variant="extended"
onClick={e =>
handleSetState(toggleLike(e, props, project.id))
}
>
{project.likes.includes(props.auth.id) ? (
<ClapIcon
arial-label={t(
'projectDetails.ariaLabels.likeButton.unlilke',
<Box display="flex" justifyContent="flex-end">
<Box className={classes.actionBoxStyle}>
<CustomButton
className={classes.actionBoxButtonStyle}
size="small"
aria-label={t(
'projectDetails.ariaLabels.likeButton.label',
)}
variant="extended"
onClick={e =>
handleSetState(toggleLike(e, props, project.id))
}
>
<Box className={classes.iconsBoxStyle}>
{project.likes.includes(props.auth.id) ? (
<ClapIcon
arial-label={t(
'projectDetails.ariaLabels.likeButton.unlilke',
)}
/>
) : (
<ClapBorderIcon
arial-label={t(
'projectDetails.ariaLabels.likeButton.like',
)}
/>
)}
/>
) : (
<ClapBorderIcon
arial-label={t(
'projectDetails.ariaLabels.likeButton.like',
</Box>
<Typography>
{nFormatter(project.likes.length)}
</Typography>
</CustomButton>
<CustomButton
className={classes.actionBoxButtonStyle}
size="small"
aria-label={t(
'projectDetails.ariaLabels.saveButton.label',
)}
onClick={e =>
handleSetState(toggleSave(e, props, project.id))
}
>
<Box className={classes.iconsBoxStyle}>
{project.saved_by.includes(props.auth.id) ? (
<BookmarkIcon
aria-label={t(
'projectDetails.ariaLabels.saveButton.unsave',
)}
/>
) : (
<BookmarkBorderIcon
aria-label={t(
'projectDetails.ariaLabels.saveButton.save',
)}
/>
)}
/>
)}
<Typography>
{nFormatter(project.likes.length)}
</Box>
</CustomButton>
<Typography
color="textSecondary"
variant="caption"
component="span"
className={classes.actionBoxButtonStyle}
>
<Box className={classes.iconsBoxStyle}>
<VisibilityIcon />
</Box>
<Typography>{project.views_count}</Typography>
</Typography>
</CustomButton>
<CustomButton
className={classes.actionBoxButtonStyle}
size="small"
aria-label={t(
'projectDetails.ariaLabels.saveButton.label',
)}
onClick={e =>
handleSetState(toggleSave(e, props, project.id))
}
>
{project.saved_by.includes(props.auth.id) ? (
<BookmarkIcon
aria-label={t(
'projectDetails.ariaLabels.saveButton.unsave',
)}
/>
) : (
<BookmarkBorderIcon
aria-label={t(
'projectDetails.ariaLabels.saveButton.save',
)}
/>
)}
</CustomButton>
<Typography
color="textSecondary"
variant="caption"
component="span"
className={classes.actionBoxButtonStyle}
>
<VisibilityIcon />
<Typography>{project.views_count}</Typography>
</Typography>
</Box>
</Box>
</Grid>
{project.images && project.images.length > 0 ? (
Expand Down Expand Up @@ -492,18 +497,16 @@ function ProjectDetails(props) {
>
<DialogTitle id="delete-project">
<Typography variant="h4">
{t('projectDetails.project.delete.dialog.primary')}
{t('projectDetails.project.delete.dialog.primary')}
</Typography>
</DialogTitle>
{delete_project_dialog_error !== null && (<Box
component="p"
className={classes.errorBox}
>
<Box component="span" className={classes.error}>
{delete_project_dialog_error}
{delete_project_dialog_error !== null && (
<Box component="p" className={classes.errorBox}>
<Box component="span" className={classes.error}>
{delete_project_dialog_error}
</Box>
</Box>

</Box>)}
)}
<DialogContent>
<Typography>
{t('projectDetails.project.delete.dialog.secondary')}
Expand Down