From 97b525e500dcbe59c944a9787a153b7ad6a52ed6 Mon Sep 17 00:00:00 2001 From: franciscotobar <100875069+franciscotobar@users.noreply.github.com> Date: Thu, 5 Dec 2024 01:02:36 -0600 Subject: [PATCH] TOK-514: disabled if builder not operational (#428) * refactor: disabled if builder not operational * refactor: pr comments --- .../builder/BuilderRewardsSettingsForm.tsx | 39 ++++++++++++++----- .../context/BuilderSettingsContext.tsx | 7 ++++ .../settings/builder/index.ts | 2 + .../shared/components/Table/TableCells.tsx | 11 ++---- .../utils/getMostAdvancedProposal.ts | 4 +- 5 files changed, 44 insertions(+), 19 deletions(-) diff --git a/src/app/collective-rewards/settings/builder/BuilderRewardsSettingsForm.tsx b/src/app/collective-rewards/settings/builder/BuilderRewardsSettingsForm.tsx index c102e38b..d13d4e4a 100644 --- a/src/app/collective-rewards/settings/builder/BuilderRewardsSettingsForm.tsx +++ b/src/app/collective-rewards/settings/builder/BuilderRewardsSettingsForm.tsx @@ -7,8 +7,9 @@ import { FC, useEffect, useState } from 'react' import { useForm } from 'react-hook-form' import { GoRocket } from 'react-icons/go' import { z } from 'zod' -import { percentageToWei } from '../utils' +import { percentageToWei } from '@/app/collective-rewards/settings/utils' import { useBuilderSettingsContext } from './context' +import { Popover } from '@/components/Popover' const formSchema = z.object({ reward: z @@ -42,6 +43,7 @@ export const BuilderRewardsSettingsForm: FC = () => { const { current: { refetch, isLoading: isCurrentRewardsLoading }, update: { isSuccess, setNewReward, isPending }, + isBuilderOperational, } = useBuilderSettingsContext() const form = useForm>({ @@ -84,7 +86,12 @@ export const BuilderRewardsSettingsForm: FC = () => { {isCurrentRewardsLoading ? ( ) : ( - + )} @@ -92,14 +99,28 @@ export const BuilderRewardsSettingsForm: FC = () => { )} >
-
+ } + size="small" + position="top" + trigger="hover" + disabled={isBuilderOperational} > - Save changes - + +