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 9, 2024
1 parent 26fb6b4 commit 638c918
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 40 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.wrapper}>
<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
57 changes: 32 additions & 25 deletions src/routes/setting/setting.less
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
.setting {
max-height: 78vh;
overflow-y: auto;
.wrapper{
display: flex;
flex-direction: column;
max-height: calc(100vh - 200px);

:global .ant-input-group-addon {
text-transform: capitalize;
}
.fieldset {
border: 1px solid #f2f4f5;
position: relative;
margin: 24px 0px;
padding: 16px 16px 0 16px;
> .fieldsetLabel {
position: absolute;
transform: translateY(-120%);
.setting {
max-height: fit-content;
overflow-y: auto;

:global .ant-input-group-addon {
text-transform: capitalize;
display: inline-block;
padding: 0 24px;
white-space: nowrap;
text-align: center;
font-weight: 700;
color: rgb(173, 172, 172);
font-size: 18px;
background-color: #ffffff;
}
}
.dangerZone {
border: 1px solid #f15354;
.fieldset {
border: 1px solid #f2f4f5;
position: relative;
margin: 24px 0px;
padding: 16px 16px 0 16px;
> .fieldsetLabel {
position: absolute;
transform: translateY(-120%);
text-transform: capitalize;
display: inline-block;
padding: 0 24px;
white-space: nowrap;
text-align: center;
font-weight: 700;
color: rgb(173, 172, 172);
font-size: 18px;
background-color: #ffffff;
}
}
.dangerZone {
border: 1px solid #f15354;
}
}
}

0 comments on commit 638c918

Please sign in to comment.