Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
reuses SettingsFieldSet component with some inline-style hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
GoodGuyMarco committed Nov 29, 2022
1 parent c6d1071 commit 084ca68
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/components/views/settings/AddPrivilegedUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import MatrixClientContext from "../../../contexts/MatrixClientContext";
import AccessibleButton from "../elements/AccessibleButton";
import Modal from "../../../Modal";
import ErrorDialog from "../dialogs/ErrorDialog";
import SettingsFieldset from "./SettingsFieldset";

interface AddPrivilegedUsersProps {
room: Room;
Expand Down Expand Up @@ -66,12 +67,12 @@ export const AddPrivilegedUsers: React.FC<AddPrivilegedUsersProps> = ({ room, de
};

return (
<form className="mx_SettingsFieldset" onSubmit={onSubmit}>
<fieldset style={{ width: '100%' }}>
<legend className='mx_SettingsFieldset_legend'>{ _t('Add privileged users') }</legend>
<div className='mx_SettingsFieldset_description'>
{ _t('Give one or multiple users in this room more privileges') }
</div>
<form style={{ display: 'flex' }} onSubmit={onSubmit}>
<SettingsFieldset
legend={_t('Add privileged users')}
description={_t('Give one or multiple users in this room more privileges')}
style={{ flexGrow: 1 }}
>
<AutocompleteInput
provider={userProvider.current}
placeholder={_t("Search users in this room …")}
Expand All @@ -82,13 +83,14 @@ export const AddPrivilegedUsers: React.FC<AddPrivilegedUsersProps> = ({ room, de
<PowerSelector value={powerLevel} onChange={setPowerLevel} />
<AccessibleButton
type='submit'
element='button'
kind='primary'
disabled={!selectedUsers.length || isLoading}
onClick={onSubmit}
onClick={null}
>
{ _t('Apply') }
</AccessibleButton>
</fieldset>
</SettingsFieldset>
</form>
);
};

0 comments on commit 084ca68

Please sign in to comment.