-
Notifications
You must be signed in to change notification settings - Fork 10
fix: initial contract form #41
base: main
Are you sure you want to change the base?
fix: initial contract form #41
Conversation
type ThintValuesAndMessages = Record<string, TTimeFrameConfig>; | ||
|
||
const hintValuesAndMessages: ThintValuesAndMessages = { | ||
minutes: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be created dynamically based on contracts_for
response.
const handleDurationToggle = () => setDurationOpen(prev => !prev); | ||
|
||
const handleDurationSelect = (value: string) => setSelectedDuration(value); | ||
const dropDownValues = [t('duration'), t('end time')]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const dropDownValues = [t('duration'), t('end time')]; | |
const dropDownValues = [t('Duration'), t('End time')]; |
const DurationAndTimeout = () => { | ||
const { t } = useTranslation(); | ||
const [isDurationOpen, setDurationOpen] = useState(false); | ||
const [selectedDuration, setSelectedDuration] = useState(t('duration')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be using a key to keep track of the selection. It we use the translated value it won't work properly when we switch language.
import { useState } from 'react'; | ||
import DurationIndex from './duration/DurationIndex'; | ||
|
||
const DurationAndTimeout = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const DurationAndTimeout = () => { | |
const DurationTypeDropdown = () => { |
const DurationIndex = () => { | ||
const { t } = useTranslation(); | ||
|
||
const [selectedTimeFrame, setSelectedTimeFrame] = useState(t('minutes')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Use keys to keep track of the selection.
No description provided.