Skip to content

Commit bd47912

Browse files
committed
fix after #338
1 parent 1490a42 commit bd47912

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
@@ -77,13 +76,6 @@ export const PreviewTab = (props: Props) => {
7776
const { t } = useTranslation();
7877
const { lang } = useLang();
7978

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

0 commit comments

Comments
 (0)