Skip to content

Commit

Permalink
Changes according to CR
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip-L committed Jan 10, 2025
1 parent 279bd7d commit 701fac8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/components/DatacapAmountModel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import { Button } from '@/components/ui/button'
import { AllocationUnit, type Allocation, type Application } from '@/type'
import { type ReactNode } from 'react'

type DeviationType = 'contract' | 'directly'
type AllocationType = 'contract' | 'directly'

interface AllocationConfig {
isDialogOpen: boolean
amount: string
unit: AllocationUnit
deviationType?: DeviationType
allocationType?: AllocationType
}

interface DatacapAmountModalProps {
Expand Down Expand Up @@ -80,16 +80,16 @@ const DatacapAmountModal = ({
<div className="flex justify-items-center justify-between content-center items-center w-full">
<FormControl>
<FormLabel id="demo-controlled-radio-buttons-group">
Deviation type
Allocation type
</FormLabel>
<RadioGroup
aria-labelledby="demo-controlled-radio-buttons-group"
value={allocationConfig.deviationType}
value={allocationConfig.allocationType}
onChange={(e) => {
setAllocationConfig({
...allocationConfig,
deviationType: (e.target as HTMLInputElement)
.value as DeviationType,
allocationType: (e.target as HTMLInputElement)
.value as AllocationType,
})
}}
>
Expand Down
12 changes: 6 additions & 6 deletions src/components/cards/AppInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ interface ComponentProps {
allowance: any
}

type DeviationType = 'contract' | 'directly'
type AllocationType = 'contract' | 'directly'

/**
* Represents the information for a specific application.
Expand Down Expand Up @@ -131,12 +131,12 @@ const AppInfoCard: React.FC<ComponentProps> = ({

const [allocationAmountConfig, setAllocationAmountConfig] = useState<{
amount: string
deviationType: DeviationType
allocationType: AllocationType
unit: AllocationUnit
isDialogOpen: boolean
}>({
amount: '',
deviationType: 'directly',
allocationType: 'directly',
unit: AllocationUnit.GIB,
isDialogOpen: false,
})
Expand Down Expand Up @@ -603,7 +603,7 @@ const AppInfoCard: React.FC<ComponentProps> = ({
isDialogOpen: false,
amount: prev.amount || '0',
unit: prev.unit || AllocationUnit.GIB,
deviationType: 'directly',
allocationType: 'directly',
}))
return
}
Expand Down Expand Up @@ -662,7 +662,7 @@ const AppInfoCard: React.FC<ComponentProps> = ({
userName,
allocationAmount: validatedAllocationAmount,
clientContractAddress:
allocationAmountConfig.deviationType === 'contract' &&
allocationAmountConfig.allocationType === 'contract' &&
clientContractAddress
? clientContractAddress
: undefined,
Expand Down Expand Up @@ -740,7 +740,7 @@ const AppInfoCard: React.FC<ComponentProps> = ({
}

setAllocationAmountConfig(() => ({
deviationType: 'directly',
allocationType: 'directly',
amount,
isDialogOpen: false,
unit: unit as AllocationUnit,
Expand Down

0 comments on commit 701fac8

Please sign in to comment.