mirror of
https://github.com/PR0M3TH3AN/Artstr-Studio.git
synced 2026-10-27 08:40:39 +00:00
Clarify premium creator ownership labels
This commit is contained in:
1 parent
00abaeb602
commit
20c769a97d
2 files changed
+25
-2
No files matched your search
+14
-2
@@ -3215,6 +3215,10 @@
|
|||||||
box-shadow:0 1px 3px rgba(15,23,42,.25);
|
box-shadow:0 1px 3px rgba(15,23,42,.25);
|
||||||
pointer-events:none;
|
pointer-events:none;
|
||||||
}
|
}
|
||||||
|
.feedCardPremiumRibbon.premiumOwnedRibbon,
|
||||||
|
#nostrPreviewPanel .premiumPreviewRibbon.premiumOwnedRibbon{
|
||||||
|
background:linear-gradient(135deg,#0f766e,#22c55e);
|
||||||
|
}
|
||||||
/* Same gradient stroke + ribbon for the larger preview pane that
|
/* Same gradient stroke + ribbon for the larger preview pane that
|
||||||
opens when a feed card is clicked. Inherits the look from
|
opens when a feed card is clicked. Inherits the look from
|
||||||
.feedCardPremium so premium designs stay visually consistent
|
.feedCardPremium so premium designs stay visually consistent
|
||||||
@@ -31383,6 +31387,12 @@
|
|||||||
return !!my && my === author;
|
return !!my && my === author;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function premiumRibbonLabel(row) {
|
||||||
|
if (!row?.premium) return '';
|
||||||
|
if (rowIsOwnedByMe(row)) return '⚡ CREATED BY ME';
|
||||||
|
return row.premium.decrypted ? '⚡ UNLOCKED' : '⚡ PREMIUM';
|
||||||
|
}
|
||||||
|
|
||||||
function startEditFromRow(row) {
|
function startEditFromRow(row) {
|
||||||
const dTag = rowDTag(row);
|
const dTag = rowDTag(row);
|
||||||
if (!dTag) { toastError('This design has no d-tag and cannot be edited in place. You can fork it instead.'); return; }
|
if (!dTag) { toastError('This design has no d-tag and cannot be edited in place. You can fork it instead.'); return; }
|
||||||
@@ -35057,7 +35067,8 @@
|
|||||||
if (row.premium) {
|
if (row.premium) {
|
||||||
const ribbon = document.createElement('span');
|
const ribbon = document.createElement('span');
|
||||||
ribbon.className = 'feedCardPremiumRibbon';
|
ribbon.className = 'feedCardPremiumRibbon';
|
||||||
ribbon.textContent = row.premium.decrypted ? '⚡ UNLOCKED' : '⚡ PREMIUM';
|
if (rowIsOwnedByMe(row)) ribbon.classList.add('premiumOwnedRibbon');
|
||||||
|
ribbon.textContent = premiumRibbonLabel(row);
|
||||||
thumb.appendChild(ribbon);
|
thumb.appendChild(ribbon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36146,7 +36157,8 @@
|
|||||||
content.classList.add('premiumPreviewPane');
|
content.classList.add('premiumPreviewPane');
|
||||||
const ribbon = document.createElement('span');
|
const ribbon = document.createElement('span');
|
||||||
ribbon.className = 'premiumPreviewRibbon';
|
ribbon.className = 'premiumPreviewRibbon';
|
||||||
ribbon.textContent = row.premium.decrypted ? '⚡ UNLOCKED' : '⚡ PREMIUM';
|
if (rowIsOwnedByMe(row)) ribbon.classList.add('premiumOwnedRibbon');
|
||||||
|
ribbon.textContent = premiumRibbonLabel(row);
|
||||||
content.appendChild(ribbon);
|
content.appendChild(ribbon);
|
||||||
} else {
|
} else {
|
||||||
content.classList.remove('premiumPreviewPane');
|
content.classList.remove('premiumPreviewPane');
|
||||||
|
|||||||
@@ -153,6 +153,17 @@ test('index page refreshes the Purchased tab after a successful Premium 2.0 purc
|
|||||||
assert.match(html, /refreshPurchasedTabIfVisible\(\{ force: false \}\)/);
|
assert.match(html, /refreshPurchasedTabIfVisible\(\{ force: false \}\)/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('index page labels authored premium rows differently from purchased unlocks', async () => {
|
||||||
|
const html = await indexHtml();
|
||||||
|
|
||||||
|
assert.match(html, /function premiumRibbonLabel\(row\)/);
|
||||||
|
assert.match(html, /if \(rowIsOwnedByMe\(row\)\) return '⚡ CREATED BY ME'/);
|
||||||
|
assert.match(html, /return row\.premium\.decrypted \? '⚡ UNLOCKED' : '⚡ PREMIUM'/);
|
||||||
|
assert.match(html, /ribbon\.textContent = premiumRibbonLabel\(row\)/);
|
||||||
|
assert.match(html, /premiumOwnedRibbon/);
|
||||||
|
assert.match(html, /pubkey: item\.creatorPubkey \|\| ''/);
|
||||||
|
});
|
||||||
|
|
||||||
test('index page exposes creator premium epoch refresh for existing listings', async () => {
|
test('index page exposes creator premium epoch refresh for existing listings', async () => {
|
||||||
const html = await indexHtml();
|
const html = await indexHtml();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user