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

View File

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