Skip to content

Commit

Permalink
tlačítka pro přepínání týdnu v diáři už neodskakují podle délky data …
Browse files Browse the repository at this point in the history
…v titulku
  • Loading branch information
rodlukas committed Sep 16, 2018
1 parent ed6ec11 commit 371ce2f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions frontend/src/pages/Diary.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@
.arrowBtn {
cursor: pointer
}

.TitleDate {
width: 6ch; /* aby mely dny v tydennim prehledu vzdy stejnou sirku */
display: inline-block;
}
11 changes: 9 additions & 2 deletions frontend/src/pages/Diary.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,20 @@ export default class Diary extends Component {
}

render() {
const title = "Týden " + prettyDateWithYearIfDiff(this.getRequiredMonday()) + " – " + prettyDateWithYearIfDiff(this.getFridayDate())
const TitleDate = ({date}) =>
<span className="TitleDate">
{prettyDateWithYearIfDiff(date)}
</span>
const Title = () =>
<Fragment>
{' '}Týden <TitleDate date={this.getRequiredMonday()}/><TitleDate date={this.getFridayDate()}/>{' '}
</Fragment>
const HeadingContent = () =>
<Fragment>
<Link to={this.getPrevMondaySerialized()}>
<FontAwesomeIcon icon={faArrowAltCircleLeft} className="arrowBtn text-muted"/>
</Link>
{" " + title + " "}
<Title/>
<Link to={this.getNextMondaySerialized()}>
<FontAwesomeIcon icon={faArrowAltCircleRight} className="arrowBtn text-muted"/>
</Link>
Expand Down

0 comments on commit 371ce2f

Please sign in to comment.