Skip to content

Commit

Permalink
Change footer forward button to primary and backward button to tertia…
Browse files Browse the repository at this point in the history
…ry in the tour guide modal
  • Loading branch information
mdperez86 committed Jul 10, 2023
1 parent 743725a commit dca1433
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 38 deletions.
Expand Up @@ -11,6 +11,7 @@ import { Modal, Button } from '@wordpress/components';
*/
import PageControl from './page-control';
import type { GuideProps } from './types';
import './style.scss';

/*
* This component was copied from @wordpress/components since we needed
Expand Down Expand Up @@ -90,6 +91,7 @@ function Guide( {
{ canGoBack && (
<Button
className="components-guide__back-button"
variant="tertiary"
onClick={ goBack }
>
{ __( 'Previous', 'woocommerce' ) }
Expand All @@ -98,6 +100,7 @@ function Guide( {
{ canGoForward && (
<Button
className="components-guide__forward-button"
variant="primary"
onClick={ goForward }
>
{ __( 'Next', 'woocommerce' ) }
Expand All @@ -106,6 +109,7 @@ function Guide( {
{ ! canGoForward && (
<Button
className="components-guide__finish-button"
variant="primary"
href={ finishButtonLink }
target={ finishButtonLink ? '_blank' : undefined }
rel={ finishButtonLink ? 'noopener' : undefined }
Expand Down
Expand Up @@ -63,6 +63,43 @@
padding: 0 $grid-unit-40;
position: relative;
width: 100%;

.components-button {
&.components-guide__back-button,
&.components-guide__forward-button,
&.components-guide__finish-button {
height: 30px;
position: absolute;
font-weight: inherit;

&.is-primary {
color: var(--wp-components-color-accent-inverted, #fff);
}

&:hover {
text-decoration: none;
}
}

&.components-guide__back-button,
&.components-guide__forward-button {
font-size: $default-font-size;
padding: 4px 2px;

&.has-text svg {
margin: 0;
}
}

&.components-guide__back-button {
left: $grid-unit-40;
}

&.components-guide__forward-button,
&.components-guide__finish-button {
right: $grid-unit-40;
}
}
}

&__page-control {
Expand All @@ -88,45 +125,8 @@
height: 80vh;
max-height: 575px;

@media ( max-width: $break-small ) {
@media (max-width: $break-small) {
margin: auto;
max-width: calc(100vw - #{$grid-unit-20} * 2);
}
}

.components-button {
&.components-guide__back-button,
&.components-guide__forward-button,
&.components-guide__finish-button {
height: 30px;
position: absolute;
}

&.components-guide__back-button,
&.components-guide__forward-button {
font-size: $default-font-size;
padding: 4px 2px;

&.has-text svg {
margin: 0;
}

&:hover {
text-decoration: underline;
}
}

&.components-guide__back-button {
left: $grid-unit-40;
}

&.components-guide__forward-button {
right: $grid-unit-40;
color: #1386bf;
font-weight: bold;
}

&.components-guide__finish-button {
right: $grid-unit-40;
}
}

0 comments on commit dca1433

Please sign in to comment.