Move success messages under submit button

This commit is contained in:
Tanner Collin 2020-01-23 22:44:42 +00:00
parent 273e514ee3
commit f44d1d9d98
2 changed files with 17 additions and 15 deletions

View File

@ -44,10 +44,10 @@ export function AdminTransactions(props) {
<TransactionEditor input={input} setInput={setInput} error={error} />
{success && <p>Added! <Link to={'/transactions/'+success}>View the transaction.</Link></p>}
<Form.Button loading={loading} error={error.non_field_errors}>
Submit
</Form.Button>
{success && <p>Added! <Link to={'/transactions/'+success}>View the transaction.</Link></p>}
</Form>
<Header size='small'>Current Transactions</Header>
@ -246,10 +246,10 @@ export function AdminMemberCards(props) {
/>
</Form.Group>
{success && <p>Success!</p>}
<Form.Button loading={loading} error={error.non_field_errors}>
Submit
</Form.Button>
{success && <div>Success!</div>}
</Form>
<Header size='small'>Current Cards</Header>
@ -332,9 +332,7 @@ export function AdminMemberPause(props) {
<p>Pause members who are inactive, former, or on vacation.</p>
{success && <p>Success!</p>}
{error && <p>Error, something went wrong.</p>}
<p>
{result.member.paused_date ?
<Button onClick={handleUnpause} loading={loading}>
Unpause
@ -344,6 +342,10 @@ export function AdminMemberPause(props) {
{yousure ? 'You Sure?' : 'Pause'}
</Button>
}
</p>
{success && <div>Success!</div>}
{error && <p>Error, something went wrong.</p>}
</div>
);
};
@ -462,10 +464,10 @@ export function AdminMemberForm(props) {
/>
</Form.Field>
{success && <p>Success!</p>}
<Form.Button loading={loading} error={error.non_field_errors}>
Submit
</Form.Button>
{success && <div>Success!</div>}
</Form>
</div>
);

View File

@ -169,10 +169,10 @@ function EditTransaction(props) {
<Form onSubmit={handleSubmit}>
<TransactionEditor input={input} setInput={setInput} error={error} />
{success && <p>Success!</p>}
<Form.Button loading={loading} error={error.non_field_errors}>
Save
</Form.Button>
{success && <div>Success!</div>}
</Form>
</div>
);