Add Learn and Quiz buttons to EntryCard component
This commit is contained in:
@@ -7,8 +7,11 @@ interface Props {
|
||||
|
||||
export default function EntryCard({ entry }: Props) {
|
||||
const { counts } = entry;
|
||||
const learnLink = `/entry/${encodeURIComponent(entry.id)}`;
|
||||
const quizLink = `/quiz?mode=entry&id=${encodeURIComponent(entry.id)}`;
|
||||
|
||||
return (
|
||||
<Link to={`/entry/${encodeURIComponent(entry.id)}`} className="entry-card">
|
||||
<div className="entry-card">
|
||||
<div className="entry-card__title">{entry.title}</div>
|
||||
<div className="entry-card__meta">
|
||||
<span className="pill">{entry.mode || 'mixed'}</span>
|
||||
@@ -21,6 +24,14 @@ export default function EntryCard({ entry }: Props) {
|
||||
<span>Conversation {counts.conversation}</span>
|
||||
<span>Quiz {counts.quiz}</span>
|
||||
</div>
|
||||
<div className="entry-card__actions">
|
||||
<Link className="button button--ghost" to={learnLink}>
|
||||
Learn
|
||||
</Link>
|
||||
<Link className="button" to={quizLink}>
|
||||
Quiz
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user