Skip to content

Commit fdca8a6

Browse files
Merge pull request #41 from HORNET-Storage/refactor/rename-subscribers-component
Refactor/rename subscribers component
2 parents b57570a + 8426b9d commit fdca8a6

File tree

35 files changed

+269
-1314
lines changed

35 files changed

+269
-1314
lines changed

.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
REACT_APP_BASE_URL=http://localhost:9002
22
REACT_APP_WALLET_BASE_URL=http://localhost:9003
33
REACT_APP_ASSETS_BUCKET=http://localhost
4-
REACT_APP_DEMO_MODE=true
4+
REACT_APP_DEMO_MODE=false
55

66
# More info https://create-react-app.dev/docs/advanced-configuration
77
ESLINT_NO_DEV_ERRORS=true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ yarn-error.log*
3232

3333
# generated files
3434
/public/themes
35+
/memory-bank

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ We have a live demo that can be found at http://hornetstorage.net for anyone tha
99

1010
## Key Features
1111
- Manage your hornet-storage relay config directly from the panel
12-
- Switch between our new dumb and smart model for accepting nostr notes
12+
- Switch between our new whitelist and blacklist model for accepting nostr notes
1313
- Decide from which of the supported nostr kinds to enable
1414
- Choose which supported transport protocols to enable such as libp2p and websockets
1515
- Enable / disable which media extensions are accepted by the relay such as png and mp4

src/api/moderationNotifications.api.ts

Lines changed: 0 additions & 66 deletions
This file was deleted.

src/api/notifications.api.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
export interface Message {
22
id: number;
33
description: string;
4-
moderationData?: {
5-
id: number;
6-
pubkey: string;
7-
event_id: string;
8-
reason: string;
9-
created_at: string;
10-
is_read: boolean;
11-
content_type: string;
12-
media_url?: string;
13-
thumbnail_url?: string;
14-
};
154
}
165

176
export interface Mention extends Message {
@@ -23,5 +12,5 @@ export interface Mention extends Message {
2312

2413
export type Notification = Mention | Message;
2514

26-
// Export an empty array now that we're using real moderation notifications
15+
// Export an empty array for notifications
2716
export const notifications: Notification[] = [];

src/components/common/BaseModal/BaseModal.tsx

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ import React from 'react';
22
import { Modal, ModalProps } from 'antd';
33
import { modalSizes } from 'constants/modalSizes';
44

5-
interface BaseModalProps extends ModalProps {
5+
// Extend ModalProps to include our custom props
6+
interface BaseModalProps extends Omit<ModalProps, 'visible'> {
67
size?: 'small' | 'medium' | 'large';
8+
visible?: boolean; // Deprecated prop
9+
open?: boolean; // New prop that will replace visible
710
}
811

912
interface BaseModalInterface extends React.FC<BaseModalProps> {
@@ -13,11 +16,33 @@ interface BaseModalInterface extends React.FC<BaseModalProps> {
1316
error: typeof Modal.error;
1417
}
1518

16-
export const BaseModal: BaseModalInterface = ({ size = 'medium', children, ...props }) => {
19+
export const BaseModal: BaseModalInterface = ({
20+
size = 'medium',
21+
visible,
22+
open,
23+
children,
24+
...props
25+
}) => {
1726
const modalSize = Object.entries(modalSizes).find((sz) => sz[0] === size)?.[1];
27+
28+
// If open is provided, use it. Otherwise, fall back to visible.
29+
// This ensures backward compatibility while supporting the new prop.
30+
const isOpen = open !== undefined ? open : visible;
31+
32+
// Show deprecation warning in development mode
33+
if (process.env.NODE_ENV === 'development' && visible !== undefined && open === undefined) {
34+
console.warn(
35+
'[antd: Modal] `visible` will be removed in next major version, please use `open` instead.'
36+
);
37+
}
1838

1939
return (
20-
<Modal getContainer={false} width={modalSize} {...props}>
40+
<Modal
41+
getContainer={false}
42+
width={modalSize}
43+
open={isOpen}
44+
{...props}
45+
>
2146
{children}
2247
</Modal>
2348
);

src/components/common/BaseNotification/BaseNotification.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ interface Icons {
88
success: React.ReactNode;
99
warning: React.ReactNode;
1010
error: React.ReactNode;
11-
moderation: React.ReactNode;
1211
mention: React.ReactNode;
1312
}
1413

15-
export type NotificationType = 'info' | 'mention' | 'success' | 'warning' | 'error' | 'moderation';
14+
export type NotificationType = 'info' | 'mention' | 'success' | 'warning' | 'error';
1615

1716
interface BaseNotificationProps {
1817
type: NotificationType;
@@ -27,7 +26,6 @@ export const BaseNotification: React.FC<BaseNotificationProps> = ({ type, mentio
2726
success: <CheckCircleFilled />,
2827
warning: <ExclamationCircleFilled />,
2928
error: <WarningFilled />,
30-
moderation: <WarningFilled style={{ color: 'var(--error-color)' }} />,
3129
mention: mentionIconSrc,
3230
};
3331

src/components/header/components/notificationsDropdown/ModerationNotificationsOverlay/ModerationNotificationsOverlay.tsx

Lines changed: 0 additions & 127 deletions
This file was deleted.

0 commit comments

Comments
 (0)