summaryrefslogtreecommitdiffstats
path: root/ui/src/components/site-form.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-10-18 17:20:27 -0700
committerDessalines <tyhou13@gmx.com>2019-10-18 17:20:27 -0700
commit4e5561283392d2ab1545cabb4455a8ffc490f86b (patch)
treea4ee9cc096826dc32faf3675212c7f95f1b3ea5e /ui/src/components/site-form.tsx
parent82ea5ae9186e5a8e631c87a61077e16713eb87a4 (diff)
Running prettier on code.
- #305 , #309
Diffstat (limited to 'ui/src/components/site-form.tsx')
-rw-r--r--ui/src/components/site-form.tsx65
1 files changed, 51 insertions, 14 deletions
diff --git a/ui/src/components/site-form.tsx b/ui/src/components/site-form.tsx
index 01164215..7f8c229d 100644
--- a/ui/src/components/site-form.tsx
+++ b/ui/src/components/site-form.tsx
@@ -17,12 +17,12 @@ interface SiteFormState {
}
export class SiteForm extends Component<SiteFormProps, SiteFormState> {
- private emptyState: SiteFormState ={
+ private emptyState: SiteFormState = {
siteForm: {
- name: null
+ name: null,
},
- loading: false
- }
+ loading: false,
+ };
constructor(props: any, context: any) {
super(props, context);
@@ -31,7 +31,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
this.state.siteForm = {
name: this.props.site.name,
description: this.props.site.description,
- }
+ };
}
}
@@ -42,26 +42,63 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
render() {
return (
<form onSubmit={linkEvent(this, this.handleCreateSiteSubmit)}>
- <h5>{`${this.props.site ? capitalizeFirstLetter(i18n.t('edit')) : capitalizeFirstLetter(i18n.t('name'))} ${i18n.t('your_site')}`}</h5>
+ <h5>{`${
+ this.props.site
+ ? capitalizeFirstLetter(i18n.t('edit'))
+ : capitalizeFirstLetter(i18n.t('name'))
+ } ${i18n.t('your_site')}`}</h5>
<div class="form-group row">
- <label class="col-12 col-form-label"><T i18nKey="name">#</T></label>
+ <label class="col-12 col-form-label">
+ <T i18nKey="name">#</T>
+ </label>
<div class="col-12">
- <input type="text" class="form-control" value={this.state.siteForm.name} onInput={linkEvent(this, this.handleSiteNameChange)} required minLength={3} maxLength={20} />
+ <input
+ type="text"
+ class="form-control"
+ value={this.state.siteForm.name}
+ onInput={linkEvent(this, this.handleSiteNameChange)}
+ required
+ minLength={3}
+ maxLength={20}
+ />
</div>
</div>
<div class="form-group row">
- <label class="col-12 col-form-label"><T i18nKey="sidebar">#</T></label>
+ <label class="col-12 col-form-label">
+ <T i18nKey="sidebar">#</T>
+ </label>
<div class="col-12">
- <textarea value={this.state.siteForm.description} onInput={linkEvent(this, this.handleSiteDescriptionChange)} class="form-control" rows={3} maxLength={10000} />
+ <textarea
+ value={this.state.siteForm.description}
+ onInput={linkEvent(this, this.handleSiteDescriptionChange)}
+ class="form-control"
+ rows={3}
+ maxLength={10000}
+ />
</div>
</div>
<div class="form-group row">
<div class="col-12">
<button type="submit" class="btn btn-secondary mr-2">
- {this.state.loading ?
- <svg class="icon icon-spinner spin"><use xlinkHref="#icon-spinner"></use></svg> :
- this.props.site ? capitalizeFirstLetter(i18n.t('save')) : capitalizeFirstLetter(i18n.t('create'))}</button>
- {this.props.site && <button type="button" class="btn btn-secondary" onClick={linkEvent(this, this.handleCancel)}><T i18nKey="cancel">#</T></button>}
+ {this.state.loading ? (
+ <svg class="icon icon-spinner spin">
+ <use xlinkHref="#icon-spinner"></use>
+ </svg>
+ ) : this.props.site ? (
+ capitalizeFirstLetter(i18n.t('save'))
+ ) : (
+ capitalizeFirstLetter(i18n.t('create'))
+ )}
+ </button>
+ {this.props.site && (
+ <button
+ type="button"
+ class="btn btn-secondary"
+ onClick={linkEvent(this, this.handleCancel)}
+ >
+ <T i18nKey="cancel">#</T>
+ </button>
+ )}
</div>
</div>
</form>