11import { React } from "react" ;
22import { useNavigate } from "react-router-dom" ;
3- import { Button } from "react-bootstrap" ;
3+ import { Button , Col , Row } from "react-bootstrap" ;
44import { useTranslation } from "react-i18next" ;
55import PropTypes from "prop-types" ;
66import Form from "react-bootstrap/Form" ;
77import LoadingComponent from "../util/loading-component/loading-component" ;
88import ContentBody from "../util/content-body/content-body" ;
9- import ContentFooter from "../util/content-footer/content-footer" ;
109import FormInput from "../util/forms/form-input" ;
1110import RadioButtons from "../util/forms/radio-buttons" ;
11+ import StickyFooter from "../util/sticky-footer" ;
1212
1313/**
1414 * The user form component.
@@ -17,6 +17,7 @@ import RadioButtons from "../util/forms/radio-buttons";
1717 * @param {object } props.activationCode The activationCode object to modify in the form.
1818 * @param {Function } props.handleInput Handles form input.
1919 * @param {Function } props.handleSubmit Handles form submit.
20+ * @param {Function } props.handleSaveNoClose Handles form submit without close.
2021 * @param {string } props.headerText Headline text.
2122 * @param {boolean } props.isLoading Indicator of whether the form is loading
2223 * @param {string } props.loadingMessage The loading message for the spinner
@@ -48,44 +49,48 @@ function ActivationCodeForm({
4849 < >
4950 < LoadingComponent isLoading = { isLoading } loadingMessage = { loadingMessage } />
5051 < Form >
51- < h1 id = "h1UserDisplayName" > { headerText } </ h1 >
52- < ContentBody >
53- < div className = "mb-2" >
54- < FormInput
55- title = "display-name"
56- type = "text"
57- label = { t ( "display-name-label" ) }
58- placeholder = { t ( "display-name-placeholder" ) }
59- value = { activationCode . displayName }
60- onChange = { handleInput }
61- name = "displayName"
62- required
63- />
64- </ div >
65- < div className = "mb-2" >
66- < RadioButtons
67- radioGroupName = "role"
68- handleChange = { handleInput }
69- options = { roles }
70- label = { t ( "role-label" ) }
71- selected = { activationCode . role }
72- />
73- < div >
74- < small > { t ( "role-external-user-helptext" ) } </ small >
75- </ div >
76- < div >
77- < small > { t ( "role-external-user-admin-helptext" ) } </ small >
78- </ div >
79- </ div >
80- </ ContentBody >
81- < ContentFooter >
52+ < Row className = "m-3" >
53+ < h1 id = "h1UserDisplayName" > { headerText } </ h1 >
54+ < Col >
55+ < ContentBody >
56+ < div className = "mb-2" >
57+ < FormInput
58+ title = "display-name"
59+ type = "text"
60+ label = { t ( "display-name-label" ) }
61+ placeholder = { t ( "display-name-placeholder" ) }
62+ value = { activationCode . displayName }
63+ onChange = { handleInput }
64+ name = "displayName"
65+ required
66+ />
67+ </ div >
68+ < div className = "mb-2" >
69+ < RadioButtons
70+ radioGroupName = "role"
71+ handleChange = { handleInput }
72+ options = { roles }
73+ label = { t ( "role-label" ) }
74+ selected = { activationCode . role }
75+ />
76+ < div >
77+ < small > { t ( "role-external-user-helptext" ) } </ small >
78+ </ div >
79+ < div >
80+ < small > { t ( "role-external-user-admin-helptext" ) } </ small >
81+ </ div >
82+ </ div >
83+ </ ContentBody >
84+ </ Col >
85+ </ Row >
86+
87+ < StickyFooter >
8288 < Button
8389 variant = "secondary"
8490 type = "button"
8591 id = "cancel_user"
8692 onClick = { ( ) => navigate ( "/activation/list/" ) }
8793 className = "margin-right-button"
88- size = "lg"
8994 >
9095 { t ( "cancel-button" ) }
9196 </ Button >
@@ -94,12 +99,10 @@ function ActivationCodeForm({
9499 type = "button"
95100 onClick = { handleSubmit }
96101 id = "save_user"
97- size = "lg"
98- className = "col"
99102 >
100103 { t ( "save-button" ) }
101104 </ Button >
102- </ ContentFooter >
105+ </ StickyFooter >
103106 </ Form >
104107 </ >
105108 ) ;
@@ -112,6 +115,7 @@ ActivationCodeForm.propTypes = {
112115 } ) . isRequired ,
113116 handleInput : PropTypes . func . isRequired ,
114117 handleSubmit : PropTypes . func . isRequired ,
118+ handleSaveNoClose : PropTypes . func . isRequired ,
115119 headerText : PropTypes . string . isRequired ,
116120 isLoading : PropTypes . bool ,
117121 loadingMessage : PropTypes . string ,
0 commit comments