Skip to content
Snippets Groups Projects
Commit 80a299cb authored by Yoan VALLET's avatar Yoan VALLET
Browse files

feat: display only mondays for duel > 2 weeks

parent b0abf6ac
Branches
Tags
1 merge request!309feat: display only mondays for duel > 2 weeks
......@@ -15,7 +15,7 @@ interface TextTypeProps {
timeStep: TimeStep
width: number
selectedDate: DateTime
isDuel?: boolean
displayAllDays?: boolean
}
function TextAxis({
......@@ -24,7 +24,7 @@ function TextAxis({
timeStep,
width,
selectedDate,
isDuel,
displayAllDays,
}: TextTypeProps) {
const dateChartService = new DateChartService()
const isSelectedDate = dateChartService.compareStepDate(
......@@ -56,7 +56,7 @@ function TextAxis({
case TimeStep.DAY:
return (
<text y="10" dy="0.71em" transform={`translate(${width})`}>
{isDuel ? (
{displayAllDays ? (
<>
<tspan className={style} x="0" textAnchor="middle">
{dataload.date.toLocaleString({ weekday: 'narrow' })}
......@@ -128,11 +128,12 @@ const AxisBottom: React.FC<AxisBottomProps> = ({
height,
marginLeft,
marginBottom,
isDuel,
isDuel = false,
}: AxisBottomProps) => {
const { selectedDate } = useSelector((state: AppStore) => state.ecolyo.chart)
const dashArray = `${height / 30} ${height / 30}`
const dateChartService = new DateChartService()
const displayAllDays: boolean = isDuel && data.length <= 15
return (
<g
className="axis x"
......@@ -153,7 +154,7 @@ const AxisBottom: React.FC<AxisBottomProps> = ({
timeStep={timeStep}
width={xScale.bandwidth() / 2}
selectedDate={selectedDate}
isDuel={isDuel}
displayAllDays={displayAllDays}
/>
{dateChartService.compareStepDate(
timeStep,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment