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[]; mods: string[];
relays: string[]; relays: string[];
links: ([string] | [string, string])[]; links: ([string] | [string, string])[];
ranking: string; // ranking: string;
}; };
export default function CommunityCreateModal({ export default function CommunityCreateModal({
@@ -90,12 +90,12 @@ export default function CommunityCreateModal({
mods: account ? [account.pubkey] : [], mods: account ? [account.pubkey] : [],
relays: [], relays: [],
links: [], links: [],
ranking: "votes", // ranking: "votes",
}, },
}); });
watch("mods"); watch("mods");
watch("ranking"); // watch("ranking");
watch("banner"); watch("banner");
watch("links"); watch("links");
watch("relays"); watch("relays");
@@ -278,7 +278,7 @@ export default function CommunityCreateModal({
</Flex> </Flex>
</FormControl> </FormControl>
<FormControl isInvalid={!!errors.mods}> {/* <FormControl isInvalid={!!errors.mods}>
<FormLabel>Default Raking</FormLabel> <FormLabel>Default Raking</FormLabel>
<RadioGroup <RadioGroup
value={getValues().ranking} value={getValues().ranking}
@@ -291,7 +291,7 @@ export default function CommunityCreateModal({
</RadioGroup> </RadioGroup>
<FormHelperText>The default way posts are ranked when viewing the community</FormHelperText> <FormHelperText>The default way posts are ranked when viewing the community</FormHelperText>
{errors.ranking?.message && <FormErrorMessage>{errors.ranking?.message}</FormErrorMessage>} {errors.ranking?.message && <FormErrorMessage>{errors.ranking?.message}</FormErrorMessage>}
</FormControl> </FormControl> */}
<FormControl isInvalid={!!errors.mods}> <FormControl isInvalid={!!errors.mods}>
<FormLabel>Relays</FormLabel> <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 pubkey of values.mods) draft.tags.push(["p", pubkey, "", "moderator"]);
for (const url of values.relays) draft.tags.push(["relay", url]); 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]); 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); const signed = await requestSignature(draft);
new NostrPublishAction( new NostrPublishAction(

View File

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