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

feat: makes some design improvement #948

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions zubhub_frontend/zubhub/src/assets/images/access-denied.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

135 changes: 135 additions & 0 deletions zubhub_frontend/zubhub/src/assets/images/no-bookmarks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
135 changes: 135 additions & 0 deletions zubhub_frontend/zubhub/src/assets/images/no-draft.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions zubhub_frontend/zubhub/src/assets/images/no-projects.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions zubhub_frontend/zubhub/src/assets/images/search-error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,13 @@ function PreviewActivity({ onClose, ...props }) {
</div>
);
} else {
return <ErrorPage error={t('projectDetails.errors.unexpected')} />;
return <ErrorPage
error={t('projectDetails.errors.unexpected')}
imgSrc={NoProjects}
routeTitle='Create Project'
routeLink='/create-project'
errorTitle='No projects found'
/>;
}
}

Expand Down
23 changes: 19 additions & 4 deletions zubhub_frontend/zubhub/src/views/error/ErrorPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import { Box, Typography, Container } from '@material-ui/core';

import disconnected from '../../assets/images/disconnected-chains.svg';
import styles from '../../assets/js/styles/views/error/errorPageStyles';
import CustomButton from '../../components/button/Button';
import { Link } from 'react-router-dom';

const useStyles = makeStyles(styles);

Expand All @@ -21,21 +22,35 @@ function ErrorPage(props) {
return (
<Box className={classes.root} style={propStyle ? propStyle : null}>
<Container className={classes.mainContainerStyle}>
<img className={classes.disconnectedStyle} src={disconnected} alt={props.error} />
<img className={classes.disconnectedStyle} src={props.imgSrc} alt={props.error} />
<Box className={classes.errorBoxStyle}>
<Typography variant="h1">Oops!!</Typography>
<Typography style={{ marginBottom: 50 }} variant="h5">
<Typography variant="h3">{props.errorTitle}</Typography>
<Typography variant="h5">
{props.error}
</Typography>
{props.children}
</Box>
<Link to={props.routeLink}>
<CustomButton
variant="outlined"
size="large"
secondaryButtonStyle
customButtonStyle
>
{props.routeTitle}
</CustomButton>
</Link>
</Container>
</Box>
);
}

ErrorPage.propTypes = {
routeLink: PropTypes.string.isRequired,
routeTitle: PropTypes.string.isRequired,
errorTitle: PropTypes.string,
error: PropTypes.string.isRequired,
imgSrc: PropTypes.string,
};

export default ErrorPage;
10 changes: 8 additions & 2 deletions zubhub_frontend/zubhub/src/views/projects/Projects.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function Projects(props) {
lg={4}
item
align="center"
// className={classes.projectGridStyle}
// className={classes.projectGridStyle}
>
<Project
project={project}
Expand Down Expand Up @@ -273,7 +273,13 @@ function Projects(props) {
</>
);
} else {
return <ErrorPage error={t('projects.errors.unexpected')} />;
return <ErrorPage
error={t('projects.errors.unexpected')}
imgSrc={NoProjects}
routeTitle='Create Project'
routeLink='/create-project'
errorTitle='No projects yet'
/>
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import LoadingPage from '../loading/LoadingPage';
import Project from '../../components/project/Project';
import styles from '../../assets/js/styles/views/search_results/searchResultsStyles';
import commonStyles from '../../assets/js/styles';
import NoProjects from '../../assets/images/no-projects.svg'

const useStyles = makeStyles(styles);
const useCommonStyles = makeStyles(commonStyles);
Expand Down Expand Up @@ -257,6 +258,10 @@ function SearchResults(props) {
) : (
<ErrorPage
error={t('searchResults.errors.noResult')}
imgSrc={NoProjects}
routeTitle='Create Project'
routeLink='/create-project'
errorTitle='No projects found'
/>
)}
</Box>
Expand Down