diff --git a/packages/css-framework/src/components/_timeline.scss b/packages/css-framework/src/components/_timeline.scss index 75ccde7844..dac7765e9f 100644 --- a/packages/css-framework/src/components/_timeline.scss +++ b/packages/css-framework/src/components/_timeline.scss @@ -64,30 +64,30 @@ $timeline-row-header-width: 16rem; } } -.timeline__navigation { - position: absolute; - top: 1rem; - left: 1rem; +// .timeline__navigation { +// position: absolute; +// top: 1rem; +// left: 1rem; - button { - &:first-of-type { - margin-right: f.spacing("4"); - } +// button { +// &:first-of-type { +// margin-right: f.spacing("4"); +// } - span:first-of-type { - display: none; - } +// span:first-of-type { +// display: none; +// } - .rn-btn__icon { - margin-left: 0; - } - } -} +// .rn-btn__icon { +// margin-left: 0; +// } +// } +// } -.timeline__months, -.timeline__months--renderDefault { - white-space: nowrap; -} +// .timeline__months, +// .timeline__months--renderDefault { +// white-space: nowrap; +// } // .timeline__month--renderDefault { // position: relative; diff --git a/packages/react-component-library/src/components/Timeline/TimelineMonths.tsx b/packages/react-component-library/src/components/Timeline/TimelineMonths.tsx index 3de3fe83e5..f255ed0630 100755 --- a/packages/react-component-library/src/components/Timeline/TimelineMonths.tsx +++ b/packages/react-component-library/src/components/Timeline/TimelineMonths.tsx @@ -1,5 +1,7 @@ import React from 'react' import { IconChevronRight, IconChevronLeft } from '@royalnavy/icon-library' +import styled from 'styled-components' +import { Spacing4 } from '@royalnavy/design-tokens' import { ComponentWithClass } from '../../common/ComponentWithClass' import { getKey } from '../../helpers' @@ -27,6 +29,30 @@ export type TimelineMonthsProps = | TimelineMonthsWithRenderContentProps | TimelineMonthsWithChildrenProps +const Navigation = styled.div` + position: absolute; + top: 1rem; + left: 1rem; + + button { + &:first-of-type { + margin-right: ${Spacing4}; + } + + span:first-of-type { + display: none; + } + + .rn-btn__icon { + margin-left: 0; + } + } +` + +const StyledTimelineMonths = styled.div` + white-space: nowrap; +` + export const TimelineMonths: React.FC = ({ render }) => ( {({ @@ -42,7 +68,7 @@ export const TimelineMonths: React.FC = ({ render }) => ( name="Months" renderRowHeader={(name) => ( <> -
@@ -60,12 +86,12 @@ export const TimelineMonths: React.FC = ({ render }) => ( onClick={(_) => dispatch({ type: TIMELINE_ACTIONS.GET_NEXT })} data-testid="timeline-side-button-right" /> -
+ {name} )} > -
+ {months.map(({ startDate }, index) => ( = ({ render }) => ( startDate={startDate} /> ))} -
+ )}