Skip to content

Commit

Permalink
renamed HugeDecimalInput to NumericInput
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Oct 2, 2024
1 parent 7fbf3ec commit ef43179
Show file tree
Hide file tree
Showing 44 changed files with 168 additions and 141 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
Button,
CodeMirrorInput,
FormSwitchCard,
HugeDecimalInput,
InputErrorMessage,
InputLabel,
NativeCoinSelector,
NumericInput,
RadioInput,
SegmentedControlsTitle,
SelectInput,
Expand Down Expand Up @@ -413,7 +413,7 @@ export const AuthzGrantRevokeComponent: ActionComponent<
tooltip={t('form.callsDescription')}
/>

<HugeDecimalInput
<NumericInput
containerClassName="grow"
disabled={!isCreating}
error={errors?.calls}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import { HugeDecimal } from '@dao-dao/math'
import {
Button,
ErrorPage,
HugeDecimalInput,
IconButton,
InputErrorMessage,
InputLabel,
Loader,
MarkdownRenderer,
NumericInput,
RebalancerProjector,
RebalancerProjectorAsset,
SegmentedControls,
Expand Down Expand Up @@ -456,7 +456,7 @@ export const ConfigureRebalancerComponent: ActionComponent<
<div className="space-y-2">
{/* eslint-disable-next-line i18next/no-literal-string */}
<InputLabel name="P" />
<HugeDecimalInput
<NumericInput
error={errors?.pid?.kp}
fieldName={(fieldNamePrefix + 'pid.kp') as 'pid.kp'}
hidePlusMinus
Expand All @@ -474,7 +474,7 @@ export const ConfigureRebalancerComponent: ActionComponent<
<div className="space-y-2">
{/* eslint-disable-next-line i18next/no-literal-string */}
<InputLabel name="I" />
<HugeDecimalInput
<NumericInput
error={errors?.pid?.ki}
fieldName={(fieldNamePrefix + 'pid.ki') as 'pid.ki'}
hidePlusMinus
Expand All @@ -492,7 +492,7 @@ export const ConfigureRebalancerComponent: ActionComponent<
<div className="space-y-2">
{/* eslint-disable-next-line i18next/no-literal-string */}
<InputLabel name="D" />
<HugeDecimalInput
<NumericInput
error={errors?.pid?.kd}
fieldName={(fieldNamePrefix + 'pid.kd') as 'pid.kd'}
hidePlusMinus
Expand Down Expand Up @@ -588,7 +588,7 @@ export const ConfigureRebalancerComponent: ActionComponent<

{maxLimitEnabled && (
<div className="flex flex-row gap-2 self-start">
<HugeDecimalInput
<NumericInput
containerClassName="grow min-w-[min(8rem,50%)]"
error={errors?.maxLimit}
fieldName={(fieldNamePrefix + 'maxLimit') as 'maxLimit'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { useTranslation } from 'react-i18next'

import { HugeDecimal } from '@dao-dao/math'
import {
HugeDecimalInput,
InputErrorMessage,
InputLabel,
MarkdownRenderer,
NumericInput,
PercentButton,
SegmentedControls,
SelectInput,
Expand Down Expand Up @@ -194,7 +194,7 @@ export const CreateRewardDistributionComponent: ActionComponent<

{!immediate && (
<div className="bg-background-tertiary flex flex-wrap flex-row gap-x-4 gap-y-2 px-4 py-3 rounded-md max-w-prose">
<HugeDecimalInput
<NumericInput
containerClassName="grow"
disabled={!isCreating}
error={errors?.rate?.amount}
Expand All @@ -217,7 +217,7 @@ export const CreateRewardDistributionComponent: ActionComponent<

<div className="flex grow flex-row gap-2">
<div className="flex flex-col gap-1 grow">
<HugeDecimalInput
<NumericInput
disabled={!isCreating}
error={errors?.rate?.duration?.value}
fieldName={
Expand Down Expand Up @@ -265,7 +265,7 @@ export const CreateRewardDistributionComponent: ActionComponent<
{t('info.initialRewardsFundsDescription')}
</p>

<HugeDecimalInput
<NumericInput
containerClassName={!isCreating ? 'self-start' : undefined}
disabled={!isCreating}
fieldName={(fieldNamePrefix + 'initialFunds') as 'initialFunds'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { useTranslation } from 'react-i18next'
import { HugeDecimal } from '@dao-dao/math'
import {
FilterableItemPopup,
HugeDecimalInput,
InputErrorMessage,
InputLabel,
InputThemedText,
NumericInput,
PercentButton,
StatusCard,
TokenAmountDisplay,
Expand Down Expand Up @@ -160,7 +160,7 @@ export const FundRewardDistributionComponent: ActionComponent<
<div className="flex flex-col gap-2 max-w-prose">
<InputLabel name={t('form.funds')} primary />

<HugeDecimalInput
<NumericInput
containerClassName={clsx(!isCreating && 'self-start')}
disabled={!isCreating}
fieldName={(fieldNamePrefix + 'amount') as 'amount'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import {
Button,
CodeMirrorInput,
CopyToClipboard,
HugeDecimalInput,
InputErrorMessage,
InputLabel,
NativeCoinSelector,
NumericInput,
TextInput,
useActionOptions,
useChain,
Expand Down Expand Up @@ -132,7 +132,7 @@ export const InstantiateComponent: ActionComponent<InstantiateOptions> = ({
<div className="flex flex-row items-center gap-2">
<div className="flex flex-col items-stretch gap-1">
<InputLabel name={t('form.codeId')} />
<HugeDecimalInput
<NumericInput
disabled={!isCreating}
error={errors?.codeId}
fieldName={fieldNamePrefix + 'codeId'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import {
CodeMirrorInput,
CopyToClipboard,
ErrorPage,
HugeDecimalInput,
InputErrorMessage,
InputLabel,
NativeCoinSelector,
NumericInput,
TextInput,
useActionOptions,
useChain,
Expand Down Expand Up @@ -118,7 +118,7 @@ export const Instantiate2Component: ActionComponent<Instantiate2Options> = ({
<div className="flex flex-row items-center gap-2">
<div className="flex flex-col items-stretch gap-1">
<InputLabel name={t('form.codeId')} />
<HugeDecimalInput
<NumericInput
disabled={!isCreating}
error={errors?.codeId}
fieldName={fieldNamePrefix + 'codeId'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { useTranslation } from 'react-i18next'

import { HugeDecimal } from '@dao-dao/math'
import {
HugeDecimalInput,
InputErrorMessage,
InputLabel,
NumericInput,
SelectInput,
TokenAmountDisplay,
ValidatorPicker,
Expand Down Expand Up @@ -340,7 +340,7 @@ export const ManageStakingComponent: ActionComponent<
{/* If not withdrawing reward or updating withdraw address, show amount input. */}
{type !== StakingActionType.WithdrawDelegatorReward &&
type !== StakingActionType.SetWithdrawAddress && (
<HugeDecimalInput
<NumericInput
containerClassName="grow"
disabled={!isCreating}
error={errors?.amount}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { useTranslation } from 'react-i18next'

import {
FilterableItemPopup,
HugeDecimalInput,
InputErrorMessage,
InputLabel,
Loader,
NumericInput,
SegmentedControlsTitle,
useActionOptions,
} from '@dao-dao/stateless'
Expand Down Expand Up @@ -113,7 +113,7 @@ export const ManageSubDaoPauseComponent: ActionComponent<
<div className="flex flex-col gap-1">
<InputLabel name={t('form.blocksToPauseFor')} />

<HugeDecimalInput
<NumericInput
error={errors?.pauseBlocks}
fieldName={(fieldNamePrefix + 'pauseBlocks') as 'pauseBlocks'}
getValues={getValues}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import {
CopyToClipboard,
DateTimePicker,
DateTimePickerNoForm,
HugeDecimalInput,
IconButton,
InputErrorMessage,
InputLabel,
NumericInput,
RadioInput,
RadioInputOption,
SelectInput,
Expand Down Expand Up @@ -610,7 +610,7 @@ export const BeginVesting: ActionComponent<BeginVestingOptions> = ({
<div className="flex shrink-0 flex-col gap-1">
<InputLabel name={t('form.unlockPercent')} />

<HugeDecimalInput
<NumericInput
disabled={!isCreating}
error={errors?.steps?.[index]?.percent}
fieldName={
Expand Down Expand Up @@ -645,7 +645,7 @@ export const BeginVesting: ActionComponent<BeginVestingOptions> = ({
</div>

<div className="flex flex-row gap-1">
<HugeDecimalInput
<NumericInput
disabled={!isCreating}
error={errors?.steps?.[index]?.delay?.value}
fieldName={
Expand Down
4 changes: 2 additions & 2 deletions packages/stateful/actions/core/actions/Migrate/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { useTranslation } from 'react-i18next'
import {
AddressInput,
CodeMirrorInput,
HugeDecimalInput,
InputErrorMessage,
InputLabel,
NumericInput,
StatusCard,
useActionOptions,
useChain,
Expand Down Expand Up @@ -72,7 +72,7 @@ export const MigrateContractComponent: ActionComponent<MigrateOptions> = ({
</div>
<div className="flex flex-col gap-1">
<InputLabel name={t('form.codeId')} />
<HugeDecimalInput
<NumericInput
containerClassName="xs:h-full"
disabled={!isCreating}
error={errors?.codeId}
Expand Down
4 changes: 2 additions & 2 deletions packages/stateful/actions/core/actions/Spend/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import {
ChainLogo,
ChainProvider,
FormSwitchCard,
HugeDecimalInput,
IbcDestinationChainPicker,
InputErrorMessage,
InputLabel,
InputThemedText,
Loader,
NumericInput,
PercentButton,
SelectInput,
StatusCard,
Expand Down Expand Up @@ -795,7 +795,7 @@ export const SpendComponent: ActionComponent<SpendOptions> = ({
{isCreating ? (
<>
<div className="flex flex-row gap-1">
<HugeDecimalInput
<NumericInput
disabled={!isCreating}
error={errors?.ibcTimeout?.value}
fieldName={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { useTranslation } from 'react-i18next'
import { HugeDecimal } from '@dao-dao/math'
import {
FilterableItemPopup,
HugeDecimalInput,
InputErrorMessage,
InputLabel,
InputThemedText,
MarkdownRenderer,
NumericInput,
SegmentedControls,
SelectInput,
StatusCard,
Expand Down Expand Up @@ -188,7 +188,7 @@ export const UpdateRewardDistributionComponent: ActionComponent<

{!immediate && (
<div className="flex flex-wrap flex-row gap-x-4 gap-y-2 px-4 py-3 bg-background-tertiary rounded-md max-w-prose">
<HugeDecimalInput
<NumericInput
containerClassName="grow"
disabled={!isCreating}
error={errors?.rate?.amount}
Expand All @@ -211,7 +211,7 @@ export const UpdateRewardDistributionComponent: ActionComponent<

<div className="flex grow flex-row gap-2">
<div className="flex flex-col gap-1 grow">
<HugeDecimalInput
<NumericInput
disabled={!isCreating}
error={errors?.rate?.duration?.value}
fieldName={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next'
import {
FilmSlateEmoji,
FormSwitchCard,
HugeDecimalInput,
NumericInput,
SelectInput,
} from '@dao-dao/stateless'
import {
Expand Down Expand Up @@ -45,7 +45,7 @@ const ActiveThresholdInput = ({
{enabled && (
<>
<div className="flex flex-row gap-2">
<HugeDecimalInput
<NumericInput
containerClassName="grow min-w-[8rem]"
error={errors?.activeThreshold?.value}
fieldName="activeThreshold.value"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { useTranslation } from 'react-i18next'

import {
HugeDecimalInput,
MegaphoneEmoji,
SelectInput,
} from '@dao-dao/stateless'
import { MegaphoneEmoji, NumericInput, SelectInput } from '@dao-dao/stateless'
import {
DaoCreationVotingConfigItem,
DaoCreationVotingConfigItemInputProps,
Expand All @@ -31,7 +27,7 @@ const QuorumInput = ({
return (
<div className="flex flex-row gap-2">
{!majority && (
<HugeDecimalInput
<NumericInput
containerClassName="grow min-w-[8rem]"
error={errors?.quorum?.value}
fieldName="quorum.value"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { useTranslation } from 'react-i18next'

import {
HourglassEmoji,
HugeDecimalInput,
SelectInput,
} from '@dao-dao/stateless'
import { HourglassEmoji, NumericInput, SelectInput } from '@dao-dao/stateless'
import {
DaoCreationVotingConfigItem,
DaoCreationVotingConfigItemInputProps,
Expand All @@ -30,7 +26,7 @@ export const VotingDurationInput = ({

return (
<div className="flex flex-row gap-2">
<HugeDecimalInput
<NumericInput
containerClassName="grow"
error={errors?.votingDuration?.value}
fieldName="votingDuration.value"
Expand Down
4 changes: 2 additions & 2 deletions packages/stateful/components/gov/GovProposalStatusAndInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { HugeDecimal } from '@dao-dao/math'
import { genericTokenSelector } from '@dao-dao/state/recoil'
import {
GOV_PROPOSAL_STATUS_I18N_KEY_MAP,
HugeDecimalInput,
Logo,
NumericInput,
ProposalStatusAndInfoProps,
ProposalStatusAndInfo as StatelessProposalStatusAndInfo,
Tooltip,
Expand Down Expand Up @@ -288,7 +288,7 @@ const InnerGovProposalStatusAndInfo = ({
status === ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD
? {
header: (
<HugeDecimalInput
<NumericInput
containerClassName="-mb-1"
max={missingDeposit.toHumanReadableString(
depositToken.decimals
Expand Down
Loading

0 comments on commit ef43179

Please sign in to comment.