mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
refactor: remove unused Avalanche RPC settings
This commit is contained in:
@@ -135,7 +135,7 @@ const AvatarSettings = () => {
|
|||||||
<span className={styles.settingTitle}>{_.capitalize(t('chain_ticker'))}: </span>
|
<span className={styles.settingTitle}>{_.capitalize(t('chain_ticker'))}: </span>
|
||||||
<input
|
<input
|
||||||
type='text'
|
type='text'
|
||||||
placeholder='eth/sol/avax'
|
placeholder='eth/sol/matic'
|
||||||
autoCorrect='off'
|
autoCorrect='off'
|
||||||
autoComplete='off'
|
autoComplete='off'
|
||||||
spellCheck='false'
|
spellCheck='false'
|
||||||
@@ -200,7 +200,7 @@ const AvatarSettings = () => {
|
|||||||
<span className={`${styles.settingTitle} ${styles.timestampfield}`}>{_.capitalize(t('timestamp'))}: </span>
|
<span className={`${styles.settingTitle} ${styles.timestampfield}`}>{_.capitalize(t('timestamp'))}: </span>
|
||||||
<input
|
<input
|
||||||
type='text'
|
type='text'
|
||||||
placeholder='Timestamp'
|
placeholder='1234567890'
|
||||||
autoCorrect='off'
|
autoCorrect='off'
|
||||||
autoComplete='off'
|
autoComplete='off'
|
||||||
spellCheck='false'
|
spellCheck='false'
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ const CryptoWalletsForm = ({ account }: { account: Account | undefined }) => {
|
|||||||
type='text'
|
type='text'
|
||||||
onChange={(e) => setWalletsArrayProperty(selectedWallet, 'chainTicker', e.target.value)}
|
onChange={(e) => setWalletsArrayProperty(selectedWallet, 'chainTicker', e.target.value)}
|
||||||
value={walletsArray[selectedWallet].chainTicker}
|
value={walletsArray[selectedWallet].chainTicker}
|
||||||
placeholder='eth/sol/avax'
|
placeholder='eth/sol/matic'
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${styles.walletField} ${styles.step2}`}>
|
<div className={`${styles.walletField} ${styles.step2}`}>
|
||||||
@@ -138,7 +138,7 @@ const CryptoWalletsForm = ({ account }: { account: Account | undefined }) => {
|
|||||||
type='text'
|
type='text'
|
||||||
onChange={(e) => setWalletsArrayProperty(selectedWallet, 'timestamp', Number(e.target.value))}
|
onChange={(e) => setWalletsArrayProperty(selectedWallet, 'timestamp', Number(e.target.value))}
|
||||||
value={walletsArray[selectedWallet].timestamp || ''}
|
value={walletsArray[selectedWallet].timestamp || ''}
|
||||||
placeholder='Timestamp'
|
placeholder='1234567890'
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${styles.walletField} ${styles.step4}`}>
|
<div className={`${styles.walletField} ${styles.step4}`}>
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ interface SettingsProps {
|
|||||||
ethRpcRef?: RefObject<HTMLTextAreaElement>;
|
ethRpcRef?: RefObject<HTMLTextAreaElement>;
|
||||||
solRpcRef?: RefObject<HTMLTextAreaElement>;
|
solRpcRef?: RefObject<HTMLTextAreaElement>;
|
||||||
maticRpcRef?: RefObject<HTMLTextAreaElement>;
|
maticRpcRef?: RefObject<HTMLTextAreaElement>;
|
||||||
avaxRpcRef?: RefObject<HTMLTextAreaElement>;
|
|
||||||
plebbitRpcRef?: RefObject<HTMLInputElement>;
|
plebbitRpcRef?: RefObject<HTMLInputElement>;
|
||||||
plebbitDataPathRef?: RefObject<HTMLInputElement>;
|
plebbitDataPathRef?: RefObject<HTMLInputElement>;
|
||||||
}
|
}
|
||||||
@@ -74,33 +73,28 @@ const PubsubProvidersSettings = ({ pubsubProvidersRef }: SettingsProps) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const BlockchainProvidersSettings = ({ ethRpcRef, solRpcRef, maticRpcRef, avaxRpcRef }: SettingsProps) => {
|
const BlockchainProvidersSettings = ({ ethRpcRef, solRpcRef, maticRpcRef }: SettingsProps) => {
|
||||||
const account = useAccount();
|
const account = useAccount();
|
||||||
const { plebbitOptions } = account || {};
|
const { plebbitOptions } = account || {};
|
||||||
const { chainProviders } = plebbitOptions || {};
|
const { chainProviders } = plebbitOptions || {};
|
||||||
const ethRpcDefaultValue = chainProviders?.['eth']?.urls.join('\n');
|
const ethRpcDefaultValue = chainProviders?.['eth']?.urls.join('\n');
|
||||||
const solRpcDefaultValue = chainProviders?.['sol']?.urls.join('\n');
|
const solRpcDefaultValue = chainProviders?.['sol']?.urls.join('\n');
|
||||||
const maticRpcDefaultValue = chainProviders?.['matic']?.urls.join('\n');
|
const maticRpcDefaultValue = chainProviders?.['matic']?.urls.join('\n');
|
||||||
const avaxRpcDefaultValue = chainProviders?.['avax']?.urls.join('\n');
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.blockchainProvidersSettings}>
|
<div className={styles.blockchainProvidersSettings}>
|
||||||
<span className={styles.settingTip}>Ethereum RPC, for .eth addresses</span>
|
<span className={styles.settingTip}>Ethereum RPC, for .eth domains</span>
|
||||||
<div>
|
<div>
|
||||||
<textarea defaultValue={ethRpcDefaultValue} ref={ethRpcRef} autoCorrect='off' autoComplete='off' spellCheck='false' />
|
<textarea defaultValue={ethRpcDefaultValue} ref={ethRpcRef} autoCorrect='off' autoComplete='off' spellCheck='false' />
|
||||||
</div>
|
</div>
|
||||||
<span className={styles.settingTip}>Solana RPC, for .sol addresses</span>
|
<span className={styles.settingTip}>Solana RPC, for .sol domains</span>
|
||||||
<div>
|
<div>
|
||||||
<textarea defaultValue={solRpcDefaultValue} ref={solRpcRef} autoCorrect='off' autoComplete='off' spellCheck='false' />
|
<textarea defaultValue={solRpcDefaultValue} ref={solRpcRef} autoCorrect='off' autoComplete='off' spellCheck='false' />
|
||||||
</div>
|
</div>
|
||||||
<span className={styles.settingTip}>Polygon RPC, for nft profile pics</span>
|
<span className={styles.settingTip}>Polygon RPC, for avatar NFTs</span>
|
||||||
<div>
|
<div>
|
||||||
<textarea defaultValue={maticRpcDefaultValue} ref={maticRpcRef} autoCorrect='off' autoComplete='off' spellCheck='false' />
|
<textarea defaultValue={maticRpcDefaultValue} ref={maticRpcRef} autoCorrect='off' autoComplete='off' spellCheck='false' />
|
||||||
</div>
|
</div>
|
||||||
<span className={styles.settingTip}>Avalanche RPC</span>
|
|
||||||
<div>
|
|
||||||
<textarea defaultValue={avaxRpcDefaultValue} ref={avaxRpcRef} autoCorrect='off' autoComplete='off' spellCheck='false' />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -163,7 +157,6 @@ const PlebbitOptions = () => {
|
|||||||
const ethRpcRef = useRef<HTMLTextAreaElement>(null);
|
const ethRpcRef = useRef<HTMLTextAreaElement>(null);
|
||||||
const solRpcRef = useRef<HTMLTextAreaElement>(null);
|
const solRpcRef = useRef<HTMLTextAreaElement>(null);
|
||||||
const maticRpcRef = useRef<HTMLTextAreaElement>(null);
|
const maticRpcRef = useRef<HTMLTextAreaElement>(null);
|
||||||
const avaxRpcRef = useRef<HTMLTextAreaElement>(null);
|
|
||||||
const httpRoutersRef = useRef<HTMLTextAreaElement>(null);
|
const httpRoutersRef = useRef<HTMLTextAreaElement>(null);
|
||||||
const plebbitRpcRef = useRef<HTMLInputElement>(null);
|
const plebbitRpcRef = useRef<HTMLInputElement>(null);
|
||||||
const plebbitDataPathRef = useRef<HTMLInputElement>(null);
|
const plebbitDataPathRef = useRef<HTMLInputElement>(null);
|
||||||
@@ -196,11 +189,6 @@ const PlebbitOptions = () => {
|
|||||||
.map((url) => url.trim())
|
.map((url) => url.trim())
|
||||||
.filter((url) => url !== '');
|
.filter((url) => url !== '');
|
||||||
|
|
||||||
const avaxRpcUrls = avaxRpcRef.current?.value
|
|
||||||
.split('\n')
|
|
||||||
.map((url) => url.trim())
|
|
||||||
.filter((url) => url !== '');
|
|
||||||
|
|
||||||
const httpRoutersOptions = httpRoutersRef.current?.value
|
const httpRoutersOptions = httpRoutersRef.current?.value
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.map((url) => url.trim())
|
.map((url) => url.trim())
|
||||||
@@ -222,10 +210,6 @@ const PlebbitOptions = () => {
|
|||||||
urls: maticRpcUrls,
|
urls: maticRpcUrls,
|
||||||
chainId: 137,
|
chainId: 137,
|
||||||
},
|
},
|
||||||
avax: {
|
|
||||||
urls: avaxRpcUrls,
|
|
||||||
chainId: 43114,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -276,7 +260,7 @@ const PlebbitOptions = () => {
|
|||||||
blockchain providers:
|
blockchain providers:
|
||||||
</span>
|
</span>
|
||||||
<span className={styles.categorySettings}>
|
<span className={styles.categorySettings}>
|
||||||
<BlockchainProvidersSettings ethRpcRef={ethRpcRef} solRpcRef={solRpcRef} maticRpcRef={maticRpcRef} avaxRpcRef={avaxRpcRef} />
|
<BlockchainProvidersSettings ethRpcRef={ethRpcRef} solRpcRef={solRpcRef} maticRpcRef={maticRpcRef} />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.category}>
|
<div className={styles.category}>
|
||||||
|
|||||||
Reference in New Issue
Block a user