Skip to content

Commit

Permalink
feat: Add the expiration alert to the qualification block
Browse files Browse the repository at this point in the history
  • Loading branch information
PolariTOON committed Dec 1, 2022
1 parent 4093ebe commit 5440245
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions react/Viewer/Panel/Qualification.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, { useRef, useState, createRef, useMemo, useEffect } from 'react'
import PropTypes from 'prop-types'

import { models } from 'cozy-client'

import List from '../../MuiCozyTheme/List'
import { withViewerLocales } from '../hoc/withViewerLocales'
import {
Expand All @@ -14,6 +16,9 @@ import ActionMenuWrapper from './ActionMenuWrapper'
import QualificationListItemDate from './QualificationListItemDate'
import QualificationListItemInformation from './QualificationListItemInformation'
import QualificationListItemOther from './QualificationListItemOther'
import Expiration from './Expiration'

const { isExpiringSoon } = models.paper

const makeQualificationListItemComp = metadataName => {
if (knownDateMetadataNames.includes(metadataName)) {
Expand Down Expand Up @@ -64,6 +69,9 @@ const Qualification = ({ file }) => {

return (
<div className="u-flex u-flex-column" style={{ rowGap: '1rem' }}>
{isExpiringSoon(file) && !file?.metadata?.hideExpirationAlert && (
<Expiration file={file} />
)}
<List className="u-pv-0">
{formatedMetadataQualification.map((meta, idx) => {
const { name } = meta
Expand Down

0 comments on commit 5440245

Please sign in to comment.