@@ -2,7 +2,12 @@ import React, { useEffect, useState, useMemo } from 'react';
22import dynamic from 'next/dynamic' ;
33import { GetStaticProps , GetStaticPaths } from 'next' ;
44import { useTranslation } from 'next-i18next' ;
5- import { _cs , bound , listToMap } from '@togglecorp/fujs' ;
5+ import {
6+ _cs ,
7+ bound ,
8+ listToMap ,
9+ isDefined ,
10+ } from '@togglecorp/fujs' ;
611import { serverSideTranslations } from 'next-i18next/serverSideTranslations' ;
712import {
813 IoDownloadOutline ,
@@ -449,11 +454,11 @@ function Project(props: Props) {
449454 </ div >
450455 </ div >
451456 < div className = { styles . chartContainer } >
452- { chartPoints . length > 1 ? (
453- < div
454- ref = { svgContainerRef }
455- className = { styles . timelineChartContainer }
456- >
457+ < div
458+ ref = { svgContainerRef }
459+ className = { styles . timelineChartContainer }
460+ >
461+ { ( isDefined ( projectHistory ) && chartPoints . length > 1 ) ? (
457462 < svg className = { styles . timelineChart } >
458463 < defs >
459464 < linearGradient
@@ -522,15 +527,15 @@ function Project(props: Props) {
522527 d = { getPathData ( chartPoints ) }
523528 />
524529 </ svg >
525- </ div >
526- ) : (
527- < div className = { styles . emptyChart } >
528- < IoStatsChartSharp className = { styles . chartIcon } / >
529- < div className = { styles . message } >
530- Not enough data points for the chart!
530+ ) : (
531+ < div className = { styles . emptyChart } >
532+ < IoStatsChartSharp className = { styles . chartIcon } / >
533+ < div className = { styles . message } >
534+ Not enough data points for the chart!
535+ </ div >
531536 </ div >
532- </ div >
533- ) }
537+ ) }
538+ </ div >
534539 </ div >
535540 </ div >
536541 </ Section >
0 commit comments