diff --git a/src/components/lineTimetable/lineTimetable.css b/src/components/lineTimetable/lineTimetable.css
index 1883f91b..43595789 100644
--- a/src/components/lineTimetable/lineTimetable.css
+++ b/src/components/lineTimetable/lineTimetable.css
@@ -52,6 +52,12 @@
height: fit-content;
}
+.printBtnContainer {
+ position: absolute;
+ left: 680px;
+ top: 20px;
+}
+
@media print {
.noPrint,
.noPrint * {
diff --git a/src/components/lineTimetable/lineTimetable.js b/src/components/lineTimetable/lineTimetable.js
index 75b42d20..a059b4d9 100644
--- a/src/components/lineTimetable/lineTimetable.js
+++ b/src/components/lineTimetable/lineTimetable.js
@@ -4,6 +4,7 @@ import styles from './lineTimetable.css';
import LineTimetableHeader from './lineTimetableHeader';
import LineTableColumns from './lineTableColumns';
import AllStopsList from './allStopsList';
+import { PrintButton } from '../util';
import {
filter,
uniqBy,
@@ -59,7 +60,6 @@ const hasTimedStopRoutes = routes => {
const RouteDepartures = props => {
const {
- showPrintBtn,
lang,
departuresByStop,
routeIdParsed,
@@ -193,7 +193,6 @@ const RouteDepartures = props => {
routeIdParsed={routeIdParsed}
nameFi={nameFi}
nameSe={nameSe}
- showPrintBtn={showPrintBtn}
lang={lang}
/>
{getScheduleWeekdaysText(key)}
@@ -217,7 +216,6 @@ RouteDepartures.defaultProps = {
routeIdParsed: '',
nameFi: '',
nameSe: '',
- showPrintBtn: '',
lang: '',
departuresByStop: {},
dateBegin: '',
@@ -229,7 +227,6 @@ RouteDepartures.propTypes = {
routeIdParsed: PropTypes.string,
nameFi: PropTypes.string,
nameSe: PropTypes.string,
- showPrintBtn: PropTypes.string,
lang: PropTypes.string,
departuresByStop: PropTypes.object,
dateBegin: PropTypes.string,
@@ -357,11 +354,13 @@ class LineTimetable extends Component {
return (
routeForDateRange.departuresByStop.length > 0 && (
+
+ {this.props.showPrintButton &&
}
+
{hasDepartures && (
+
+ {this.props.showPrintButton &&
}
+
{
const lineQueryMapper = mapProps(props => {
const line = props.data.lines.nodes[0];
- const { showPrintBtn, lang } = props;
+ const { showPrintButton, lang } = props;
const mergedRoutes = mergeExtraRoutes(line.routes.nodes);
@@ -251,7 +251,7 @@ const lineQueryMapper = mapProps(props => {
return {
line: { ...line, notes: filteredNotes },
routes: filterRoutes(routesWithGroupedDepartures),
- showPrintBtn,
+ showPrintButton,
lang,
};
});
@@ -261,7 +261,7 @@ const hoc = compose(graphql(lineQuery), apolloWrapper(lineQueryMapper));
const LineTimetableContainer = hoc(LineTimetable);
LineTimetableContainer.defaultProps = {
- showPrintBtn: false,
+ showPrintButton: false,
lang: 'fi',
printPageNumbers: true,
};
@@ -270,7 +270,7 @@ LineTimetableContainer.propTypes = {
lineId: PropTypes.string.isRequired,
dateBegin: PropTypes.string.isRequired,
dateEnd: PropTypes.string.isRequired,
- showPrintBtn: PropTypes.bool,
+ showPrintButton: PropTypes.bool,
lang: PropTypes.string,
printPageNumbers: PropTypes.bool,
};
diff --git a/src/components/lineTimetable/lineTimetableHeader.css b/src/components/lineTimetable/lineTimetableHeader.css
index c646d365..651de182 100644
--- a/src/components/lineTimetable/lineTimetableHeader.css
+++ b/src/components/lineTimetable/lineTimetableHeader.css
@@ -25,8 +25,3 @@
font-size: 15px;
font-family: GothamRounded-Book;
}
-
-.printBtnContainer {
- display: inline;
- margin-top: 1rem;
-}
diff --git a/src/components/lineTimetable/lineTimetableHeader.js b/src/components/lineTimetable/lineTimetableHeader.js
index e5f8aaaf..38367248 100644
--- a/src/components/lineTimetable/lineTimetableHeader.js
+++ b/src/components/lineTimetable/lineTimetableHeader.js
@@ -5,7 +5,7 @@ import styles from './lineTimetableHeader.css';
import { PrintButton } from '../util';
const LineTimetableHeader = props => {
- const { showPrintBtn, lang, routeIdParsed, nameFi, nameSe } = props;
+ const { routeIdParsed, nameFi, nameSe } = props;
return (
@@ -19,7 +19,6 @@ const LineTimetableHeader = props => {
{nameSe}
-
);
};
@@ -27,16 +26,12 @@ const LineTimetableHeader = props => {
LineTimetableHeader.defaultProps = {
nameFi: '',
nameSe: '',
- showPrintBtn: false,
- lang: 'fi',
};
LineTimetableHeader.propTypes = {
routeIdParsed: PropTypes.string.isRequired,
nameFi: PropTypes.string,
nameSe: PropTypes.string,
- showPrintBtn: PropTypes.bool,
- lang: PropTypes.string,
};
export default LineTimetableHeader;