Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5119db3

Browse files
blink-so[bot]blink-so[bot]Parkreiner
authored
feat: underline links in announcement banner for better visibility (#20166)
## OverviewLinks in announcement banners are now underlined to make them visuallydistinguishable without requiring users to hover over them.Context:[Slack](https://codercom.slack.com/archives/C0989BZU23T/p1759503061267819)## Changes- Added `text-decoration: underline` to links in the announcement bannercomponent---------Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com>Co-authored-by: blink-so[bot] <157993532+blink-so[bot]@users.noreply.github.com>Co-authored-by: Michael Smith <michaelsmith@coder.com>
1 parent9f3b2cd commit5119db3

File tree

3 files changed

+15
-30
lines changed

3 files changed

+15
-30
lines changed

‎site/e2e/tests/deployment/appearance.spec.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ test("set service banner", async ({ page }) => {
8383
awaitpage.goto("/workspaces",{waitUntil:"domcontentloaded"});
8484
awaitexpectUrl(page).toHavePathName("/workspaces");
8585

86-
constbar=page.locator("div.service-banner",{hasText:message});
87-
awaitexpect(bar).toBeVisible();
86+
constbanner=page.getByTestId("service-banner");
87+
awaitexpect(banner).toBeVisible();
88+
awaitexpect(banner).toHaveText(message);
8889
});
Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,28 @@
1-
import{css,typeInterpolation,typeTheme}from"@emotion/react";
21
import{InlineMarkdown}from"components/Markdown/Markdown";
32
importtype{FC}from"react";
43
import{readableForegroundColor}from"utils/colors";
54

65
interfaceAnnouncementBannerViewProps{
7-
message?:string;
8-
backgroundColor?:string;
6+
message:string;
7+
backgroundColor:string;
98
}
109

1110
exportconstAnnouncementBannerView:FC<AnnouncementBannerViewProps>=({
1211
message,
1312
backgroundColor,
1413
})=>{
15-
if(!message||!backgroundColor){
16-
returnnull;
17-
}
18-
1914
return(
2015
<div
21-
css={styles.banner}
16+
className="p-3 flex items-center"
2217
style={{ backgroundColor}}
23-
className="service-banner"
18+
data-test-id="service-banner"
2419
>
2520
<div
26-
css={styles.wrapper}
21+
className="mx-auto font-normal [&_a]:text-inherit [&_a]:underline"
2722
style={{color:readableForegroundColor(backgroundColor)}}
2823
>
2924
<InlineMarkdown>{message}</InlineMarkdown>
3025
</div>
3126
</div>
3227
);
3328
};
34-
35-
conststyles={
36-
banner:css`
37-
padding:12px;
38-
display: flex;
39-
align-items: center;
40-
`,
41-
wrapper:css`
42-
margin-right: auto;
43-
margin-left: auto;
44-
font-weight:400;
45-
46-
&a {
47-
color: inherit;
48-
}
49-
`,
50-
}satisfiesRecord<string,Interpolation<Theme>>;

‎site/src/modules/dashboard/AnnouncementBanners/AnnouncementBanners.tsx‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
importtype{BannerConfig}from"api/typesGenerated";
12
import{useDashboard}from"modules/dashboard/useDashboard";
23
importtype{FC}from"react";
34
import{AnnouncementBannerView}from"./AnnouncementBannerView";
@@ -15,7 +16,12 @@ export const AnnouncementBanners: FC = () => {
1516
return(
1617
<>
1718
{announcementBanners
18-
.filter((banner)=>banner.enabled)
19+
.filter(
20+
(banner):banner isRequired<BannerConfig>=>
21+
banner.enabled&&
22+
Boolean(banner.message)&&
23+
Boolean(banner.background_color),
24+
)
1925
.map((banner)=>(
2026
<AnnouncementBannerView
2127
key={banner.message}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp