diff --git a/src/components/stats/ActivityList.tsx b/src/components/stats/ActivityList.tsx index 72a829bb..f3b47c6a 100644 --- a/src/components/stats/ActivityList.tsx +++ b/src/components/stats/ActivityList.tsx @@ -7,12 +7,13 @@ import translation from "@/translations/global.json"; import { useSettingsModalStore } from "@/store/SettingsModalStore"; import formatTime from "@/lib/formatTime"; import { useTimerStore } from "@/store/timerStore"; +import NoActivity from "./NoActivity"; export function ActivityList() { const { lang } = useSettingsModalStore(); const { cubes } = useTimerStore(); - if (!cubes) return null; + if (!cubes || cubes.length === 0) return ; const lastAct: Solve[] = []; cubes.forEach((cube: Cube) => { @@ -24,6 +25,8 @@ export function ActivityList() { }); }); + if (lastAct.length === 0) return ; + const sorted = sort(lastAct).desc((u) => u.endTime); return sorted.slice(0, 10).map((solve, index) => { const cube = findCube({ cubeId: solve.cubeId }); diff --git a/src/components/stats/NoActivity.tsx b/src/components/stats/NoActivity.tsx new file mode 100644 index 00000000..f1ac35d7 --- /dev/null +++ b/src/components/stats/NoActivity.tsx @@ -0,0 +1,21 @@ +import InformationBell from "@/icons/InformationBell"; +import { useSettingsModalStore } from "@/store/SettingsModalStore"; +import translation from "@/translations/global.json"; + +export default function NoActivity() { + const { lang } = useSettingsModalStore(); + + return ( + <> +
+ +
+ {translation.metrics["no-activity-found"][lang]} +
+
+ {translation.metrics["no-activity-to-display"][lang]} +
+
+ + ); +} diff --git a/src/components/stats/PersonalChartsContainer.tsx b/src/components/stats/PersonalChartsContainer.tsx index 5dcc0356..1a945944 100644 --- a/src/components/stats/PersonalChartsContainer.tsx +++ b/src/components/stats/PersonalChartsContainer.tsx @@ -5,7 +5,9 @@ interface PersonalChartsContainer { export function PersonalChartsContainer({ children }: PersonalChartsContainer) { return ( <> -
{children}
+
+ {children} +
); } diff --git a/src/components/stats/PersonalStatistics.tsx b/src/components/stats/PersonalStatistics.tsx index 5fb2a612..4ec5e34f 100644 --- a/src/components/stats/PersonalStatistics.tsx +++ b/src/components/stats/PersonalStatistics.tsx @@ -19,9 +19,7 @@ import Trophy from "@/icons/Trophy"; import translation from "@/translations/global.json"; import { useSettingsModalStore } from "@/store/SettingsModalStore"; import RadarCharter from "../charts/RadarCharter"; -import PieCharter from "../charts/PieCharter"; import getTotalCategoryPlay from "@/lib/getTotalCategoryPlay"; -import getCategoryTotalRatingPoints from "@/lib/getCategoryTotalRatingPoints"; import getSuccessRate from "@/lib/getSuccessRate"; import { PersonalContainer } from "./PersonalContainer"; import { PersonalCardsContainer } from "./PersonalCardsContainer"; @@ -39,7 +37,7 @@ export default function PersonalStatistics() { const cuberTitle = getTitleByPoints(totalNumeric); const rate = getSuccessRate(cubes); const data01 = getTotalCategoryPlay(cubes); - const data02 = getCategoryTotalRatingPoints(cubes); + return ( <> @@ -93,17 +91,11 @@ export default function PersonalStatistics() { /> -
+
-
- {translation.metrics["cube-insights"][lang]} -
-
- -
- {translation.metrics["rating-spread"][lang]} -
+
+ {translation.metrics["cube-insights"][lang]}
diff --git a/src/icons/InformationBell.tsx b/src/icons/InformationBell.tsx new file mode 100644 index 00000000..275037b3 --- /dev/null +++ b/src/icons/InformationBell.tsx @@ -0,0 +1,20 @@ +export default function InformationBell() { + return ( + <> + + + + + ); +} diff --git a/src/translations/global.json b/src/translations/global.json index b220f713..a1e75f8c 100644 --- a/src/translations/global.json +++ b/src/translations/global.json @@ -1753,6 +1753,74 @@ "et": "Viimane tegevus" }, + "no-activity-found": { + "en": "No activity found", + "es": "Ninguna actividad encontrada", + "fr": "Aucune activité trouvée", + "de": "Keine Aktivität gefunden", + "ja": "アクティビティが見つかりません", + "zh": "未找到任何活动", + "ru": "Активность не найдена", + "hi": "कोई गतिविधि नहीं मिली", + "pt": "Nenhuma atividade encontrada", + "it": "Nessuna attività trovata", + "ko": "활동이 없습니다", + "nl": "Geen activiteit gevonden", + "sv": "Ingen aktivitet hittades", + "tr": "Hiçbir etkinlik bulunamadı", + "pl": "Nie znaleziono żadnej aktywności", + "vi": "Không tìm thấy hoạt động nào", + "th": "ไม่พบกิจกรรม", + "el": "Δεν βρέθηκε καμία δραστηριότητα", + "fi": "Ei löydetty toimintaa", + "uk": "Жодної активності не знайдено", + "cs": "Žádná aktivita nenalezena", + "ro": "Nicio activitate găsită", + "no": "Ingen aktivitet funnet", + "da": "Ingen aktivitet fundet", + "ms": "Tiada aktiviti ditemui", + "hu": "Nincs tevékenység", + "id": "Tidak ada aktivitas ditemukan", + "bn": "কোনও কার্যকলাপ খুঁজে পাওয়া যায়নি", + "sk": "Žiadna aktivita nenájdená", + "fil": "Walang natagpuang aktibidad", + "et": "Tegevust ei leitud" + }, + + "no-activity-to-display": { + "en": "There is no activity to display", + "es": "No hay actividad para mostrar", + "fr": "Aucune activité à afficher", + "de": "Es gibt keine Aktivität zum Anzeigen", + "ja": "表示するアクティビティはありません", + "zh": "没有要显示的活动", + "ru": "Нет активности для отображения", + "hi": "प्रदर्शित करने के लिए कोई गतिविधि नहीं है", + "pt": "Não há atividade para exibir", + "it": "Non ci sono attività da mostrare", + "ko": "표시할 활동이 없습니다", + "nl": "Er is geen activiteit om weer te geven", + "sv": "Det finns ingen aktivitet att visa", + "tr": "Gösterilecek etkinlik yok", + "pl": "Brak aktywności do wyświetlenia", + "vi": "Không có hoạt động để hiển thị", + "th": "ไม่มีกิจกรรมที่จะแสดง", + "el": "Δεν υπάρχει δραστηριότητα για εμφάνιση", + "fi": "Näytettävää toimintaa ei ole", + "uk": "Немає активності для відображення", + "cs": "Žádná aktivita k zobrazení", + "ro": "Nu există nicio activitate de afișat", + "no": "Ingen aktivitet å vise", + "da": "Ingen aktivitet at vise", + "ms": "Tiada aktiviti untuk dipaparkan", + "hu": "Nincs megjeleníthető tevékenység", + "id": "Tidak ada aktivitas yang dapat ditampilkan", + "bn": "প্রদর্শন করার জন্য কোনও কার্যকলাপ নেই", + "sk": "Žiadna aktivita na zobrazenie", + "fil": "Walang aktibidad na maipapakita", + "et": "Näitamiseks pole tegevust" + }, + "select-cube-metrics-default": { "en": "All", "es": "Todo",