Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove undo button
Browse files Browse the repository at this point in the history
teodorus-nathaniel committed Jul 17, 2024
1 parent e17d636 commit 70a4a1b
Showing 1 changed file with 24 additions and 28 deletions.
52 changes: 24 additions & 28 deletions src/components/moderation/ModerationForm.tsx
Original file line number Diff line number Diff line change
@@ -9,14 +9,10 @@ import { zodResolver } from '@hookform/resolvers/zod'
import { SocialCallDataArgs } from '@subsocial/data-hub-sdk'
import { ComponentProps, useEffect, useMemo } from 'react'
import { Controller, useForm } from 'react-hook-form'
import {
HiMiniArrowUturnLeft,
HiOutlineInformationCircle,
} from 'react-icons/hi2'
import { HiOutlineInformationCircle } from 'react-icons/hi2'
import { toast } from 'sonner'
import { z } from 'zod'
import FormButton from '../FormButton'
import LinkText from '../LinkText'
import { useName } from '../Name'
import Toast from '../Toast'
import SelectInput, { ListItem } from '../inputs/SelectInput'
@@ -84,17 +80,17 @@ export default function ModerationForm({
const args =
variables.args as SocialCallDataArgs<'synth_moderation_block_resource'>
const isBlockingOwner = args.resourceId === ownerId
const undo = () =>
mutate({
withoutRevalidateCurrentPath: isFromWidget,
callName: 'synth_moderation_unblock_resource',
args: {
resourceId: args.resourceId,
ctxPostIds: ['*'],
ctxAppIds: ['*'],
},
chatId: chatId ?? '',
})
// const undo = () =>
// mutate({
// withoutRevalidateCurrentPath: isFromWidget,
// callName: 'synth_moderation_unblock_resource',
// args: {
// resourceId: args.resourceId,
// ctxPostIds: ['*'],
// ctxAppIds: ['*'],
// },
// chatId: chatId ?? '',
// })

toast.custom((t) => (
<Toast
@@ -108,18 +104,18 @@ export default function ModerationForm({
user {name}
</span>
}
action={
<LinkText
onClick={() => {
undo()
toast.dismiss(t)
}}
variant='primary'
className='flex items-center gap-1 text-sm'
>
<HiMiniArrowUturnLeft /> Undo
</LinkText>
}
// action={
// <LinkText
// onClick={() => {
// undo()
// toast.dismiss(t)
// }}
// variant='primary'
// className='flex items-center gap-1 text-sm'
// >
// <HiMiniArrowUturnLeft /> Undo
// </LinkText>
// }
/>
))
} else if (variables.callName === 'synth_moderation_unblock_resource') {

0 comments on commit 70a4a1b

Please sign in to comment.