-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Move share button into a snippet #2123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7878877
Move share button into a snippet
ludoboludo 84e40b7
change the property name to context and add details in snippet
ludoboludo cb1f8cb
address review comments
ludoboludo bfd9b93
edit props names and description
ludoboludo 094e479
Address reviewers comment. Remove unused prop and edit existing ID
ludoboludo 4ee87b6
move script at the top
ludoboludo 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,49 @@ | ||
| {% comment %} | ||
| Renders share button. | ||
| Accepts: | ||
| - block: {Object} either passing the block/section. | ||
| - share_link: {String} url to be added to the input the user will get/copy. | ||
|
|
||
| Usage: | ||
| {% render 'share-button-block', | ||
| block: block, | ||
| share_link: share_url | ||
| %} | ||
| {% endcomment %} | ||
| <script src="{{ 'share.js' | asset_url }}" defer="defer"></script> | ||
|
|
||
| <share-button id="Share-{{ section.id }}" class="share-button quick-add-hidden" {{ block.shopify_attributes }}> | ||
| <button class="share-button__button hidden"> | ||
| {% render 'icon-share' %} | ||
| {{ block.settings.share_label | escape }} | ||
| </button> | ||
| <details id="Details-{{ block.id }}-{{ section.id }}"> | ||
| <summary class="share-button__button"> | ||
| {% render 'icon-share' %} | ||
| {{ block.settings.share_label | escape }} | ||
| </summary> | ||
| <div class="share-button__fallback motion-reduce"> | ||
| <div class="field"> | ||
| <span id="ShareMessage-{{ section.id }}" class="share-button__message hidden" role="status"> </span> | ||
| <input | ||
| type="text" | ||
| class="field__input" | ||
| id="ShareUrl-{{ section.id }}" | ||
| value="{{ share_link }}" | ||
| placeholder="{{ 'general.share.share_url' | t }}" | ||
| onclick="this.select();" | ||
| readonly | ||
| > | ||
| <label class="field__label" for="ShareUrl-{{ section.id }}">{{ 'general.share.share_url' | t }}</label> | ||
| </div> | ||
| <button class="share-button__close hidden no-js-hidden"> | ||
| {% render 'icon-close' %} | ||
| <span class="visually-hidden">{{ 'general.share.close' | t }}</span> | ||
| </button> | ||
| <button class="share-button__copy no-js-hidden"> | ||
| {% render 'icon-clipboard' %} | ||
| <span class="visually-hidden">{{ 'general.share.copy_to_clipboard' | t }}</span> | ||
| </button> | ||
| </div> | ||
| </details> | ||
| </share-button> |
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.
I've remove this
idfrom this element as I don't see why it was needed. When I search forProduct-sharenothing comes up in the files.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.
I also don't see where this would be used so removing it is fine with me. Otherwise I'd suggest just remove the section specific prefix of "Product-" or "Article-"