feat: notification preview on theme editor

This commit is contained in:
Zamitto
2025-05-16 16:18:19 -03:00
parent 39c073634c
commit bc06ae5c03
13 changed files with 347 additions and 100 deletions

View File

@@ -1,3 +1,8 @@
import {
AchievementCustomNotificationPosition,
AchievementNotificationInfo,
} from "@types";
export enum Downloader {
RealDebrid,
Torrent,

View File

@@ -16,6 +16,7 @@ import {
import { charMap } from "./char-map";
import { Downloader } from "./constants";
import { format } from "date-fns";
import { AchievementNotificationInfo } from "@types";
export * from "./constants";
@@ -175,3 +176,24 @@ export const formatDate = (
if (isNaN(new Date(date).getDate())) return "N/A";
return format(date, language == "en" ? "MM-dd-yyyy" : "dd/MM/yyyy");
};
export const generateAchievementCustomNotificationTest = (
t: any,
language?: string
): AchievementNotificationInfo => {
return {
title: t("test_achievement_notification_title", {
ns: "notifications",
lng: language ?? "en",
}),
description: t("test_achievement_notification_description", {
ns: "notifications",
lng: language ?? "en",
}),
iconUrl: "https://cdn.losbroxas.org/favicon.svg",
points: 100,
isHidden: false,
isRare: false,
isPlatinum: false,
};
};