diff --git a/src/components/settings-modal/p2p-options/index.ts b/src/components/settings-modal/p2p-options/index.ts new file mode 100644 index 00000000..a9fb21e3 --- /dev/null +++ b/src/components/settings-modal/p2p-options/index.ts @@ -0,0 +1 @@ +export { default } from './p2p-options'; diff --git a/src/components/settings-modal/pkc-options/pkc-options.module.css b/src/components/settings-modal/p2p-options/p2p-options.module.css similarity index 89% rename from src/components/settings-modal/pkc-options/pkc-options.module.css rename to src/components/settings-modal/p2p-options/p2p-options.module.css index e430ccad..76ca29ba 100644 --- a/src/components/settings-modal/pkc-options/pkc-options.module.css +++ b/src/components/settings-modal/p2p-options/p2p-options.module.css @@ -33,12 +33,12 @@ cursor: pointer; } -.plebbitRpcSettingsInfo { +.p2pRpcSettingsInfo { padding: 5px 20px 0 0; word-break: break-word; } -.plebbitRpcSettingsInfo ol { +.p2pRpcSettingsInfo ol { padding-bottom: 5px; padding-left: 20px; } @@ -58,12 +58,14 @@ padding: 2px 4px 3px; width: 95%; font-size: 13px; + font-family: monospace; } .content input[type="text"] { outline: none; width: 55%; font-size: 13px; + font-family: monospace; } .settingTip { @@ -73,6 +75,6 @@ padding-left: 1px; } -.plebbitRPCSettings button { +.p2pRPCSettings button { margin-left: 5px; } \ No newline at end of file diff --git a/src/components/settings-modal/pkc-options/pkc-options.tsx b/src/components/settings-modal/p2p-options/p2p-options.tsx similarity index 88% rename from src/components/settings-modal/pkc-options/pkc-options.tsx rename to src/components/settings-modal/p2p-options/p2p-options.tsx index 7b35830e..a8ff1738 100644 --- a/src/components/settings-modal/pkc-options/pkc-options.tsx +++ b/src/components/settings-modal/p2p-options/p2p-options.tsx @@ -1,7 +1,7 @@ import { RefObject, useRef, useState } from 'react'; import { setAccount, useAccount, usePlebbitRpcSettings } from '@plebbit/plebbit-react-hooks'; import { useTranslation } from 'react-i18next'; -import styles from './pkc-options.module.css'; +import styles from './p2p-options.module.css'; interface SettingsProps { ipfsGatewayUrlsRef?: RefObject; @@ -10,8 +10,8 @@ interface SettingsProps { ethRpcRef?: RefObject; solRpcRef?: RefObject; maticRpcRef?: RefObject; - plebbitRpcRef?: RefObject; - plebbitDataPathRef?: RefObject; + p2pRpcRef?: RefObject; + p2pDataPathRef?: RefObject; } const IPFSGatewaysSettings = ({ ipfsGatewayUrlsRef, mediaIpfsGatewayUrlRef }: SettingsProps) => { @@ -122,21 +122,21 @@ const BlockchainProvidersSettings = ({ ethRpcRef, solRpcRef, maticRpcRef }: Sett ); }; -const PlebbitRPCSettings = ({ plebbitRpcRef }: SettingsProps) => { +const P2pRPCSettings = ({ p2pRpcRef }: SettingsProps) => { const [showInfo, setShowInfo] = useState(false); const account = useAccount(); const { plebbitOptions } = account || {}; const { plebbitRpcClientsOptions } = plebbitOptions || {}; return ( -
+
- +
{showInfo && ( -
- use a PKC full node locally, or remotely with SSL +
+ use a P2P full node locally, or remotely with SSL
  1. get secret auth key from the node
  2. @@ -152,16 +152,16 @@ const PlebbitRPCSettings = ({ plebbitRpcRef }: SettingsProps) => { ); }; -const PlebbitDataPathSettings = ({ plebbitDataPathRef }: SettingsProps) => { +const P2pDataPathSettings = ({ p2pDataPathRef }: SettingsProps) => { const plebbitRpc = usePlebbitRpcSettings(); const { plebbitRpcSettings } = plebbitRpc || {}; const isConnectedToRpc = plebbitRpc?.state === 'connected'; const path = plebbitRpcSettings?.plebbitOptions?.dataPath || ''; return ( -
    +
    - +
    ); @@ -169,7 +169,7 @@ const PlebbitDataPathSettings = ({ plebbitDataPathRef }: SettingsProps) => { const isElectron = window.electronApi?.isElectron === true; -const PlebbitOptions = () => { +const P2pOptions = () => { const { t } = useTranslation(); const account = useAccount(); const { plebbitOptions } = account || {}; @@ -181,8 +181,8 @@ const PlebbitOptions = () => { const solRpcRef = useRef(null); const maticRpcRef = useRef(null); const httpRoutersRef = useRef(null); - const plebbitRpcRef = useRef(null); - const plebbitDataPathRef = useRef(null); + const p2pRpcRef = useRef(null); + const p2pDataPathRef = useRef(null); const handleSave = async () => { const ipfsGatewayUrls = ipfsGatewayUrlsRef.current?.value @@ -217,8 +217,8 @@ const PlebbitOptions = () => { .map((url) => url.trim()) .filter((url) => url !== ''); - const plebbitRpcClientsOptions = plebbitRpcRef.current?.value.trim() ? [plebbitRpcRef.current.value.trim()] : undefined; - const dataPath = plebbitDataPathRef.current?.value.trim() || undefined; + const plebbitRpcClientsOptions = p2pRpcRef.current?.value.trim() ? [p2pRpcRef.current.value.trim()] : undefined; + const dataPath = p2pDataPathRef.current?.value.trim() || undefined; const chainProviders = { eth: { @@ -289,14 +289,14 @@ const PlebbitOptions = () => {
    Node RPC: - +
    {isElectron && (
    - plebbit data path: + p2p data path: - +
    )} @@ -304,4 +304,4 @@ const PlebbitOptions = () => { ); }; -export default PlebbitOptions; +export default P2pOptions; diff --git a/src/components/settings-modal/pkc-options/index.ts b/src/components/settings-modal/pkc-options/index.ts deleted file mode 100644 index 44bce6f4..00000000 --- a/src/components/settings-modal/pkc-options/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './pkc-options'; diff --git a/src/components/settings-modal/settings-modal.tsx b/src/components/settings-modal/settings-modal.tsx index b60a41e9..8c10b58d 100644 --- a/src/components/settings-modal/settings-modal.tsx +++ b/src/components/settings-modal/settings-modal.tsx @@ -8,7 +8,7 @@ import BlockedAddressesSetting from './blocked-addresses-setting'; import CryptoAddressSetting from './crypto-address-setting'; import CryptoWalletsSetting from './crypto-wallets-setting'; import InterfaceSettings from './interface-settings'; -import PlebbitOptions from './pkc-options'; +import P2pOptions from './p2p-options'; import SubscriptionsSetting from './subscriptions-setting'; const SettingsModal = () => { @@ -42,7 +42,7 @@ const SettingsModal = () => { const [showCryptoWalletSettings, setShowCryptoWalletSettings] = useState(false); const [showSubscriptionsSettings, setShowSubscriptionsSettings] = useState(false); const [showBlockedAddressesSetting, setShowBlockedAddressesSetting] = useState(false); - const [showPlebbitOptionsSettings, setShowPlebbitOptionsSettings] = useState(false); + const [showP2pOptionsSettings, setShowP2pOptionsSettings] = useState(false); const [expandAll, setExpandAll] = useState(false); const getExpandedCount = () => { @@ -54,7 +54,7 @@ const SettingsModal = () => { Number(showCryptoWalletSettings) + Number(showSubscriptionsSettings) + Number(showBlockedAddressesSetting) + - Number(showPlebbitOptionsSettings) + Number(showP2pOptionsSettings) ); }; @@ -66,7 +66,7 @@ const SettingsModal = () => { if (showCryptoWalletSettings && 'crypto-wallet-settings' !== excludeCategoryId) return 'crypto-wallet-settings'; if (showSubscriptionsSettings && 'subscriptions-settings' !== excludeCategoryId) return 'subscriptions-settings'; if (showBlockedAddressesSetting && 'blocked-addresses-settings' !== excludeCategoryId) return 'blocked-addresses-settings'; - if (showPlebbitOptionsSettings && 'pkc-options-settings' !== excludeCategoryId) return 'pkc-options-settings'; + if (showP2pOptionsSettings && 'p2p-options-settings' !== excludeCategoryId) return 'p2p-options-settings'; return null; }; @@ -106,7 +106,7 @@ const SettingsModal = () => { setShowCryptoWalletSettings(hash === 'crypto-wallet-settings'); setShowSubscriptionsSettings(hash === 'subscriptions-settings'); setShowBlockedAddressesSetting(hash === 'blocked-addresses-settings'); - setShowPlebbitOptionsSettings(hash === 'pkc-options-settings'); + setShowP2pOptionsSettings(hash === 'p2p-options-settings'); } }, [hash]); @@ -120,7 +120,7 @@ const SettingsModal = () => { setShowCryptoWalletSettings(newExpandState); setShowSubscriptionsSettings(newExpandState); setShowBlockedAddressesSetting(newExpandState); - setShowPlebbitOptionsSettings(newExpandState); + setShowP2pOptionsSettings(newExpandState); const baseSettingsPath = location.pathname.split('#')[0]; navigate(baseSettingsPath, { replace: true }); @@ -186,13 +186,13 @@ const SettingsModal = () => {
    {showBlockedAddressesSetting && } -
    -
    );