Skip to content

Commit

Permalink
Merge pull request #12 from TickLabVN/sub-feature/top-up-wallet
Browse files Browse the repository at this point in the history
Sub feature/top up wallet
  • Loading branch information
ngyngcphu committed Oct 1, 2023
2 parents 8904e71 + 44ce0b0 commit 26ac74d
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/order/ConfirmOrderForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ export function ConfirmOrderForm() {
return (
<>
<div>ConfirmOrderForm</div>
<Button onClick={() => setOrderStep(4)}>Confirm</Button>
<Button onClick={() => setOrderStep(5)}>Confirm</Button>
<Button onClick={() => setOrderStep(2)}>Back</Button>
<Button onClick={() => setOrderStep(4)}>Print wallet</Button>
</>
);
}
15 changes: 15 additions & 0 deletions src/components/order/OrderSuccessForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Button } from '@material-tailwind/react';
import { useOrderWorkflowStore } from '@states/order';

// Tue's second-task in here.
export function OrderSuccessForm() {
const { setOrderStep } = useOrderWorkflowStore();

return (
<>
<div>OrderSuccessForm</div>
<Button onClick={() => setOrderStep(5)}>Track this order</Button>
<Button onClick={() => setOrderStep(3)}>Back</Button>
</>
);
}
12 changes: 11 additions & 1 deletion src/components/order/OrderWorkflowBox.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { useState } from 'react';
import { Dialog, DialogBody } from '@material-tailwind/react';
import { UploadDocumentForm, OrderListForm, ConfirmOrderForm } from '@components/order';
import {
UploadDocumentForm,
OrderListForm,
ConfirmOrderForm,
TopupWalletForm,
OrderSuccessForm
} from '@components/order';
import { useOrderWorkflowStore } from '@states/order';

export function useOrderWorkflowBox() {
Expand All @@ -14,6 +20,10 @@ export function useOrderWorkflowBox() {
return <OrderListForm />;
} else if (orderStep === 3) {
return <ConfirmOrderForm />;
} else if (orderStep === 4) {
return <TopupWalletForm />;
} else if (orderStep === 5) {
return <OrderSuccessForm />;
}
};

Expand Down
14 changes: 14 additions & 0 deletions src/components/order/TopupWalletForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Button } from '@material-tailwind/react';
import { useOrderWorkflowStore } from '@states/order';

// Tue's first-task in here.
export function TopupWalletForm() {
const { setOrderStep } = useOrderWorkflowStore();

return (
<>
<div>TopupWalletForm</div>
<Button onClick={() => setOrderStep(3)}>Top up wallet</Button>
</>
);
}
2 changes: 2 additions & 0 deletions src/components/order/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

export * from './ConfirmOrderForm';
export * from './OrderListForm';
export * from './OrderSuccessForm';
export * from './OrderWorkflowBox';
export * from './TopupWalletForm';
export * from './UploadDocumentForm';

0 comments on commit 26ac74d

Please sign in to comment.