mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fixed SettingsModal UI
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect, useRef } from "react";
|
||||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||||
import Modal from "react-modal";
|
import Modal from "react-modal";
|
||||||
import { deleteCaches } from "@plebbit/plebbit-react-hooks";
|
import { deleteCaches, setAccount, useAccount } from "@plebbit/plebbit-react-hooks";
|
||||||
import { StyledModal } from "./styled/SettingsModal.styled";
|
import { StyledModal } from "./styled/SettingsModal.styled";
|
||||||
import useGeneralStore from "../hooks/stores/useGeneralStore";
|
import useGeneralStore from "../hooks/stores/useGeneralStore";
|
||||||
import useError from "../hooks/useError";
|
import useError from "../hooks/useError";
|
||||||
@@ -23,6 +23,13 @@ const SettingsModal = ({ isOpen, closeModal }) => {
|
|||||||
useError(errorMessage, [errorMessage]);
|
useError(errorMessage, [errorMessage]);
|
||||||
useSuccess(successMessage, [successMessage]);
|
useSuccess(successMessage, [successMessage]);
|
||||||
|
|
||||||
|
const account = useAccount();
|
||||||
|
|
||||||
|
const gatewayRef = useRef();
|
||||||
|
const ipfsRef = useRef();
|
||||||
|
const pubsubRef = useRef();
|
||||||
|
const dataPathRef = useRef();
|
||||||
|
|
||||||
|
|
||||||
const handleCloseModal = () => {
|
const handleCloseModal = () => {
|
||||||
closeModal();
|
closeModal();
|
||||||
@@ -89,7 +96,7 @@ const SettingsModal = ({ isOpen, closeModal }) => {
|
|||||||
</button>
|
</button>
|
||||||
]
|
]
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
{/* <ul>
|
||||||
<li className="settings-cat-lbl">
|
<li className="settings-cat-lbl">
|
||||||
<span className={`${expanded.includes(0) ? 'minus' : 'plus'}`}
|
<span className={`${expanded.includes(0) ? 'minus' : 'plus'}`}
|
||||||
onClick={() => toggleExpanded(0)}
|
onClick={() => toggleExpanded(0)}
|
||||||
@@ -116,7 +123,7 @@ const SettingsModal = ({ isOpen, closeModal }) => {
|
|||||||
<li>
|
<li>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul> */}
|
||||||
<ul>
|
<ul>
|
||||||
<li className="settings-cat-lbl">
|
<li className="settings-cat-lbl">
|
||||||
<span className={`${expanded.includes(2) ? 'minus' : 'plus'}`}
|
<span className={`${expanded.includes(2) ? 'minus' : 'plus'}`}
|
||||||
@@ -143,23 +150,28 @@ const SettingsModal = ({ isOpen, closeModal }) => {
|
|||||||
"https://ipfsgateway.xyz",
|
"https://ipfsgateway.xyz",
|
||||||
"https://cloudflare-ipfs.com"
|
"https://cloudflare-ipfs.com"
|
||||||
].join("\n")}
|
].join("\n")}
|
||||||
|
ref={gatewayRef}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
<ul className="settings-cat" style={{ display: expanded.includes(2) ? 'block' : 'none' }}>
|
<ul className="settings-cat" style={{ display: expanded.includes(2) ? 'block' : 'none' }}>
|
||||||
<li className="settings-option disc">
|
<li className="settings-option disc">
|
||||||
IPFS HTTP Client Options</li>
|
IPFS HTTP Clients Options</li>
|
||||||
<li className="settings-tip">Optional URL of an IPFS API or IpfsHttpClientOptions, http://localhost:5001 to use a local IPFS node.</li>
|
<li className="settings-tip">Optional URLs of IPFS APIs or IpfsHttpClientOptions, 'http://localhost:5001/api/v0' to use a local IPFS node.</li>
|
||||||
<div className="settings-input">
|
<div className="settings-input">
|
||||||
<textarea placeholder="IpfsHttpClientOptions" />
|
<textarea placeholder="IpfsHttpClientsOptions"
|
||||||
|
ref={ipfsRef}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
<ul className="settings-cat" style={{ display: expanded.includes(2) ? 'block' : 'none' }}>
|
<ul className="settings-cat" style={{ display: expanded.includes(2) ? 'block' : 'none' }}>
|
||||||
<li className="settings-option disc">
|
<li className="settings-option disc">
|
||||||
PubSub HTTP Client Options</li>
|
PubSub HTTP Clients Options</li>
|
||||||
<li className="settings-tip">Optional URL or IpfsHttpClientOptions used for pubsub publishing when ipfsHttpClientOptions isn't available, like in the browser.</li>
|
<li className="settings-tip">Optional URLs or IpfsHttpClientOptions used for pubsub publishing when ipfsHttpClientOptions isn't available, like in the browser.</li>
|
||||||
<div className="settings-input">
|
<div className="settings-input">
|
||||||
<textarea placeholder="pubsubHttpClientOptions" defaultValue="https://pubsubprovider.xyz/api/v0" />
|
<textarea placeholder="pubsubHttpClientsOptions" defaultValue="https://pubsubprovider.xyz/api/v0"
|
||||||
|
ref={pubsubRef}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
<ul className="settings-cat" style={{ display: expanded.includes(2) ? 'block' : 'none' }}>
|
<ul className="settings-cat" style={{ display: expanded.includes(2) ? 'block' : 'none' }}>
|
||||||
@@ -167,9 +179,21 @@ const SettingsModal = ({ isOpen, closeModal }) => {
|
|||||||
Data Path (Node Only)</li>
|
Data Path (Node Only)</li>
|
||||||
<li className="settings-tip">Optional folder path to create/resume the user and subplebbit databases.</li>
|
<li className="settings-tip">Optional folder path to create/resume the user and subplebbit databases.</li>
|
||||||
<div className="settings-input">
|
<div className="settings-input">
|
||||||
<textarea placeholder="dataPath" />
|
<textarea placeholder="dataPath"
|
||||||
|
ref={dataPathRef}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
|
{/* <ul className="settings-cat" style={{ display: expanded.includes(2) ? 'block' : 'none' }}>
|
||||||
|
<li className="settings-option disc">
|
||||||
|
Chain Providers</li>
|
||||||
|
<li className="settings-tip">Optional provider RPC URLs and chain IDs.</li>
|
||||||
|
<ul>
|
||||||
|
<li className="settings-option disc">Ethereum</li>
|
||||||
|
<li className="settings-option disc">Avalanche</li>
|
||||||
|
<li className="settings-option disc">Polygon</li>
|
||||||
|
</ul>
|
||||||
|
</ul> */}
|
||||||
</ul>
|
</ul>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in New Issue
Block a user