feat: implement translation for days (#784)

implement trranslation for weekdays

Co-authored-by: boojack <stevenlgtm@gmail.com>
This commit is contained in:
Jasper Platenburg
2022-12-20 14:10:25 +01:00
committed by GitHub
parent b6fe4d914e
commit 6596e6893e
9 changed files with 134 additions and 4 deletions

View File

@ -1,5 +1,6 @@
import { useCallback, useEffect, useRef, useState } from "react";
import { useLocationStore, useMemoStore, useUserStore } from "../store/module";
import { useTranslation } from "react-i18next";
import { getMemoStats } from "../helpers/api";
import { DAILY_TIMESTAMP } from "../helpers/consts";
import * as utils from "../helpers/utils";
@ -27,6 +28,7 @@ interface DailyUsageStat {
}
const UsageHeatMap = () => {
const { t } = useTranslation();
const locationStore = useLocationStore();
const userStore = useUserStore();
const memoStore = useMemoStore();
@ -97,13 +99,13 @@ const UsageHeatMap = () => {
return (
<div className="usage-heat-map-wrapper" ref={containerElRef}>
<div className="day-tip-text-container">
<span className="tip-text">Sun</span>
<span className="tip-text">{t("days.sun")}</span>
<span className="tip-text"></span>
<span className="tip-text">Tue</span>
<span className="tip-text">{t("days.tue")}</span>
<span className="tip-text"></span>
<span className="tip-text">Thu</span>
<span className="tip-text">{t("days.thu")}</span>
<span className="tip-text"></span>
<span className="tip-text">Sat</span>
<span className="tip-text">{t("days.sat")}</span>
</div>
<div className="usage-heat-map">
{allStat.map((v, i) => {