Skip to content

Commit 038ac72

Browse files
chrischrischrisauniverseaway
authored andcommitted
Feat: Snapshots - Add a link to share the review urls (adobe#176)
* Feat: Snapshots - Add a link to share the review urls Fix: adobe/da-live#756 * Update hover color * Update snapshot.css Minor CSS tweak to make button have the same padding visually. --------- Co-authored-by: Chris Millar <cmillar@adobe.com>
1 parent 0cbe300 commit 038ac72

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

nx/blocks/snapshot-admin/views/snapshot.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,15 @@ svg.icon {
237237
align-items: center;
238238
gap: 8px;
239239
}
240+
241+
button {
242+
padding: 4px 6px;
243+
border-radius: 4px;
244+
245+
&:not(:disabled):hover {
246+
background: var(--s2-gray-50);
247+
}
248+
}
240249
}
241250

242251
.nx-snapshot-sub-heading-actions {

nx/blocks/snapshot-admin/views/snapshot.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ class NxSnapshot extends LitElement {
165165
this.handleSave(false);
166166
}
167167

168-
handleShare() {
169-
const aemPaths = this._manifest.resources.map((res) => res.aemPreview);
168+
handleShare(type = 'aemPreview') {
169+
const aemPaths = this._manifest.resources.map((res) => res[type]);
170170
const blob = new Blob([aemPaths.join('\n')], { type: 'text/plain' });
171171
const data = [new ClipboardItem({ [blob.type]: blob })];
172172
navigator.clipboard.write(data);
@@ -382,7 +382,8 @@ class NxSnapshot extends LitElement {
382382
<p>
383383
${showEdit ? html`URLs` : html`${count} URL${s}`}
384384
${showEdit ? this.renderCancelUrlBtn() : this.renderEditUrlBtn()}
385-
${showEdit ? nothing : html`<button @click=${this.handleShare}>Share</button>`}
385+
${showEdit ? nothing : html`<button @click=${() => this.handleShare('aemPreview')}>Share URLs</button>`}
386+
${showEdit ? nothing : html`<button @click=${() => this.handleShare('url')}>Share Review URLs</button>`}
386387
</p>
387388
</div>
388389
${showEdit ? this.renderEditUrls() : this.renderUrls()}

0 commit comments

Comments
 (0)