Skip to content

Commit

Permalink
fix: fine tune the save button layout
Browse files Browse the repository at this point in the history
Signed-off-by: andy.lee <andy.lee@suse.com>
  • Loading branch information
a110605 committed May 8, 2024
1 parent 26fb6b4 commit 3dbe8c1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
32 changes: 17 additions & 15 deletions src/routes/setting/setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,23 @@ const form = ({

return (
<Spin spinning={saving || loading} style={{ height: '100vh' }}>
<Form className={styles.setting}>
{settings}
</Form>
{settings.length > 0 && (
<div style={{ textAlign: 'center', position: 'sticky', marginTop: '1rem' }}>
<Button
onClick={handleOnSubmit}
loading={saving}
type="primary"
htmlType="submit"
>
Save
</Button>
</div>
)}
<div className={styles.formWrapper}>
<Form className={styles.setting}>
{settings}
</Form>
{settings.length > 0 && (
<div style={{ textAlign: 'center', position: 'sticky', marginTop: '1rem' }}>
<Button
onClick={handleOnSubmit}
loading={saving}
type="primary"
htmlType="submit"
>
Save
</Button>
</div>
)}
</div>
</Spin>
)
}
Expand Down
8 changes: 7 additions & 1 deletion src/routes/setting/setting.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.setting {
max-height: 78vh;
max-height: fit-content;
overflow-y: auto;

:global .ant-input-group-addon {
Expand Down Expand Up @@ -28,3 +28,9 @@
border: 1px solid #f15354;
}
}

.formWrapper{
display: flex;
flex-direction: column;
max-height: calc(100vh - 200px);
}

0 comments on commit 3dbe8c1

Please sign in to comment.