Skip to content

Commit bd4301e

Browse files
committed
fix size of loading modal
1 parent a2be3b1 commit bd4301e

2 files changed

Lines changed: 19 additions & 8 deletions

File tree

src/components/relay-dashboard/paid-subscribers/SubscriberDetailModal/SubscriberDetailModal.styles.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import styled from 'styled-components';
2-
import { Card, Typography, Button, Badge } from 'antd';
2+
import { Card, Typography, Button, Badge, Modal } from 'antd';
33
import { BORDER_RADIUS, FONT_SIZE, FONT_WEIGHT, FONT_FAMILY } from '@app/styles/themes/constants';
4-
import { BaseBadge } from '@app/components/common/BaseBadge/BaseBadge';
54
const { Title, Text, Paragraph } = Typography;
65

76
export const StyledModal = styled(Card)`
@@ -209,3 +208,15 @@ export const SubscriptionBadge = styled(Badge.Ribbon)<SubscriptionBadgeProps>`
209208
background: ${({ subscribed }) => (subscribed ? 'var(--ant-primary-color)' : 'var(--error-color)')};
210209
color: var(--text-main-color);
211210
`;
211+
212+
export const StateModal = styled(Modal)`
213+
214+
.ant-modal-body {
215+
height: 50vh;
216+
flex-direction: column;
217+
display: flex;
218+
align-items: center;
219+
justify-content: center;
220+
}
221+
222+
`

src/components/relay-dashboard/paid-subscribers/SubscriberDetailModal/SubscriberDetailModal.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,27 @@ export const SubscriberDetailModal: React.FC<SubscriberDetailModalProps> = ({ su
2424
// Loading state
2525
if (!subscriber && loading && !fetchFailed) {
2626
return (
27-
<Modal open={isVisible} footer={null} onCancel={onClose} centered>
27+
<S.StateModal open={isVisible} footer={null} onCancel={onClose} centered>
2828
<Spin tip="Loading..." />
29-
</Modal>
29+
</S.StateModal>
3030
);
3131
}
3232

3333
// Error state
3434
if (!subscriber && !loading && fetchFailed) {
3535
return (
36-
<Modal open={isVisible} footer={null} onCancel={onClose} centered>
36+
<S.StateModal open={isVisible} footer={null} onCancel={onClose} centered>
3737
<Typography.Text type="danger">Failed to fetch subscriber profile. Please try again.</Typography.Text>
38-
</Modal>
38+
</S.StateModal>
3939
);
4040
}
4141

4242
// Not found state
4343
if (!subscriber && !loading && !fetchFailed) {
4444
return (
45-
<Modal open={isVisible} footer={null} onCancel={onClose} centered>
45+
<S.StateModal open={isVisible} footer={null} onCancel={onClose} centered>
4646
<Typography.Text type="secondary">Couldn't find this subscriber profile.</Typography.Text>
47-
</Modal>
47+
</S.StateModal>
4848
);
4949
}
5050
if (!subscriber) {

0 commit comments

Comments
 (0)