mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 08:40:24 +08:00
chore: wrap RepositoryModal's fields in Form component (#4034)
* chore: wrap RepositoryModal's fields in Form component * wip
This commit is contained in:
parent
40a84fc3d8
commit
f8560ef51b
|
@ -5,6 +5,7 @@ import Select from 'flarum/common/components/Select';
|
|||
import Stream from 'flarum/common/utils/Stream';
|
||||
import Button from 'flarum/common/components/Button';
|
||||
import extractText from 'flarum/common/utils/extractText';
|
||||
import Form from 'flarum/common/components/Form';
|
||||
|
||||
export interface IAuthMethodModalAttrs extends IInternalModalAttrs {
|
||||
onsubmit: (type: string, host: string, token: string) => void;
|
||||
|
@ -45,6 +46,7 @@ export default class AuthMethodModal<CustomAttrs extends IAuthMethodModalAttrs =
|
|||
|
||||
return (
|
||||
<div className="Modal-body">
|
||||
<Form>
|
||||
<div className="Form-group">
|
||||
<label>{app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.type_label')}</label>
|
||||
<Select options={types} value={this.type()} onchange={this.type} />
|
||||
|
@ -77,6 +79,7 @@ export default class AuthMethodModal<CustomAttrs extends IAuthMethodModalAttrs =
|
|||
{app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.submit_button')}
|
||||
</Button>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import Select from 'flarum/common/components/Select';
|
|||
import Stream from 'flarum/common/utils/Stream';
|
||||
import Button from 'flarum/common/components/Button';
|
||||
import { type Repository } from './ConfigureComposer';
|
||||
import Form from 'flarum/common/components/Form';
|
||||
|
||||
export interface IRepositoryModalAttrs extends IInternalModalAttrs {
|
||||
onsubmit: (repository: Repository, key: string) => void;
|
||||
|
@ -41,6 +42,7 @@ export default class RepositoryModal<CustomAttrs extends IRepositoryModalAttrs =
|
|||
|
||||
return (
|
||||
<div className="Modal-body">
|
||||
<Form>
|
||||
<div className="Form-group">
|
||||
<label>{app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.name_label')}</label>
|
||||
<input className="FormControl" bidi={this.name} />
|
||||
|
@ -66,6 +68,7 @@ export default class RepositoryModal<CustomAttrs extends IRepositoryModalAttrs =
|
|||
{app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.submit_button')}
|
||||
</Button>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user