Skip to content

Commit f454d82

Browse files
committed
Merge branch 'main' into mercury/automate-tokens
2 parents 50c2308 + 6b8f8ea commit f454d82

File tree

5 files changed

+30
-12
lines changed

5 files changed

+30
-12
lines changed

packages/showcase/src/app/app.component.html

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,21 @@
110110
@if (selectedLink().id !== "/" && !versioning.isLatestVersion()) {
111111
<blockquote class="blockquote-warning version-no-longer-maintained">
112112
<div class="blockquote-warning__container">
113-
<p>
114-
This is documentation for Mercury
115-
<span class="body-semi-bold-m">{{ libraryVersion }}</span
116-
>, which is no longer actively maintained.
117-
</p>
113+
@if (versioning.isBetaVersion) {
114+
<p>
115+
This is the documentation for the upcoming
116+
<span class="body-semi-bold-m"
117+
>Mercury {{ libraryVersionWithoutBeta }}</span
118+
>
119+
version, which is currently in Beta.
120+
</p>
121+
} @else {
122+
<p>
123+
This is the documentation for Mercury
124+
<span class="body-semi-bold-m">{{ libraryVersion }}</span
125+
>, which is no longer actively maintained.
126+
</p>
127+
}
118128

119129
<p>
120130
For up-to-date documentation, see the

packages/showcase/src/app/app.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export class AppComponent {
100100
];
101101

102102
libraryVersion = `v${mercuryVersion}`;
103+
libraryVersionWithoutBeta = `v${mercuryVersion.replace(/-beta.*/, "")}`;
103104

104105
constructor() {
105106
this.router.events.subscribe(event => {

packages/showcase/src/app/app.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,5 @@ main {
125125
margin-block-start: calc(
126126
#{$mainPaddingBlockStart} * -1
127127
); // makes the warning stick to the top
128+
text-align: center;
128129
}

packages/showcase/src/services/versioning.service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ const checkIfCurrentVersionIsTheLatest = (
1919
return latestReleasedVersion === mercuryVersion;
2020
};
2121

22+
const checkIfCurrentVersionIsBeta = (): boolean =>
23+
mercuryVersion.includes("beta") || mercuryVersion.includes("next");
24+
2225
@Injectable({ providedIn: "root" })
2326
export class VersioningService {
2427
platform = inject(PLATFORM_ID);
@@ -32,6 +35,8 @@ export class VersioningService {
3235
checkIfCurrentVersionIsTheLatest(this.latestVersion())
3336
);
3437

38+
isBetaVersion = checkIfCurrentVersionIsBeta();
39+
3540
constructor() {
3641
if (isPlatformBrowser(this.platform)) {
3742
// fetch("/services/versions")

packages/showcase/src/styles.scss

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,24 @@ ch-code {
110110
}
111111

112112
.blockquote-warning {
113-
// TODO: Use Mercury "state message" class when available
114-
padding: var(--size-6);
115-
margin: 0;
116113
display: grid;
117114
justify-content: center;
118-
119-
border-inline-start: var(--size-2) solid var(--color-border-neutral-default);
115+
padding: var(--size-6);
116+
margin: 0;
120117
background-color: var(--color-accent-warning-contrast);
121-
122118
color: var(--mer-text__on-message);
123119
line-height: var(--line-height-spacious);
124-
border-inline-start: none;
125120

126121
&__container {
122+
display: grid;
127123
max-inline-size: var(--main-content-max-inline-size);
128124
margin-inline: var(--main-content-margin-inline);
129125
text-align: center;
126+
gap: var(--size-4);
127+
128+
a:hover {
129+
text-decoration: underline;
130+
}
130131
}
131132
}
132133

0 commit comments

Comments
 (0)