This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Add Feedback Prompt in Cart & Checkout blocks sidebar #1356
Merged
Merged
Changes from 3 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
883fdfc
Add Feedback Prompt in Cart & Checkout blocks sidebar
Aljullu 496290f
Add border
Aljullu c49d423
Move getInspectorControls out of the component function
Aljullu 718d3f2
Move feedback prompt to a HOC
Aljullu b88391a
Add @todo comment to feedback link
Aljullu 96bba02
Use filter for withFeedbackPrompt
Aljullu 2fbc088
Merge branch 'master' into add/1300-feedback-prompt
Aljullu 3bd62dd
Export withFeedbackPrompt from hocs index.js
Aljullu 880ccb4
Typo
Aljullu 21f889b
Try moving the feedback texts to context
Aljullu 77f73c7
Revert "Try moving the feedback texts to context"
Aljullu 2d9a36d
Revert "Use filter for withFeedbackPrompt"
Aljullu 80f0c88
Set feedback text in the HOC function
Aljullu 60107d1
Merge branch 'master' into add/1300-feedback-prompt
Aljullu 65cd192
Use arrow-function to simplify code
Aljullu d016e8f
Refactor
Aljullu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
import PropTypes from 'prop-types'; | ||
import Gridicon from 'gridicons'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import './style.scss'; | ||
|
||
/** | ||
* Component to render a Feedback prompt in the sidebar. | ||
*/ | ||
const FeedbackPrompt = ( { text } ) => { | ||
return ( | ||
<div className="wc-block-feedback-prompt"> | ||
<Gridicon icon="comment" /> | ||
<h2 className="wc-block-feedback-prompt__title"> | ||
{ __( 'Feedback?', 'woo-gutenberg-products-block' ) } | ||
</h2> | ||
<p className="wc-block-feedback-prompt__text">{ text }</p> | ||
<a | ||
href="https://wordpress.org/support/plugin/woo-gutenberg-products-block/reviews/" | ||
className="wc-block-feedback-prompt__link" | ||
rel="noreferrer noopener" | ||
target="_blank" | ||
> | ||
{ __( | ||
'Give us your feedback.', | ||
'woo-gutenberg-products-block' | ||
) } | ||
<Gridicon icon="external" size={ 16 } /> | ||
</a> | ||
</div> | ||
); | ||
}; | ||
|
||
FeedbackPrompt.propTypes = { | ||
text: PropTypes.string, | ||
}; | ||
|
||
export default FeedbackPrompt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.wc-block-feedback-prompt { | ||
background-color: #f7f7f7; | ||
border-top: 1px solid #e2e4e7; | ||
margin: $gap -16px -16px; | ||
padding: $gap-large; | ||
text-align: center; | ||
|
||
.wc-block-feedback-prompt__title { | ||
margin: 0 0 $gap-small; | ||
} | ||
|
||
.wc-block-feedback-prompt__link { | ||
color: inherit; | ||
|
||
> .gridicon { | ||
vertical-align: text-bottom; | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we verified this is where we want feedback to go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK it's not decided yet, so I added this link as a placeholder. I was planning to ask @garymurray when he comes back from AFK. For now, I added a
@todo
comment so we don't forget about it (b88391a).