2020-08-27 13:46:34 +02:00
|
|
|
// Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
|
2020-11-01 05:26:58 +01:00
|
|
|
import { getCongratsInfo } from "./lib";
|
2021-03-26 12:22:37 +01:00
|
|
|
import { setupI18n, ModuleName } from "anki/i18n";
|
2020-11-05 02:01:30 +01:00
|
|
|
import { checkNightMode } from "anki/nightmode";
|
2020-08-27 13:46:34 +02:00
|
|
|
|
2021-03-21 13:47:52 +01:00
|
|
|
import CongratsPage from "./CongratsPage.svelte";
|
|
|
|
|
2020-08-27 13:46:34 +02:00
|
|
|
export async function congrats(target: HTMLDivElement): Promise<void> {
|
|
|
|
checkNightMode();
|
2021-03-26 12:22:37 +01:00
|
|
|
await setupI18n({ modules: [ModuleName.SCHEDULING] });
|
2020-08-27 13:46:34 +02:00
|
|
|
const info = await getCongratsInfo();
|
|
|
|
new CongratsPage({
|
|
|
|
target,
|
2021-03-26 11:23:43 +01:00
|
|
|
props: { info },
|
2020-08-27 13:46:34 +02:00
|
|
|
});
|
|
|
|
}
|