Skip to content

Commit 75dd04f

Browse files
committed
fixed bad component placement
1 parent 3534e12 commit 75dd04f

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/components/blocked-pubkeys/BlockedPubkeys.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const { Title, Text } = Typography;
1616
export function createStyledTable<T extends object = any>() {
1717
const GenericTable: FC<TableProps<T>> = (props) => <Table {...props} />;
1818

19-
return styled(GenericTable)`
19+
const StyledTable = styled(GenericTable)`
2020
border-radius: 12px;
2121
2222
& .ant-table-thead .ant-table-cell {
@@ -34,6 +34,7 @@ export function createStyledTable<T extends object = any>() {
3434
background-color: var(--layout-sider-bg-color);
3535
}
3636
`;
37+
return StyledTable;
3738
}
3839
export const BlockedPubkeys: React.FC = () => {
3940
const [activeView, setActiveView] = useState<'blocked' | 'flagged'>('blocked');

src/components/blocked-pubkeys/components/BlockedPubkeysTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ interface BlockedPubkeysTableProps {
1111
loading: boolean;
1212
onUnblock: (pubkey: string) => Promise<void>;
1313
}
14-
const TableRoot = createStyledTable<BlockedPubkey>();
1514
export const BlockedPubkeysTable: React.FC<BlockedPubkeysTableProps> = ({ blockedPubkeys, loading, onUnblock }) => {
1615
const [searchText, setSearchText] = useState('');
1716
const [confirmModalVisible, setConfirmModalVisible] = useState(false);
1817
const [currentPubkey, setCurrentPubkey] = useState('');
1918
const { getFlagCountsForPubkeys, loading: statsLoading } = useModerationStats();
19+
const TableRoot = createStyledTable<BlockedPubkey>();
2020

2121
// Get flag counts for all pubkeys in the table
2222
const pubkeyFlagCounts = getFlagCountsForPubkeys(blockedPubkeys.map((bp) => bp.pubkey));

src/components/blocked-pubkeys/components/FlaggedPubkeysTable.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface FlaggedPubkeysTableProps {
1212
onBlock: (pubkey: string, reason?: string) => Promise<void>;
1313
disabled?: boolean;
1414
}
15-
const TableRoot = createStyledTable<UserStat>();
15+
1616
export const FlaggedPubkeysTable: React.FC<FlaggedPubkeysTableProps> = ({
1717
blockedPubkeys,
1818
onBlock,
@@ -23,6 +23,7 @@ export const FlaggedPubkeysTable: React.FC<FlaggedPubkeysTableProps> = ({
2323
const [currentPubkey, setCurrentPubkey] = useState('');
2424
const [blockReason, setBlockReason] = useState('');
2525
const { stats, loading: statsLoading } = useModerationStats();
26+
const TableRoot = createStyledTable<UserStat>();
2627

2728
// Filter out already blocked pubkeys and return the rest
2829
const flaggedUsers =

0 commit comments

Comments
 (0)