From 5e6f1790d6cc8c3047dd14d0fb1636acb9cc7d74 Mon Sep 17 00:00:00 2001 From: cristian-ungureanu Date: Tue, 1 Aug 2023 12:42:51 +0300 Subject: [PATCH 1/2] feat: implement documentation links for starter sites ( Codeinwp/neve#3956 ) --- assets/src/Components/DocNotice.js | 27 +++++++++++++++++++++++++++ assets/src/Components/ImportModal.js | 12 ++++++++++++ assets/src/scss/_docnotice.scss | 13 +++++++++++++ assets/src/style.scss | 2 +- 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 assets/src/Components/DocNotice.js create mode 100644 assets/src/scss/_docnotice.scss diff --git a/assets/src/Components/DocNotice.js b/assets/src/Components/DocNotice.js new file mode 100644 index 00000000..1d9480c3 --- /dev/null +++ b/assets/src/Components/DocNotice.js @@ -0,0 +1,27 @@ +import { Icon } from '@wordpress/components'; + +const DocNotice = ( { data } ) => { + const { text, url } = data; + + if ( ! text ) { + return null; + } + + return ( +
+ { url ? ( + + { text } + + ) : ( +

{ text }

+ ) } +
+ ); +}; + +export default DocNotice; diff --git a/assets/src/Components/ImportModal.js b/assets/src/Components/ImportModal.js index bf7162fd..0914b8b0 100644 --- a/assets/src/Components/ImportModal.js +++ b/assets/src/Components/ImportModal.js @@ -17,6 +17,7 @@ import classnames from 'classnames'; import ImportModalError from './ImportModalError'; import ImportModalMock from './ImportModalMock'; import CustomTooltip from './CustomTooltip'; +import DocNotice from './DocNotice'; import { createInterpolateElement, @@ -826,6 +827,17 @@ const ImportModal = ( { ) : ( <>
+ { 'done' === currentStep && + ! error && + siteData.doc_url && ( + + ) + } { ! importing && 'done' !== currentStep && ! error ? ( <> diff --git a/assets/src/scss/_docnotice.scss b/assets/src/scss/_docnotice.scss new file mode 100644 index 00000000..771ab046 --- /dev/null +++ b/assets/src/scss/_docnotice.scss @@ -0,0 +1,13 @@ +.doc-notice { + background: #e5f1f7; + color: #0071ae; + width: 100%; + border-radius: 5px; + padding: 10px; + margin-top: 0; + margin-bottom: 30px; + a { + color: #0071ae; + text-decoration: none; + } +} diff --git a/assets/src/style.scss b/assets/src/style.scss index 54c32dfb..b0e2ad38 100644 --- a/assets/src/style.scss +++ b/assets/src/style.scss @@ -14,9 +14,9 @@ @import "scss/library"; @import "scss/demo-site-templates"; @import "scss/notification"; +@import "scss/docnotice"; @import "scss/custom-tooltip"; @import "scss/license"; @import "scss/feedback"; @import "scss/media-queries"; - From baa81b3bb8809e3e859079e8804e0874ef954ab1 Mon Sep 17 00:00:00 2001 From: cristian-ungureanu Date: Tue, 19 Sep 2023 10:26:07 +0300 Subject: [PATCH 2/2] chore: small change to regenerate the build --- includes/Admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Admin.php b/includes/Admin.php index a8f3bcea..606fbfb0 100755 --- a/includes/Admin.php +++ b/includes/Admin.php @@ -579,7 +579,7 @@ public function localize_sites_library( $array ) { } // Previously the library was visited check was stored in a transient. To ensure the notification is not displayed anymore once the user has visited the library - // the transient was moved to an option and here we check that if the transient is set we also update the option. + // the transient was moved to an option and here we check that if the transient is set and we also update the option. $visited_transient = (bool) get_transient( self::VISITED_LIBRARY_OPT ); $page_was_visited = get_option( self::VISITED_LIBRARY_OPT, false ); if ( $visited_transient && $page_was_visited === false ) {