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

Add button and link "Back to menu" #21

Merged
merged 1 commit into from
Apr 25, 2016
Merged
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
15 changes: 14 additions & 1 deletion src/containers/LunchDetails/LunchDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import { getReviews } from 'redux/modules/common';
import { getLunch } from 'helpers/lunches';
import classNames from 'classnames';
import ga from 'components/GaEvent/ga';
import Button from 'components/Button/Button';
import { link as stylesLink } from 'components/HeaderMenu/HeaderMenu.scss';
import { Link } from 'react-router';

function isReviews(location) {
return /\/reviews$/.test(location.pathname);
Expand Down Expand Up @@ -90,7 +93,12 @@ export default class LunchDetails extends Component {
</div>
<div className={styles.lunchContainer}>
<div className={styles.header}>
<h1>Обед от {cook.full_name_genitive}</h1>
<div className={styles.headerBackLink}>
<Link className={stylesLink} to="/">
<span>Назад к списку обедов</span>
</Link>
<h1>Обед от {cook.full_name_genitive}</h1>
</div>
<DeliveryPeriod className={styles.deliveryPeriod} time={lunch.ready_by} />
</div>
<div className={styles.previewsContainer}>
Expand All @@ -116,6 +124,11 @@ export default class LunchDetails extends Component {
</div>
</div>
</div>
<div className={styles.mobBackLink}>
<Link to="/">
<Button flat outlined className={classNames(styles.button)} label="К списку обедов"/>
</Link>
</div>
</div>
</div>
</div>
Expand Down
24 changes: 23 additions & 1 deletion src/containers/LunchDetails/LunchDetails.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
.header {
display: flex;
justify-content: space-between;
align-items: center;
align-items: flex-start;
margin: 0.5rem 0;
flex-wrap: wrap;
}
Expand Down Expand Up @@ -116,6 +116,19 @@
padding: 0 1rem;
}

.mobBackLink {
margin-top: 2.5rem;
display: flex;
justify-content: center;
}

.headerBackLink {
display: none;
a {
padding: 0;
}
}

@mixin collapsingContainer($opened, $inner) {
position: absolute;
visibility: hidden;
Expand Down Expand Up @@ -173,6 +186,15 @@
}
}

@media (min-width: 700px ) {
.mobBackLink {
display: none;
}
.headerBackLink {
display: block;
}
}

@media (max-width: 500px) {
.header h1 {
line-height: 1.2;
Expand Down