Skip to content

Commit c6a8046

Browse files
committed
fix after #338
1 parent 3d8b52d commit c6a8046

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

web/src/ui/datetimeUtils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ export const { getFormattedDate } = (() => {
3636
export function useFormattedDate(params: {
3737
time: number;
3838
doAlwaysShowYear?: boolean;
39+
showTime?: boolean;
3940
}): string {
40-
const { time, doAlwaysShowYear } = params;
41+
const { time, doAlwaysShowYear, showTime } = params;
4142

4243
const { lang } = useLang();
4344

4445
return useMemo(
45-
() => getFormattedDate({ time, lang, doAlwaysShowYear }),
46+
() => getFormattedDate({ time, lang, doAlwaysShowYear, showTime }),
4647
[time, lang]
4748
);
4849
}

web/src/ui/pages/softwareDetails/PreviewTab.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useLang } from "ui/i18n";
22
import { Trans, useTranslation } from "react-i18next";
33
import { fr } from "@codegouvfr/react-dsfr";
44
import { tss } from "tss-react";
5-
import { shortEndMonthDate, monthDate } from "ui/datetimeUtils";
5+
import { shortEndMonthDate, monthDate, useFormattedDate } from "ui/datetimeUtils";
66
import Tooltip from "@mui/material/Tooltip";
77
import { capitalize } from "tsafe/capitalize";
88
import { CnllServiceProviderModal } from "./CnllServiceProviderModal";
@@ -11,7 +11,6 @@ import config from "../../config-ui.json";
1111
import type { ApiTypes } from "api";
1212
import { SoftwareTypeTable } from "ui/shared/SoftwareTypeTable";
1313
import { LogoURLButton } from "ui/shared/LogoURLButton";
14-
import { Chip } from "@mui/material";
1514

1615
//TODO: Do not use optional props (?) use ( | undefined ) instead
1716
// so we are sure that we don't forget to provide some props
@@ -75,13 +74,6 @@ export const PreviewTab = (props: Props) => {
7574
const { t } = useTranslation();
7675
const { lang } = useLang();
7776

78-
const scoreToLabel = (score: number) => {
79-
if (score < 0.1) return "error";
80-
if (score < 0.34) return "warning";
81-
if (score < 0.67) return "info";
82-
return "success";
83-
};
84-
8577
return (
8678
<>
8779
<section className={classes.tabContainer}>

0 commit comments

Comments
 (0)