Skip to content

Commit 74d405d

Browse files
committed
add styling for table on allowed user's page
1 parent b7ddac2 commit 74d405d

4 files changed

Lines changed: 51 additions & 23 deletions

File tree

src/components/allowed-users/components/NPubManagement/NPubManagement.tsx

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { PlusOutlined, DeleteOutlined, EditOutlined } from '@ant-design/icons';
44
import { useAllowedUsersList, useAllowedUsersValidation } from '@app/hooks/useAllowedUsers';
55
import { AllowedUsersSettings, AllowedUsersMode, AllowedUser } from '@app/types/allowedUsers.types';
66
import * as S from './NPubManagement.styles';
7+
import { TableContainer } from '../TiersConfig/TiersConfig.styles';
78

89
interface NPubManagementProps {
910
settings: AllowedUsersSettings;
@@ -158,19 +159,22 @@ export const NPubManagement: React.FC<NPubManagementProps> = ({
158159
</Space>
159160
</S.TabHeader>
160161

161-
<Table
162-
columns={columns}
163-
dataSource={users}
164-
loading={loading}
165-
pagination={{
166-
current: pagination.page,
167-
pageSize: pagination.page_size,
168-
total: pagination.total_items,
169-
showSizeChanger: false,
170-
showTotal: (total) => `Total ${total} users`
171-
}}
172-
rowKey="npub"
173-
/>
162+
<TableContainer>
163+
<Table
164+
columns={columns}
165+
dataSource={users}
166+
loading={loading}
167+
168+
pagination={{
169+
current: pagination.page,
170+
pageSize: pagination.page_size,
171+
total: pagination.total_items,
172+
showSizeChanger: false,
173+
showTotal: (total) => `Total ${total} users`
174+
}}
175+
rowKey="npub"
176+
/>
177+
</TableContainer>
174178

175179
{/* Add User Modal */}
176180
<Modal

src/components/allowed-users/components/TiersConfig/TiersConfig.styles.ts

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,29 @@ export const TiersHeader = styled.div`
1818
}
1919
`;
2020

21+
export const TableContainer = styled.div`
22+
border-radius: 12px;
23+
margin: 0 2px;
24+
padding-bottom: 1.5rem;
25+
background-color: var(--background-color);
26+
.ant-table {
27+
border-radius: 12px;
28+
}
29+
.ant-table-tbody {
30+
background-color: var(--layout-sider-bg-color);
31+
}
32+
.ant-table-placeholder .ant-table-cell {
33+
background-color: var(--layout-sider-bg-color);
34+
transition: none;
35+
}
36+
.ant-table-placeholder .ant-table-cell:hover {
37+
background-color: var(--layout-sider-bg-color);
38+
}
39+
.ant-empty-description {
40+
color: var(--text-light-color);
41+
}
42+
`;
43+
2144
export const TiersTitle = styled.h3`
2245
margin: 0;
2346
color: var(--text-main-color);
@@ -36,5 +59,5 @@ interface PriceProps {
3659

3760
export const Price = styled.span<PriceProps>`
3861
font-weight: 600;
39-
color: ${({ $isFree }) => $isFree ? 'var(--success-color)' : 'var(--primary-color)'};
40-
`;
62+
color: ${({ $isFree }) => ($isFree ? 'var(--success-color)' : 'var(--primary-color)')};
63+
`;

src/components/allowed-users/components/TiersConfig/TiersConfig.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -345,13 +345,15 @@ export const TiersConfig: React.FC<TiersConfigProps> = ({
345345
</Radio.Group>
346346
</div>
347347
) : (
348-
<Table
349-
columns={columns}
350-
dataSource={settings.tiers.map((tier, index) => ({ ...tier, key: index }))}
351-
pagination={false}
352-
size="small"
353-
locale={{ emptyText: 'No tiers configured' }}
354-
/>
348+
<S.TableContainer>
349+
<Table
350+
columns={columns}
351+
dataSource={settings.tiers.map((tier, index) => ({ ...tier, key: index }))}
352+
pagination={false}
353+
size="small"
354+
locale={{ emptyText: 'No tiers configured' }}
355+
/>
356+
</S.TableContainer>
355357
)}
356358

357359
<Modal

src/components/blocked-pubkeys/BlockedPubkeys.styles.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import styled from 'styled-components';
22
import Card from 'antd/lib/card/Card';
3-
import { Table, TableProps } from 'antd';
43
import { Input } from 'antd';
54
import { BaseCol } from '../common/BaseCol/BaseCol';
65
export const InputRoot = styled(Input)`

0 commit comments

Comments
 (0)