Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wallet): add wallet desktop #32

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { MAIN_MENU, SUB_MENU } from '@constants';
import { useUserQuery } from '@hooks';
import { AppLayout, AuthLayout } from '@layouts';
import { AuthPage, HomePage } from '@pages';
import { TopUpWalletFormDestop } from '@components/order/desktop';

export default function App() {
const navigate: NavigateFunction = useNavigate();
Expand Down Expand Up @@ -75,6 +76,12 @@ export default function App() {
name: SUB_MENU.help,
element: <></>
},
{
type: 'sub-item',
path: '/wallet',
name: SUB_MENU.wallet,
element: <TopUpWalletFormDestop />
},
{
type: 'sub-item',
path: '/settings',
Expand Down
Binary file added src/assets/VNPay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/momo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/zalo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions src/components/order/desktop/TopUpWalletFormDesktop.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import { InformationCircleIcon, BanknotesIcon, WalletIcon } from '@heroicons/react/24/outline';
import { Button, Radio } from '@material-tailwind/react';
import coinImage from '@assets/coin.png';
import momoImage from '@assets/momo.png';
import zaloImage from '@assets/zalo.png';
import VNPayImage from '@assets/VNPay.png';
export const TopUpWalletFormDestop = () => {
const currentBalance = 202;
const amountList = [10000, 20000, 50000, 100000, 200000, 500000];
const bonus = 20;
const amountLevel = 100000;
const methodList = [
{
image: momoImage,
method: 'Momo'
},
{
image: zaloImage,
method: 'Zalo'
},
{
image: VNPayImage,
method: 'VNPay'
}
];
return (
<div className='px-60 py-9 flex flex-col gap-6'>
<div className='flex gap-3 bg-white px-6 py-4'>
<InformationCircleIcon width={24} className='text-blue/1' />
<span>Exchange rate</span>
</div>
<div className='bg-white px-6 py-4'>
<div className='flex gap-3 mb-4'>
<BanknotesIcon width={24} className='text-blue/1' />
<span>Top up wallet</span>
</div>
<div className='flex gap-2'>
<span>Current balance:</span>
<div className='flex'>
<img src={coinImage} className='w-6 h-6 mr-1 opacity-50 mix-blend-luminosity' />
<span>{currentBalance}</span>
</div>
</div>
<input
type='text'
className='px-4 w-full h-[120px] border-2 border-slate-400 mt-2 rounded-lg mb-4'
placeholder='Top up amount'
/>
<div className='flex gap-2 mb-4'>
{amountList.map((amount) => (
<Button className='px-6 py-4 bg bg-blue-300'>{`${amount} đ`}</Button>
))}
</div>
<div className='flex gap-3'>
<span>Bonus:</span>
<div className='flex gap-1'>
<img src={coinImage} className='w-6 h-6 opacity-50' />
<span>{bonus}</span>
<span className='opacity-40'>{`(for every ${amountLevel} đ)`}</span>
</div>
</div>
</div>
<div className='bg-white px-6 py-4'>
<div className='flex gap-3 mb-4'>
<WalletIcon width={24} className='text-blue/1' />
<span>Payment method</span>
</div>
<div className='flex flex-col gap-3'>
{methodList.map((method) => (
<Radio
name='method'
label={
<div className='flex gap-2'>
<img src={method.image} />
<div>
<h3 className='font-bold'>{`Pay with ${method.method} wallet`}</h3>
<h4 className='opacity-40'>{`Redirect to ${method.method}`}</h4>
</div>
</div>
}
crossOrigin=''
/>
))}
</div>
</div>
<Button className='w-full bg-blue/1'>Confirm</Button>
</div>
);
};
1 change: 1 addition & 0 deletions src/components/order/desktop/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
export * from './ConfirmOrderDesktop';
export * from './OrderListDesktop';
export * from './PreviewDocumentDesktop';
export * from './TopUpWalletFormDesktop';
export * from './UploadAndPreviewDesktop';
3 changes: 2 additions & 1 deletion src/constants/menuBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export const MAIN_MENU = {
export const SUB_MENU = {
help: 'Help Center',
settings: 'Settings',
logout: 'Log out'
logout: 'Log out',
wallet: 'Wallet'
};
Loading