Skip to content

Commit

Permalink
add the skip button for the second step
Browse files Browse the repository at this point in the history
  • Loading branch information
amirition committed Jan 9, 2024
1 parent 1c214c3 commit d28434a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion assets/css/admin/wizard.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion assets/js/admin/wizard/wizard.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions assets/js/src/admin/wizard/tab_content.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ const ContentStep = ( { goToNextStep, goToPreviousStep, nextButtonLabel } ) => {
const [ noticeClass, setNoticeClass ] = useState( 'hidden' );
const [ buttonBusy, setButtonBusy ] = useState( false );

const handleNextButton = function () {
const handleSkipButton = function() {
goToNextStep();
}

const handleNextButton = function() {
setNoticeClass( 'hidden' );
setButtonBusy( true );
if( !tabTitle || !tabContent ) {
Expand Down Expand Up @@ -64,12 +68,19 @@ const ContentStep = ( { goToNextStep, goToPreviousStep, nextButtonLabel } ) => {
<Notice isDismissible={ false } status={noticeClass}>{noticeContent}</Notice>
</CardBody>
<CardFooter>
<Button
className="skip-button"
isSecondary
onClick={ () => handleSkipButton() }
>
{ __( 'Skip' ) }
</Button>
<Button
isPrimary
isBusy={ buttonBusy }
onClick={ () => handleNextButton() }
>
{ __( 'Next' ) }
{ __( 'Create' ) }
</Button>
</CardFooter>
</Card>
Expand Down
2 changes: 1 addition & 1 deletion assets/js/wp-dependencies.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"admin/settings.js":{"dependencies":[],"version":"b50e9d171f2b34ba95f0"},"admin/wizard/wizard.js":{"dependencies":["react","wp-api-fetch","wp-components","wp-element","wp-hooks","wp-i18n"],"version":"828af1208d60bd52a058"},"admin/product.js":{"dependencies":[],"version":"1fbb20702f51115f0511"}}
{"admin/settings.js":{"dependencies":[],"version":"b50e9d171f2b34ba95f0"},"admin/wizard/wizard.js":{"dependencies":["react","wp-api-fetch","wp-components","wp-element","wp-hooks","wp-i18n"],"version":"47705ab7674049644284"},"admin/product.js":{"dependencies":[],"version":"1fbb20702f51115f0511"}}
2 changes: 1 addition & 1 deletion assets/scss/admin/wizard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ label, .barn2-form-label {
display: block!important;
margin-bottom: 8px!important;
}
.components-button.is-secondary {
.components-button.is-secondary:not(.skip-button) {
display: none;
}
div.mce-toolbar-grp {
Expand Down
3 changes: 1 addition & 2 deletions src/Admin/Wizard/Steps/Completed.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ public function __construct() {
* @return string
*/
private function get_custom_description() {
// $product_options_page =

return esc_html__( 'Congratulations, you have created your first product page tab. Now go to the Manage Tabs screen to choose which categories to display it on, create more tabs, and manage the plugin settings.', 'woocommerce-product-tabs' );
return esc_html__( 'Congratulations, you have completed the setup wizard. You can now manage your tabs, choose a category to show them on, create more tabs, and manage the plugin settings.', 'woocommerce-product-tabs' );
}

}

0 comments on commit d28434a

Please sign in to comment.