- {name === 'text-math' && (
- <>
-
Ask a plain text math question, insecure, use ONLY for testing.
-
- Difficulty
-
The math difficulty of the challenge between 1-3.
-
-
- >
- )}
- {name === 'captcha-canvas-v3' && (
- <>
-
Make a custom image captcha
-
- Characters
-
Amount of characters of the captcha.
-
-
-
- Width
-
Height of the captcha.
-
-
-
- Height
-
Width of the captcha.
-
-
-
- Color
-
Color of the captcha.
-
-
- >
- )}
- {name === 'fail' && (
- <>
-
A challenge that automatically fails with a custom error message.
-
- Error
-
The error to display to the author.
-
-
- >
- )}
- {name === 'blacklist' && (
- <>
-
Blacklist author addresses.
-
- Blacklist
-
Comma separated list of author addresses to be blacklisted.
-
-
-
- Error
-
The error to display to the author.
-
-
- >
- )}
- {name === 'question' && (
- <>
-
Ask a question, like 'What is the password?'
-
- Question
-
The question to answer.
-
-
-
- Answer
-
The answer to the question.
-
-
- >
- )}
- {name === 'evm-contract-call' && (
- <>
-
The response from an EVM contract call passes a condition, e.g. a token balance challenge.
-
- chainTicker
-
The chain ticker
-
-
-
- Address
-
The contract address.
-
-
-
- ABI
-
The ABI of the contract method.
-
-
-
- Condition
-
The condition the contract call response must pass.
-
-
-
- Error
-
The error to display to the author.
-
-
- >
- )}
+
{getDefaultChallengeDescription(name)}
+ {challenge?.optionInputs?.map((inputOption: OptionInput) => (
+
+ {inputOption.label}
+
{inputOption.description}
+
handleOptionChange(inputOption.option, e.target.value)}
+ required={inputOption.required || false}
+ />
+
+ ))}
Exclude from challenge
Moderators
Exclude a specific moderator role
@@ -433,19 +385,19 @@ const ChallengeSettings = ({ challenge, showSettings }: ChallengeSettingsProps)
Exclude a specific user action
@@ -513,7 +465,7 @@ const Challenges = () => {
-
+
))}
diff --git a/src/views/subplebbits/subplebbits.module.css b/src/views/subplebbits/subplebbits.module.css
index 09f86580..1bcb6dde 100644
--- a/src/views/subplebbits/subplebbits.module.css
+++ b/src/views/subplebbits/subplebbits.module.css
@@ -119,10 +119,37 @@
margin-left: 5px;
}
-/* TODO: consider to enable this later, when lots of new communities will be proposed */
-/* .title a:visited {
- color: var(--link-visited);
-} */
+.tagline {
+ text-transform: lowercase;
+ margin-top: 2px;
+}
+
+.expandButton {
+ background-size: cover;
+ height: 23px;
+ width: 23px;
+ float: left;
+ margin-right: 5px;
+ margin-top: 2px;
+}
+
+.textButton {
+ background-image: var(--text-button);
+}
+
+.textButton:hover {
+ background-image: var(--text-button-hover);
+ cursor: pointer;
+}
+
+.closeButton {
+ background-image: var(--close-button);
+}
+
+.closeButton:hover {
+ background-image: var(--close-button-hover);
+ cursor: pointer;
+}
.description {
max-width: 60em;
@@ -137,10 +164,6 @@
font-size: 14px;
}
-.tagline {
- text-transform: lowercase;
-}
-
.subplebbitPreferences {
padding: 0 1px;
line-height: 1.6em;
@@ -152,13 +175,25 @@
color: var(--gray-contrast);
font-weight: bold;
margin-right: 5px;
-}
+}
.subplebbitPreferences a:hover {
text-decoration: underline;
cursor: pointer;
}
+.onlineStatus {
+ margin-right: 5px;
+}
+
+.green {
+ color: var(--green);
+}
+
+.red {
+ color: var(--red);
+}
+
.roleLabel {
padding-right: 2px;
}
diff --git a/src/views/subplebbits/subplebbits.tsx b/src/views/subplebbits/subplebbits.tsx
index 88f3d597..51599c00 100644
--- a/src/views/subplebbits/subplebbits.tsx
+++ b/src/views/subplebbits/subplebbits.tsx
@@ -1,50 +1,78 @@
-import { useEffect, useMemo } from 'react';
+import { useEffect, useMemo, useState } from 'react';
import { Link, useLocation } from 'react-router-dom';
import { Trans, useTranslation } from 'react-i18next';
import { Subplebbit as SubplebbitType, useAccount, useAccountSubplebbits, useSubplebbits, useSubplebbitStats } from '@plebbit/plebbit-react-hooks';
import styles from './subplebbits.module.css';
-import Flair from '../../components/post/flair';
import Sidebar from '../../components/sidebar';
import SubscribeButton from '../../components/subscribe-button';
import { getFormattedTimeDuration, getFormattedTimeAgo } from '../../lib/utils/time-utils';
import {
isSubplebbitsView,
- isSubplebbitsMineView,
- isSubplebbitsMineContributorView,
- isSubplebbitsMineSubscriberView,
- isSubplebbitsMineModeratorView,
+ isSubplebbitsSubscriberView,
+ isSubplebbitsModeratorView,
+ isSubplebbitsAdminView,
+ isSubplebbitsOwnerView,
+ isSubplebbitsVoteView,
+ isSubplebbitsVotePassedView,
+ isSubplebbitsVoteRejectedView,
} from '../../lib/utils/view-utils';
import { useDefaultSubplebbitAddresses } from '../../lib/utils/addresses-utils';
import { RoleLabel } from '../../components/post/label/label';
+const isMobile = window.innerWidth <= 768;
interface SubplebbitProps {
index?: number;
subplebbit: SubplebbitType | undefined;
}
-const Tabs = () => {
+const MyCommunitiesTabs = () => {
const { t } = useTranslation();
const location = useLocation();
- const isInSubplebbitsMineSubscriberView = isSubplebbitsMineSubscriberView(location.pathname);
- const isInSubplebbitsMineContributorView = isSubplebbitsMineContributorView(location.pathname);
- const isInSubplebbitsMineModeratorView = isSubplebbitsMineModeratorView(location.pathname);
+ const isInSubplebbitsSubscriberView = isSubplebbitsSubscriberView(location.pathname);
+ const isInSubplebbitsModeratorView = isSubplebbitsModeratorView(location.pathname);
+ const isInSubplebbitsAdminView = isSubplebbitsAdminView(location.pathname);
+ const isInSubplebbitsOwnerView = isSubplebbitsOwnerView(location.pathname);
return (
- {(isInSubplebbitsMineView || isInSubplebbitsMineModeratorView || isInSubplebbitsMineSubscriberView) &&
}
+ {isInSubplebbitsSubscriberView || isInSubplebbitsModeratorView || isInSubplebbitsAdminView || isInSubplebbitsOwnerView ?
:
}
{isInSubplebbitsView &&
}
- {isInSubplebbitsMineModeratorView &&
}
- {isInSubplebbitsMineSubscriberView &&
}
+ {(isInSubplebbitsModeratorView || isInSubplebbitsAdminView || isInSubplebbitsOwnerView) &&
}
+ {isInSubplebbitsSubscriberView &&
}
);
};
diff --git a/yarn.lock b/yarn.lock
index 0a4da917..5198fc6c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2545,6 +2545,59 @@
mkdirp "^1.0.4"
rimraf "^3.0.2"
+"@plebbit/plebbit-js@https://github.com/plebbit/plebbit-js.git#4a7ced7497fcbf863e9457b7e83a7bb2889bd518":
+ version "0.0.3"
+ resolved "https://github.com/plebbit/plebbit-js.git#4a7ced7497fcbf863e9457b7e83a7bb2889bd518"
+ dependencies:
+ "@ensdomains/eth-ens-namehash" "2.0.15"
+ "@keyv/sqlite" "3.6.2"
+ "@plebbit/plebbit-logger" "github:plebbit/plebbit-logger#9525ca9539479918931c3b334e8d490d1c87e507"
+ "@plebbit/proper-lockfile" "github:plebbit/node-proper-lockfile#7fd6332117340c1d3d98dd0afee2d31cc06f72b8"
+ "@types/node-fetch" "2.6.2"
+ "@types/proper-lockfile" "4.1.2"
+ "@types/uuid" "8.3.4"
+ assert "2.0.0"
+ async-wait-until "2.0.12"
+ better-sqlite3 "9.2.0"
+ buffer "6.0.3"
+ captcha-canvas "3.2.1"
+ cbor "9.0.1"
+ debounce "1.2.1"
+ err-code "3.0.1"
+ ethers "6.7.0"
+ ext-name "5.0.0"
+ file-type "16.5.4"
+ form-data "4.0.0"
+ hpagent "1.2.0"
+ ipfs-http-client "56.0.3"
+ ipfs-only-hash "4.0.0"
+ is-ipfs "6.0.2"
+ jose "4.11.0"
+ js-sha256 "0.9.0"
+ keyv "4.5.4"
+ knex "3.0.1"
+ libp2p-crypto "0.21.2"
+ limiter "2.1.0"
+ localforage "1.10.0"
+ lodash-es "4.17.21"
+ lru-cache "7.18.3"
+ open-graph-scraper "4.11.1"
+ p-limit "3.1.0"
+ p-timeout "4.1.0"
+ peer-id "0.16.0"
+ probe-image-size "7.2.3"
+ retry "0.13.1"
+ rpc-websockets "7.6.0"
+ safe-stable-stringify "2.4.1"
+ sha1-uint8array "0.10.3"
+ skia-canvas "1.0.0"
+ sqlite3 "5.1.6"
+ tiny-typed-emitter "2.1.0"
+ tinycache "1.1.2"
+ ts-custom-error "3.3.1"
+ uuid "9.0.0"
+ viem "1.5.2"
+
"@plebbit/plebbit-js@https://github.com/plebbit/plebbit-js.git#d081a9f4f1a086b5fccee5e9f332e113f61a90f1":
version "0.0.3"
resolved "https://github.com/plebbit/plebbit-js.git#d081a9f4f1a086b5fccee5e9f332e113f61a90f1"
@@ -2625,6 +2678,21 @@
uuid "8.3.2"
zustand "4.0.0"
+"@plebbit/plebbit-react-hooks@https://github.com/plebbit/plebbit-react-hooks.git#80f19b488013cf386f4926fefb5790c79a3b9b96":
+ version "0.0.1"
+ resolved "https://github.com/plebbit/plebbit-react-hooks.git#80f19b488013cf386f4926fefb5790c79a3b9b96"
+ dependencies:
+ "@plebbit/plebbit-js" "https://github.com/plebbit/plebbit-js.git#4a7ced7497fcbf863e9457b7e83a7bb2889bd518"
+ "@plebbit/plebbit-logger" "https://github.com/plebbit/plebbit-logger.git"
+ assert "2.0.0"
+ ethers "5.6.9"
+ localforage "1.10.0"
+ lodash.isequal "4.5.0"
+ memoizee "0.4.15"
+ quick-lru "5.1.1"
+ uuid "8.3.2"
+ zustand "4.0.0"
+
"@plebbit/proper-lockfile@github:plebbit/node-proper-lockfile#7fd6332117340c1d3d98dd0afee2d31cc06f72b8":
version "4.1.2"
resolved "https://codeload.github.com/plebbit/node-proper-lockfile/tar.gz/7fd6332117340c1d3d98dd0afee2d31cc06f72b8"
@@ -12977,7 +13045,7 @@ pretty-format@^29.0.0, pretty-format@^29.7.0:
ansi-styles "^5.0.0"
react-is "^18.0.0"
-probe-image-size@^7.2.3:
+probe-image-size@7.2.3, probe-image-size@^7.2.3:
version "7.2.3"
resolved "https://registry.yarnpkg.com/probe-image-size/-/probe-image-size-7.2.3.tgz#d49c64be540ec8edea538f6f585f65a9b3ab4309"
integrity sha512-HubhG4Rb2UH8YtV4ba0Vp5bQ7L78RTONYu/ujmCu5nBI8wGv24s4E9xSKBi0N1MowRpxk76pFCpJtW0KPzOK0w==