Skip to content

Commit 054edbf

Browse files
committed
fix visual issues with notifications dropdown
1 parent 2144e1a commit 054edbf

3 files changed

Lines changed: 42 additions & 16 deletions

File tree

src/components/header/components/notificationsDropdown/NotificationsDropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const NotificationsDropdown: React.FC = () => {
135135
<BasePopover
136136
trigger="click"
137137
content={
138-
<div style={{ maxWidth: '400px', minWidth: '320px', maxHeight: '450px' }}>
138+
<div style={{ maxWidth: '400px', minWidth: '320px' }}>
139139
<Tabs
140140
defaultActiveKey="1"
141141
items={tabItems}

src/components/header/components/notificationsDropdown/NotificationsOverlay/NotificationsOverlay.styles.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { BaseButton } from '@app/components/common/BaseButton/BaseButton';
33
import { media } from '@app/styles/themes/constants';
44
import { BaseDivider } from '@app/components/common/BaseDivider/BaseDivider';
55
import { BaseTypography } from '@app/components/common/BaseTypography/BaseTypography';
6+
import { BaseNotification } from '@app/components/common/BaseNotification/BaseNotification';
7+
import { BaseSpace } from '@app/components/common/BaseSpace/BaseSpace';
68

79
export const NoticesOverlayMenu = styled.div`
810
max-width: 15rem;
@@ -54,3 +56,26 @@ export const Text = styled(BaseTypography.Text)`
5456
display: block;
5557
text-align: center;
5658
`;
59+
export const TransactionWrapper = styled.div`
60+
display: flex;
61+
justify-content: space-between;
62+
align-items: center;
63+
width: 100%;
64+
margin-top: .5rem;
65+
margin-bottom: .5rem;
66+
gap: 3rem;
67+
`;
68+
export const RootNotification = styled(BaseNotification)`
69+
width: 100%;
70+
71+
`;
72+
export const NotificationsWrapper = styled(BaseSpace)`
73+
.ant-space.ant-space-horizontal {
74+
width: 100%;
75+
}
76+
`;
77+
export const ActionRow = styled.div`
78+
display: flex;
79+
justify-content: space-between;
80+
align-items: center;
81+
`;

src/components/header/components/notificationsDropdown/PaymentNotificationsOverlay/PaymentNotificationsOverlay.tsx

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export const PaymentNotificationsOverlay: React.FC<PaymentNotificationsOverlayPr
3434
const formatAmount = (satoshis: number) => {
3535
const btc = satoshis / 100000000;
3636
return (
37-
<div>
38-
<div style={{ fontWeight: 'bold' }}>{satoshis.toLocaleString()} sats</div>
37+
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'end' }}>
38+
<div style={{ fontWeight: 'bold', fontSize: "1rem"}}>{satoshis.toLocaleString()} sats</div>
3939
<div style={{ fontSize: '0.85rem', color: 'var(--text-light-color)' }}>
4040
({btc.toFixed(8)} BTC)
4141
</div>
@@ -48,7 +48,7 @@ export const PaymentNotificationsOverlay: React.FC<PaymentNotificationsOverlayPr
4848
}, [markAllAsRead]);
4949

5050
const noticesList = notifications.map((notification) => (
51-
<BaseNotification
51+
<S.RootNotification
5252
key={notification.id}
5353
type="info"
5454
title={
@@ -89,35 +89,36 @@ export const PaymentNotificationsOverlay: React.FC<PaymentNotificationsOverlayPr
8989
}
9090
description={
9191
<div>
92+
<S.TransactionWrapper>
9293
<div style={{ fontSize: '0.85rem', color: 'var(--text-light-color)', marginBottom: '4px' }}>
9394
{formatDate(notification.created_at)}
9495
</div>
9596

9697
<div style={{ marginBottom: '8px' }}>
97-
<strong>{t('payment.notifications.amount', 'Amount')}: </strong>
9898
{formatAmount(notification.amount)}
9999
</div>
100+
</S.TransactionWrapper>
100101

101-
<div style={{ fontSize: '0.85rem', color: 'var(--text-light-color)', marginTop: '4px' }}>
102+
{/* <div style={{ fontSize: '0.85rem', color: 'var(--text-light-color)', marginTop: '4px' }}>
102103
{t('payment.notifications.expiration', 'Expires')}: {formatDate(notification.expiration_date)}
103-
</div>
104-
104+
</div> */}
105+
<S.ActionRow>
106+
<Link to="/payment-notifications" style={{ fontSize: '0.85rem' }}>
107+
{t('payment.notifications.viewDetails', 'View details')}
108+
</Link>
105109
{!notification.is_read && (
106110
<BaseButton
107111
type="link"
108112
size="small"
109113
onClick={() => markAsRead(notification.id)}
110-
style={{ padding: '4px 0', height: 'auto', marginTop: '4px' }}
114+
style={{ padding: '4px 0', height: 'auto', marginTop: '4px', fontSize: '0.85rem' }}
111115
>
112116
{t('payment.notifications.markAsRead', 'Mark as read')}
113117
</BaseButton>
114118
)}
115119

116-
<div style={{ marginTop: '4px' }}>
117-
<Link to="/payment-notifications" style={{ fontSize: '0.85rem' }}>
118-
{t('payment.notifications.viewDetails', 'View details')}
119-
</Link>
120-
</div>
120+
121+
</S.ActionRow>
121122
</div>
122123
}
123124
/>
@@ -129,9 +130,9 @@ export const PaymentNotificationsOverlay: React.FC<PaymentNotificationsOverlayPr
129130
<BaseCol span={24}>
130131
{notifications.length > 0 ? (
131132
<S.NotificationsList>
132-
<BaseSpace direction="vertical" size={10} split={<S.SplitDivider />}>
133+
<S.NotificationsWrapper direction="vertical" size={10} split={<S.SplitDivider />} style={{ width: '95%' }}>
133134
{noticesList}
134-
</BaseSpace>
135+
</S.NotificationsWrapper>
135136
</S.NotificationsList>
136137
) : (
137138
<div style={{ textAlign: 'center', padding: '20px 0' }}>

0 commit comments

Comments
 (0)