Skip to content

Commit 0354ca2

Browse files
committed
some cleanup
1 parent 37111e6 commit 0354ca2

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

src/ui/pages/stripe/CreateLink.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
Anchor,
1212
CopyButton,
1313
Group,
14+
Loader,
1415
} from '@mantine/core';
1516
import { useForm } from '@mantine/form';
1617
import { notifications } from '@mantine/notifications';
@@ -62,10 +63,6 @@ export const StripeCreateLinkPanel: React.FC<StripeCreateLinkPanelProps> = ({
6263
}
6364
};
6465

65-
if (isLoading) {
66-
return <FullScreenLoader />;
67-
}
68-
6966
return (
7067
<Box mt="xl" mb="xl">
7168
<Title order={2} mb="sm">
@@ -101,8 +98,9 @@ export const StripeCreateLinkPanel: React.FC<StripeCreateLinkPanelProps> = ({
10198
required
10299
/>
103100

104-
<Button type="submit" fullWidth mt="md">
105-
Create Link
101+
<Button type="submit" fullWidth mt="md" disabled={isLoading}>
102+
{isLoading ? 'Creating...' : 'Create Link'}{' '}
103+
{isLoading && <Loader color="blue" size="sm" ml="sm" />}
106104
</Button>
107105
</form>
108106

@@ -111,11 +109,13 @@ export const StripeCreateLinkPanel: React.FC<StripeCreateLinkPanelProps> = ({
111109
size="xl"
112110
onClose={() => setModalOpened(false)}
113111
title="Payment Link Created!"
112+
closeOnClickOutside={false}
113+
withCloseButton={true}
114114
>
115115
{returnedLink && (
116116
<Box mt="md">
117117
<Group>
118-
<Text style={{ color: 'blue' }}>{returnedLink}</Text>
118+
<Text color="blue">{returnedLink}</Text>
119119
<CopyButton value={returnedLink}>
120120
{({ copied, copy }) => (
121121
<Button color={copied ? 'teal' : 'blue'} onClick={copy}>

src/ui/pages/stripe/CurrentLinks.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ export const StripeCurrentLinksPanel: React.FC<StripeCurrentLinksPanelProps> = (
1313
links,
1414
isLoading,
1515
}) => {
16-
if (isLoading) {
17-
return <FullScreenLoader />;
18-
}
1916
return (
2017
<div>
2118
<Title order={2} mb="sm">

src/ui/pages/stripe/ViewLinks.page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export const ManageStripeLinksPage: React.FC = () => {
1212
const api = useApi('core');
1313

1414
const createLink = async (payload: PostInvoiceLinkRequest): Promise<PostInvoiceLinkResponse> => {
15-
setIsLoading(true);
1615
const modifiedPayload = { ...payload, invoiceAmountUsd: payload.invoiceAmountUsd * 100 };
1716
try {
1817
const response = await api.post('/api/v1/stripe/paymentLinks', modifiedPayload);

0 commit comments

Comments
 (0)