Skip to content

Commit

Permalink
refactor: do not show project period component only when both date ar…
Browse files Browse the repository at this point in the history
…e missing
  • Loading branch information
dmijatovic committed Aug 17, 2023
1 parent f1ad4d9 commit 1c7d5c5
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions frontend/components/projects/overview/cards/ProjectPeriod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,15 @@

import PeriodProgressBar from '~/components/charts/progress/PeriodProgressBar'
import ProjectDuration from './ProjectDuration'
import {ProjectStatusKey} from '~/types/Project'

type ProjectPeriodProps = {
date_start: string | null
date_end: string | null
project_status: ProjectStatusKey
}

export default function ProjectPeriod({date_start, date_end, project_status}: ProjectPeriodProps) {
// if status unknown we do not show project period
if (project_status==='unknown') return null

// when project is finished we only show dates
// if (project_status === 'finished') {
// return (
// <ProjectDuration
// date_start={date_start}
// date_end={date_end}
// />
// )
// }
export default function ProjectPeriod({date_start, date_end}: ProjectPeriodProps) {
// if both dates are missing we do not show project period
if (!date_start && !date_end) return null

// show both dates and progressbar
return (
Expand Down

0 comments on commit 1c7d5c5

Please sign in to comment.