feat: Use environment variables for default admin configuration
This commit is contained in:
@@ -5,33 +5,40 @@ import { Popup } from '../lib/custom-ui';
|
||||
|
||||
import UserInformationEdit from './UserInformationEdit';
|
||||
|
||||
const UserInformationEditStep = React.memo(({ defaultData, onUpdate, onBack, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
const UserInformationEditStep = React.memo(
|
||||
({ defaultData, isNameEditable, onUpdate, onBack, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const handleUpdate = useCallback(
|
||||
(data) => {
|
||||
onUpdate(data);
|
||||
onClose();
|
||||
},
|
||||
[onUpdate, onClose],
|
||||
);
|
||||
const handleUpdate = useCallback(
|
||||
(data) => {
|
||||
onUpdate(data);
|
||||
onClose();
|
||||
},
|
||||
[onUpdate, onClose],
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Popup.Header onBack={onBack}>
|
||||
{t('common.editInformation', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Popup.Header>
|
||||
<Popup.Content>
|
||||
<UserInformationEdit defaultData={defaultData} onUpdate={handleUpdate} />
|
||||
</Popup.Content>
|
||||
</>
|
||||
);
|
||||
});
|
||||
return (
|
||||
<>
|
||||
<Popup.Header onBack={onBack}>
|
||||
{t('common.editInformation', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Popup.Header>
|
||||
<Popup.Content>
|
||||
<UserInformationEdit
|
||||
defaultData={defaultData}
|
||||
isNameEditable={isNameEditable}
|
||||
onUpdate={handleUpdate}
|
||||
/>
|
||||
</Popup.Content>
|
||||
</>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
UserInformationEditStep.propTypes = {
|
||||
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||
isNameEditable: PropTypes.bool.isRequired,
|
||||
onUpdate: PropTypes.func.isRequired,
|
||||
onBack: PropTypes.func,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
|
||||
Reference in New Issue
Block a user