-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1637a20
commit e079084
Showing
3 changed files
with
75 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/component/modal/editRange/forms/components/DeltaInput.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { CSSProperties } from 'react'; | ||
|
||
import FormikInput from '../../../../elements/formik/FormikInput'; | ||
import { translateMultiplet } from '../../../../panels/extra/utilities/MultiplicityUtilities'; | ||
|
||
const style: Record<'input' | 'container', CSSProperties> = { | ||
input: { | ||
width: '50px', | ||
height: '26px', | ||
borderWidth: 0, | ||
}, | ||
container: { | ||
height: '100%', | ||
}, | ||
}; | ||
|
||
const DeltaInput = ({ signal, index, onFocus }) => { | ||
return ( | ||
<div style={{ display: 'flex' }}> | ||
<span>𝛅:</span> | ||
<FormikInput | ||
name={`signals.${index}.delta`} | ||
type="number" | ||
placeholder={'J (Hz)'} | ||
onFocus={onFocus} | ||
style={style} | ||
checkErrorAfterInputTouched={false} | ||
/> | ||
<span> | ||
{signal.j | ||
.map((_coupling) => translateMultiplet(_coupling.multiplicity)) | ||
.join('')} | ||
</span> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DeltaInput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters