Skip to content

Commit

Permalink
cleanup & update style
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo committed Aug 18, 2024
1 parent d354c8a commit 48cd241
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 108 deletions.
27 changes: 16 additions & 11 deletions src/components/Orders/Modals/OrderProcessor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { useState } from 'react';
import { useSubmitExtrinsic } from '@/hooks/submitExtrinsic';
import { getBalanceString } from '@/utils/functions';

import { ActionButton } from '@/components/Elements';
import { ProgressButton } from '@/components/Elements';

import { useAccounts } from '@/contexts/account';
import { useRegionXApi, useRelayApi } from '@/contexts/apis';
Expand Down Expand Up @@ -198,24 +198,29 @@ export const OrderProcessorModal = ({
</Box>
</DialogContent>
<DialogActions>
<Stack width='100%' gap='0.5rem' mt='1.5rem'>
<Box width='100%' gap='0.5rem' mt='1.5rem' display='flex'>
<Button
onClick={onClose}
variant='outlined'
fullWidth
variant='contained'
sx={{
borderRadius: '1rem',
}}
onClick={onProcess}
disabled={!checkRequirements(order, regionSelected) || working}
data-cy='btn-close-order-processor-modal'
>
Fulfill
Close
</Button>
<ActionButton
label='Close'
onClick={onClose}
data-cy='btn-close-order-processor-modal'
<ProgressButton
fullWidth
label='Fulfill'
sx={{
borderRadius: '1rem',
}}
onClick={onProcess}
disabled={!checkRequirements(order, regionSelected) || working}
loading={working}
/>
</Stack>
</Box>
</DialogActions>
</Dialog>
);
Expand Down
2 changes: 1 addition & 1 deletion src/contexts/orders/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const OrderProvider = ({ children }: Props) => {
...item,
totalContribution: parseInt(item.contribution),
contribution: await getContribution(item.orderId),
} as Order)
}) as Order
)
)
);
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/order/processed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const useProcessedOrders = () => {
mask,
account: seller,
reward,
} as OrderItem)
}) as OrderItem
)
);
}
Expand Down
78 changes: 0 additions & 78 deletions src/hooks/order/regions.ts

This file was deleted.

33 changes: 16 additions & 17 deletions src/pages/orders/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
CircularProgress,
FormControlLabel,
Paper,
Stack,
Switch,
Typography,
useTheme,
Expand Down Expand Up @@ -127,21 +126,7 @@ const OrderDashboard = () => {
{ordersToShow.map((order: Order, index: number) => (
<Paper key={index} sx={{ padding: '1.5rem' }}>
<OrderCard order={order} />
<Stack direction='column' gap='.5rem' mt='1.5rem'>
<Button
fullWidth
variant='contained'
sx={{
borderRadius: '1rem',
}}
onClick={() => {
openContributionModal(true);
selectOrder(order);
}}
disabled={activeAccount === null}
>
Contribute
</Button>
<Box display='flex' gap='.5rem' mt='1.5rem'>
<Button
onClick={() => {
openProcessorModal(true);
Expand All @@ -156,7 +141,21 @@ const OrderDashboard = () => {
>
Fulfill Order
</Button>
</Stack>
<Button
fullWidth
variant='contained'
sx={{
borderRadius: '1rem',
}}
onClick={() => {
openContributionModal(true);
selectOrder(order);
}}
disabled={activeAccount === null}
>
Contribute
</Button>
</Box>
</Paper>
))}
</Box>
Expand Down

0 comments on commit 48cd241

Please sign in to comment.