anki/ts/congrats/CongratsPage.svelte
Henrik Giesel 30bbbaf00b
Use eslint for sorting our imports (#1637)
* Make eslint sort our imports

* fix missing deps in eslint rule (dae)

Caught on Linux due to the stricter sandboxing

* Remove exports-last eslint rule (for now?)

* Adjust browserslist settings

- We use ResizeObserver which is not supported in browsers like KaiOS,
  Baidu or Android UC

* Raise minimum iOS version 13.4

- It's the first version that supports ResizeObserver

* Apply new eslint rules to sort imports
2022-02-04 18:36:34 +10:00

87 lines
2.4 KiB
Svelte

<!--
Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import Col from "../components/Col.svelte";
import Container from "../components/Container.svelte";
import { bridgeLink } from "../lib/bridgecommand";
import * as tr from "../lib/ftl";
import type { Scheduler } from "../lib/proto";
import { buildNextLearnMsg } from "./lib";
export let info: Scheduler.CongratsInfoResponse;
const congrats = tr.schedulingCongratulationsFinished();
let nextLearnMsg: string;
$: nextLearnMsg = buildNextLearnMsg(info);
const today_reviews = tr.schedulingTodayReviewLimitReached();
const today_new = tr.schedulingTodayNewLimitReached();
const unburyThem = bridgeLink("unbury", tr.schedulingUnburyThem());
const buriedMsg = tr.schedulingBuriedCardsFound({ unburyThem });
const customStudy = bridgeLink("customStudy", tr.schedulingCustomStudy());
const customStudyMsg = tr.schedulingHowToCustomStudy({
customStudy,
});
</script>
<Container --gutter-block="1rem" --gutter-inline="2px" breakpoint="sm">
<Col --col-justify="center">
<div class="congrats">
<h3>{congrats}</h3>
<p>{nextLearnMsg}</p>
{#if info.reviewRemaining}
<p>{today_reviews}</p>
{/if}
{#if info.newRemaining}
<p>{today_new}</p>
{/if}
{#if info.bridgeCommandsSupported}
{#if info.haveSchedBuried || info.haveUserBuried}
<p>
{@html buriedMsg}
</p>
{/if}
{#if !info.isFilteredDeck}
<p>
{@html customStudyMsg}
</p>
{/if}
{/if}
{#if info.deckDescription}
<div class="description">
{@html info.deckDescription}
</div>
{/if}
</div>
</Col>
</Container>
<style lang="scss">
.congrats {
max-width: 30em;
font-size: var(--base-font-size);
:global(a) {
color: var(--link);
text-decoration: none;
}
h3 {
font-weight: bold;
}
}
.description {
border: 1px solid var(--border);
padding: 1em;
}
</style>