Skip to content

Commit

Permalink
Add button and link "Back to menu"
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenkaGo committed Apr 25, 2016
1 parent 7484479 commit 3bd1879
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
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

0 comments on commit 3bd1879

Please sign in to comment.