@@ -3,7 +3,7 @@ import RenderField from "@mds/common/components/forms/RenderField";
3
3
import RenderSubmitButton from "@mds/common/components/forms/RenderSubmitButton" ;
4
4
import { FORM } from "@mds/common/constants/forms" ;
5
5
import { IPermitConditionCategory } from "@mds/common/interfaces" ;
6
- import { Button , Popconfirm , Row , Tooltip , Typography } from "antd" ;
6
+ import { Button , Col , Popconfirm , Row , Tooltip , Typography } from "antd" ;
7
7
import React , { useState } from "react" ;
8
8
import { Field } from "redux-form" ;
9
9
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" ;
@@ -65,59 +65,65 @@ export const EditPermitConditionCategoryInline = (props: IPermitConditionCategor
65
65
66
66
return (
67
67
< FormWrapper scrollOnToggleEdit = { false } name = { formName } onSubmit = { handleSubmit } initialValues = { props . category } isEditMode = { isEditMode } >
68
- < Row className = "flex" style = { { gap : '0.5em' } } >
69
- < Field name = "step" component = { RenderField } required = { true } validate = { [ required ] } />
70
- < PermitConditionCategorySelector showLabel = { false } />
71
- < Button
72
- className = "icon-button-container"
73
- style = { { marginRight : 0 } }
74
- onClick = { cancel }
75
- type = "primary"
76
- icon = { < FontAwesomeIcon icon = { faXmark } /> }
77
- />
68
+ < Row style = { { gap : '0.5em' } } >
69
+ < Col flex-shrink = "1" style = { { maxWidth : '40px' } } >
70
+ < Field name = "step" component = { RenderField } required = { true } validate = { [ required ] } style = { { marginRight : 0 , } } />
71
+ </ Col >
72
+ < Col >
73
+ < PermitConditionCategorySelector showLabel = { false } />
74
+ </ Col >
75
+ < Col flex = "auto" style = { { display : 'flex' , gap : '0.5em' } } >
76
+ < Button
77
+ className = "icon-button-container"
78
+ style = { { marginRight : 0 } }
79
+ onClick = { cancel }
80
+ type = "primary"
81
+ icon = { < FontAwesomeIcon icon = { faXmark } /> }
82
+ />
78
83
79
- < RenderSubmitButton buttonText = "" buttonProps = { { "aria-label" : "Confirm" , className : "icon-button-container" , style : { marginRight : 0 , marginLeft : 0 } , icon : < FontAwesomeIcon icon = { faCheck } /> } } />
84
+ < RenderSubmitButton buttonText = "" buttonProps = { { "aria-label" : "Confirm" , className : "icon-button-container" , style : { marginRight : 0 , marginLeft : 0 } , icon : < FontAwesomeIcon icon = { faCheck } /> } } />
80
85
81
- < Popconfirm
82
- disabled = { props . conditionCount > 0 }
83
- placement = "topRight"
84
- title = {
85
- < >
86
- < Typography . Paragraph > Are you sure you want to delete { props . category . description } ?</ Typography . Paragraph >
87
- < Typography . Paragraph > This action cannot be undone.</ Typography . Paragraph >
88
- </ >
89
- }
90
- onConfirm = { ( ) => handleDelete ( props . category ) }
91
- okText = "Yes, Delete Category"
92
- cancelText = "No"
93
- >
94
- < Button
86
+ < Popconfirm
95
87
disabled = { props . conditionCount > 0 }
96
- danger = { true }
97
- icon = { < FontAwesomeIcon icon = { faTrash } /> }
98
- aria-label = "Delete Category" />
99
- </ Popconfirm >
88
+ placement = "topRight"
89
+ title = {
90
+ < >
91
+ < Typography . Paragraph > Are you sure you want to delete { props . category . description } ?</ Typography . Paragraph >
92
+ < Typography . Paragraph > This action cannot be undone.</ Typography . Paragraph >
93
+ </ >
94
+ }
95
+ onConfirm = { ( ) => handleDelete ( props . category ) }
96
+ okText = "Yes, Delete Category"
97
+ cancelText = "No"
98
+ >
99
+ < Button
100
+ disabled = { props . conditionCount > 0 }
101
+ danger = { true }
102
+ icon = { < FontAwesomeIcon icon = { faTrash } /> }
103
+ aria-label = "Delete Category" />
104
+ </ Popconfirm >
100
105
101
- < Button
102
- disabled = { props . currentPosition <= 0 }
103
- onClick = { ( event ) => {
104
- event . stopPropagation ( ) ;
105
- props . moveUp ( props . category ) ;
106
- } }
107
- type = "default"
108
- aria-label = "Move Category Up"
109
- icon = { < FontAwesomeIcon icon = { faArrowUp } /> }
110
- />
111
- < Button
112
- style = { { marginLeft : 0 } }
113
- disabled = { props . currentPosition >= props . categoryCount - 1 }
114
- aria-label = "Move Category Down"
115
- onClick = { ( event ) => {
116
- event . stopPropagation ( ) ;
117
- props . moveDown ( props . category ) ;
118
- } }
119
- icon = { < FontAwesomeIcon icon = { faArrowDown } /> }
120
- />
106
+ < Button
107
+ disabled = { props . currentPosition <= 0 }
108
+ onClick = { ( event ) => {
109
+ event . stopPropagation ( ) ;
110
+ props . moveUp ( props . category ) ;
111
+ } }
112
+ type = "default"
113
+ aria-label = "Move Category Up"
114
+ icon = { < FontAwesomeIcon icon = { faArrowUp } /> }
115
+ />
116
+ < Button
117
+ style = { { marginLeft : 0 } }
118
+ disabled = { props . currentPosition >= props . categoryCount - 1 }
119
+ aria-label = "Move Category Down"
120
+ onClick = { ( event ) => {
121
+ event . stopPropagation ( ) ;
122
+ props . moveDown ( props . category ) ;
123
+ } }
124
+ icon = { < FontAwesomeIcon icon = { faArrowDown } /> }
125
+ />
126
+ </ Col >
121
127
</ Row >
122
128
</ FormWrapper >
123
129
)
0 commit comments