mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-30 05:34:33 +08:00

* [questions][ui] Add DiscardDraftModal * [questions][ui] add question draft dialog form * [questions][ui] refactor bottom contribute bar * [questions][ui] landing page * [questions][ui] add similar question card * [questions][ui] use TIH dialog for discard * [questions][ui] add aria-hidden for select label * [questions][ui] extract useFormRegister hook * [questions][ui] change landing page to component * [questions][ui] load filter from query param * [question][chore] add constants.ts * [questions][ui] add app logo * [questions][ui] remove form * [questions][ui] fix dialog closing * [questions][chore] minor changes * [questions][ui] radio button * [questions][ui] add vertical scrolling * [questions][ui] Question age url param change * [questions][chore] refactor and add in todo * [questions][ui] contribute card clickable * [questions][ui] landing page github stars * [questions][ui] edit css for question card * [question][ui] add question detail page * [questions][ui] remove navbar import * [questions][ui] css changes * [questions][ui] hide sidebar * [questions][ui] contribute questions form ui * [questions][ui] question page * [questions][bug] remove button * [questions][ui] voting button size * [questions][chore] add dummy data, refactor * [questions][ui] answer card * [questions][chore] add sample data * [questions][ui] add hover * [questions][ui] clean up old href * [questions][ui] add comments & commments page * [question][feat] cache filter options to localStorage * [questions][fix] fix index refreshing constantly * [questions][ui] set fixed sample date Co-authored-by: Jeff Sieu <jeffsy00@gmail.com>
31 lines
705 B
TypeScript
31 lines
705 B
TypeScript
import { Button, Dialog } from '@tih/ui';
|
|
|
|
export type DiscardDraftDialogProps = {
|
|
onCancel: () => void;
|
|
onDiscard: () => void;
|
|
show: boolean;
|
|
};
|
|
export default function DiscardDraftDialog({
|
|
show,
|
|
onCancel,
|
|
onDiscard,
|
|
}: DiscardDraftDialogProps) {
|
|
return (
|
|
<Dialog
|
|
isShown={show}
|
|
primaryButton={
|
|
<Button label="Discard" variant="primary" onClick={onDiscard} />
|
|
}
|
|
secondaryButton={
|
|
<Button label="Cancel" variant="tertiary" onClick={onCancel} />
|
|
}
|
|
title="Discard draft"
|
|
onClose={onCancel}>
|
|
<p>
|
|
Are you sure you want to discard the current draft? This action cannot
|
|
be undone.
|
|
</p>
|
|
</Dialog>
|
|
);
|
|
}
|