Skip to content

Commit

Permalink
feat: wrap action buttons around a div for better positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasguillot authored and jeffersonrabb committed Apr 24, 2020
1 parent 3ac00ad commit 0b28524
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 14 deletions.
8 changes: 5 additions & 3 deletions src/components/template-modal/screens/api-keys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,11 @@ export default ( { onSetupStatus } ) => {
</p>
</div>
</div>
<Button isPrimary onClick={ commitSettings } disabled={ inFlight || ! canSubmit }>
{ __( 'Save settings', 'newspack-newsletter' ) }
</Button>
<div className="newspack-newsletters-modal__action-buttons">
<Button isPrimary onClick={ commitSettings } disabled={ inFlight || ! canSubmit }>
{ __( 'Save settings', 'newspack-newsletter' ) }
</Button>
</div>
</Fragment>
);
};
15 changes: 9 additions & 6 deletions src/components/template-modal/screens/template-picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,15 @@ export default ( { onInsertTemplate, templates } ) => {
) }
</div>
</div>
<Button isSecondary onClick={ () => onInsertTemplate( 0 ) }>
{ __( 'Use empty layout', 'newspack-newsletters' ) }
</Button>
<Button isPrimary onClick={ () => onInsertTemplate( selectedTemplate ) }>
{ __( 'Use this layout', 'newspack-newsletters' ) }
</Button>
<div className="newspack-newsletters-modal__action-buttons">
<Button isSecondary onClick={ () => onInsertTemplate( 0 ) }>
{ __( 'Start From Scratch', 'newspack-newsletters' ) }
</Button>
<span className="separator">{ __( 'or', 'newspack-newsletters' ) }</span>
<Button isPrimary onClick={ () => onInsertTemplate( selectedTemplate ) }>
{ __( 'Use Selected Layout', 'newspack-newsletters' ) }
</Button>
</div>
</Fragment>
);
};
34 changes: 29 additions & 5 deletions src/components/template-modal/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@
top: 0;
transform: none;
width: 100%;

.components-modal__header-heading {
display: none;
font-size: 0.8rem;
line-height: 1.25;

@media only screen and ( min-width: 600px ) {
display: block;
}

@media only screen and ( min-width: 783px ) {
font-size: 1rem;
line-height: 1;
}
}
}

&__content {
Expand Down Expand Up @@ -73,12 +88,21 @@
top: 61px;
}
}
}

+ .is-primary {
position: absolute;
right: 24px;
top: 12px;
z-index: 11;
&__action-buttons {
align-items: center;
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
position: absolute;
right: 24px;
top: 12px;
z-index: 11;

.separator {
margin-left: 6px;
margin-right: 6px;
}
}

Expand Down

0 comments on commit 0b28524

Please sign in to comment.