temporarily disable ranking option

This commit is contained in:
hzrd149
2023-10-25 11:02:13 -05:00
parent e9db90ac7c
commit ed1de42175
3 changed files with 9 additions and 10 deletions

View File

@@ -54,7 +54,7 @@ export type FormValues = {
mods: string[];
relays: string[];
links: ([string] | [string, string])[];
ranking: string;
// ranking: string;
};
export default function CommunityCreateModal({
@@ -90,12 +90,12 @@ export default function CommunityCreateModal({
mods: account ? [account.pubkey] : [],
relays: [],
links: [],
ranking: "votes",
// ranking: "votes",
},
});
watch("mods");
watch("ranking");
// watch("ranking");
watch("banner");
watch("links");
watch("relays");
@@ -278,7 +278,7 @@ export default function CommunityCreateModal({
</Flex>
</FormControl>
<FormControl isInvalid={!!errors.mods}>
{/* <FormControl isInvalid={!!errors.mods}>
<FormLabel>Default Raking</FormLabel>
<RadioGroup
value={getValues().ranking}
@@ -291,7 +291,7 @@ export default function CommunityCreateModal({
</RadioGroup>
<FormHelperText>The default way posts are ranked when viewing the community</FormHelperText>
{errors.ranking?.message && <FormErrorMessage>{errors.ranking?.message}</FormErrorMessage>}
</FormControl>
</FormControl> */}
<FormControl isInvalid={!!errors.mods}>
<FormLabel>Relays</FormLabel>

View File

@@ -47,7 +47,7 @@ function CommunitiesHomePage() {
for (const pubkey of values.mods) draft.tags.push(["p", pubkey, "", "moderator"]);
for (const url of values.relays) draft.tags.push(["relay", url]);
for (const [url, name] of values.links) draft.tags.push(name ? ["r", url, name] : ["r", url]);
if (values.ranking) draft.tags.push(["rank_mode", values.ranking]);
// if (values.ranking) draft.tags.push(["rank_mode", values.ranking]);
const signed = await requestSignature(draft);
new NostrPublishAction(

View File

@@ -1,5 +1,5 @@
import { useMemo } from "react";
import { ModalProps, useDisclosure, useToast } from "@chakra-ui/react";
import { ModalProps, useToast } from "@chakra-ui/react";
import dayjs from "dayjs";
import { DraftNostrEvent, NostrEvent } from "../../../types/nostr-event";
@@ -11,7 +11,6 @@ import {
getCommunityLinks,
getCommunityMods,
getCommunityName,
getCommunityRanking,
getCommunityRelays,
getCommunityRules,
} from "../../../helpers/nostr/communities";
@@ -40,7 +39,7 @@ export default function CommunityEditModal({
mods: getCommunityMods(community) || [],
relays: getCommunityRelays(community) || [],
links: getCommunityLinks(community) || [],
ranking: getCommunityRanking(community) || "votes",
// ranking: getCommunityRanking(community) || "votes",
}),
[community],
);
@@ -67,7 +66,7 @@ export default function CommunityEditModal({
for (const url of values.relays) draft.tags.push(["relay", url]);
for (const [url, name] of values.links) draft.tags.push(name ? ["r", url, name] : ["r", url]);
if (values.ranking) draft.tags.push(["rank_mode", values.ranking]);
// if (values.ranking) draft.tags.push(["rank_mode", values.ranking]);
const signed = await requestSignature(draft);
new NostrPublishAction(