Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
REACT_APP_BASE_URL=http://localhost:9002
REACT_APP_WALLET_BASE_URL=http://localhost:9003
REACT_APP_ASSETS_BUCKET=http://localhost
REACT_APP_DEMO_MODE=true
REACT_APP_DEMO_MODE=false

# More info https://create-react-app.dev/docs/advanced-configuration
ESLINT_NO_DEV_ERRORS=true
Expand Down
7 changes: 1 addition & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
REACT_APP_BASE_URL=http://localhost:9002
REACT_APP_ASSETS_BUCKET=https://lightence-assets.s3.amazonaws.com

# more info https://create-react-app.dev/docs/advanced-configuration
ESLINT_NO_DEV_ERRORS=
TSC_COMPILE_ON_ERROR=
NODE_OPTIONS=--openssl-legacy-provider
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ yarn-error.log*

# generated files
/public/themes
/memory-bank
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ We have a live demo that can be found at http://hornetstorage.net for anyone tha

## Key Features
- Manage your hornet-storage relay config directly from the panel
- Switch between our new dumb and smart model for accepting nostr notes
- Switch between our new whitelist and blacklist model for accepting nostr notes
- Decide from which of the supported nostr kinds to enable
- Choose which supported transport protocols to enable such as libp2p and websockets
- Enable / disable which media extensions are accepted by the relay such as png and mp4
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,15 @@
"workbox-streams": "^5.1.3"
},
"scripts": {
"start": "yarn buildThemes && craco start",
"build": "yarn buildThemes && craco build",
"test": "craco test",
"eject": "craco eject",
"start": "NODE_OPTIONS=--openssl-legacy-provider yarn buildThemes && NODE_OPTIONS=--openssl-legacy-provider craco start",
"build": "NODE_OPTIONS=--openssl-legacy-provider yarn buildThemes && NODE_OPTIONS=--openssl-legacy-provider craco build",
"test": "NODE_OPTIONS=--openssl-legacy-provider craco test",
"eject": "NODE_OPTIONS=--openssl-legacy-provider craco eject",
"lint": "eslint \"*/**/*.{js,ts,tsx}\" --fix",
"lint:styles": "stylelint '*/**/*.{js,ts,tsx}'",
"prepare": "husky install",
"buildThemes": "lessc --js --clean-css=\"--s1 --advanced\" src/styles/themes/main.less public/themes/main.css"
"update-browserslist": "npx update-browserslist-db@latest",
"buildThemes": "NODE_OPTIONS=--openssl-legacy-provider lessc --js --clean-css=\"--s1 --advanced\" src/styles/themes/main.less public/themes/main.css"
},
"browserslist": [
">0.2%",
Expand Down
3 changes: 3 additions & 0 deletions src/@types/event-target.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
interface EventTarget {
state?: 'activated';
}
66 changes: 0 additions & 66 deletions src/api/moderationNotifications.api.ts

This file was deleted.

13 changes: 1 addition & 12 deletions src/api/notifications.api.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
export interface Message {
id: number;
description: string;
moderationData?: {
id: number;
pubkey: string;
event_id: string;
reason: string;
created_at: string;
is_read: boolean;
content_type: string;
media_url?: string;
thumbnail_url?: string;
};
}

export interface Mention extends Message {
Expand All @@ -23,5 +12,5 @@ export interface Mention extends Message {

export type Notification = Mention | Message;

// Export an empty array now that we're using real moderation notifications
// Export an empty array for notifications
export const notifications: Notification[] = [];
31 changes: 28 additions & 3 deletions src/components/common/BaseModal/BaseModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import React from 'react';
import { Modal, ModalProps } from 'antd';
import { modalSizes } from 'constants/modalSizes';

interface BaseModalProps extends ModalProps {
// Extend ModalProps to include our custom props
interface BaseModalProps extends Omit<ModalProps, 'visible'> {
size?: 'small' | 'medium' | 'large';
visible?: boolean; // Deprecated prop
open?: boolean; // New prop that will replace visible
}

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

export const BaseModal: BaseModalInterface = ({ size = 'medium', children, ...props }) => {
export const BaseModal: BaseModalInterface = ({
size = 'medium',
visible,
open,
children,
...props
}) => {
const modalSize = Object.entries(modalSizes).find((sz) => sz[0] === size)?.[1];

// If open is provided, use it. Otherwise, fall back to visible.
// This ensures backward compatibility while supporting the new prop.
const isOpen = open !== undefined ? open : visible;

// Show deprecation warning in development mode
if (process.env.NODE_ENV === 'development' && visible !== undefined && open === undefined) {
console.warn(
'[antd: Modal] `visible` will be removed in next major version, please use `open` instead.'
);
}

return (
<Modal getContainer={false} width={modalSize} {...props}>
<Modal
getContainer={false}
width={modalSize}
open={isOpen}
{...props}
>
{children}
</Modal>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/BaseNotification/BaseNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ interface Icons {
success: React.ReactNode;
warning: React.ReactNode;
error: React.ReactNode;
moderation: React.ReactNode;
mention: React.ReactNode;
moderation: React.ReactNode;
}

export type NotificationType = 'info' | 'mention' | 'success' | 'warning' | 'error' | 'moderation';
Expand All @@ -27,8 +27,8 @@ export const BaseNotification: React.FC<BaseNotificationProps> = ({ type, mentio
success: <CheckCircleFilled />,
warning: <ExclamationCircleFilled />,
error: <WarningFilled />,
moderation: <WarningFilled style={{ color: 'var(--error-color)' }} />,
mention: mentionIconSrc,
moderation: <WarningFilled />, // Using the same icon as error for moderation
};

const icon = icons[type] || icons.warning;
Expand Down

This file was deleted.

Loading
Loading