Skip to content

Commit

Permalink
feat(match): new match template
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkz committed Jan 27, 2025
1 parent 01f2f0d commit e9aae21
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-coins-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'anki-templates': minor
---

feat(match): new match template
2 changes: 1 addition & 1 deletion build/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const items: ConfigItem[] = [
{
key: 'entry',
len: 5,
variants: ['mcq', 'tf', 'basic', 'mcq_10'],
variants: ['mcq', 'tf', 'basic', 'mcq_10', 'match'],
},
{
key: 'locale',
Expand Down
2 changes: 1 addition & 1 deletion src/entries/basic.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CardShell } from '../components/card-shell';
import { CardShell } from '@/components/card-shell';
import { FIELD_ID } from '@/utils/const';
import { isFieldEmpty } from '@/utils/field';
import * as t from 'at/i18n';
Expand Down
23 changes: 23 additions & 0 deletions src/entries/match.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { CardShell } from '@/components/card-shell';
import { FIELD_ID } from '@/utils/const';
import { isFieldEmpty } from '@/utils/field';
import * as t from 'at/i18n';
import { AnkiField } from 'at/virtual/field';

export default () => {
const hasNote = !isFieldEmpty(FIELD_ID('note'));

return (
<CardShell
title={t.question}
answer={
hasNote ? (
<AnkiField
name="note"
className={'prose prose-sm dark:prose-invert'}
/>
) : null
}
/>
);
};

0 comments on commit e9aae21

Please sign in to comment.