mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 23:27:31 +00:00
feat(release): show the iOS and Android apps in the 5.2.1 notice, the account settings and the user menu
The release notice moves to 5.2.1 and gets a tile across the release column with the App Store and Google Play cards, each with a QR code that opens the store page. The headliner, intro, footnote and note texts are shorter so the tile fits, in every locale. Settings > Account shows the same store cards in its right column, except inside the native app itself. The user menu footer adds round links to Patreon, Ko-fi and Buy Me a Coffee beside Discord, left out on managed installs and in the native apps like every donation link.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// FE-RN-001 to FE-RN-020
|
||||
// FE-RN-001 to FE-RN-022
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { render, screen } from '../../../tests/helpers/render';
|
||||
@@ -295,4 +295,23 @@ describe('ReleaseNoticeModal', () => {
|
||||
expect(document.querySelectorAll('.rn-vis-route-stop')).toHaveLength(5);
|
||||
expect(document.querySelector('.rn-vis-route-line')).not.toBeNull();
|
||||
});
|
||||
|
||||
it('FE-RN-021: an apps block draws one tile with its title and both store cards', () => {
|
||||
renderModal(withRelease({ apps: { titleKey: 'rel.apps.title' } }));
|
||||
const tile = document.querySelector('.rn-apps');
|
||||
expect(tile).toHaveTextContent('rel.apps.title');
|
||||
const stores = tile?.querySelectorAll('a.asc-card') ?? [];
|
||||
expect([...stores].map((a) => a.getAttribute('href'))).toEqual([
|
||||
'https://apps.apple.com/app/id6831237775',
|
||||
'https://play.google.com/store/apps/details?id=com.liketrek.trek',
|
||||
]);
|
||||
// On the release column, which is dark in either theme.
|
||||
expect(tile?.querySelector('.asc-row')).toHaveClass('asc-dark');
|
||||
});
|
||||
|
||||
it('FE-RN-022: without an apps block there is no apps tile', () => {
|
||||
renderModal();
|
||||
expect(document.querySelector('.rn-apps')).toBeNull();
|
||||
expect(document.querySelector('.asc-card')).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,6 +2,7 @@ import { ArrowRight, Heart, Infinity as InfinityIcon, ShieldCheck, X } from 'luc
|
||||
import React from 'react';
|
||||
import { useTranslation } from '../../i18n/TranslationContext.js';
|
||||
import type { SystemNoticeDTO } from '../../store/systemNoticeStore.js';
|
||||
import AppStoreCards from '../shared/AppStoreCards';
|
||||
import { PATREON_PATH } from '../shared/PatreonIcon';
|
||||
import { ReleaseFeatureVisual } from './ReleaseNoticeVisuals.js';
|
||||
import './releaseNotice.css';
|
||||
@@ -127,6 +128,16 @@ export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecond
|
||||
{withSponsorLink(t(release.introKey))}
|
||||
</p>
|
||||
|
||||
{release.apps && (
|
||||
<div className="rn-apps">
|
||||
<div className="rn-feature-shine" aria-hidden="true" />
|
||||
<div className="rn-apps-text">
|
||||
<div className="rn-feature-title">{t(release.apps.titleKey)}</div>
|
||||
</div>
|
||||
<AppStoreCards tone="dark" className="rn-apps-stores" />
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="rn-features-head">
|
||||
<span className="rn-features-label">{t(release.featuresLabelKey)}</span>
|
||||
<span className="rn-features-rule" aria-hidden="true" />
|
||||
|
||||
@@ -647,3 +647,28 @@
|
||||
.rn-sponsor:hover {
|
||||
text-decoration-color: currentColor;
|
||||
}
|
||||
|
||||
/* ── The apps: one tile across the column, the text beside the store cards ── */
|
||||
|
||||
.rn-apps {
|
||||
position: relative;
|
||||
margin-top: 22px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 22px;
|
||||
padding: 16px 16px 16px 20px;
|
||||
border-radius: 20px;
|
||||
background: linear-gradient(160deg, oklch(1 0 0 / 0.1) 0%, oklch(1 0 0 / 0.045) 62%);
|
||||
border: 1px solid oklch(1 0 0 / 0.13);
|
||||
box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.16), 0 12px 28px -16px oklch(0 0 0 / 0.7);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.rn-apps-text { position: relative; flex: 1 1 200px; min-width: 0; }
|
||||
|
||||
.rn-apps-stores { position: relative; flex: 0 1 520px; min-width: 0; }
|
||||
|
||||
@media (max-width: 1280px) {
|
||||
.rn-apps { flex-direction: column; align-items: stretch; }
|
||||
.rn-apps-stores { flex-basis: auto; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user