Skip to content

Commit c2cf2d7

Browse files
chore: add announcement and topic classNames (RocketChat#34140)
1 parent d569f26 commit c2cf2d7

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

apps/meteor/client/views/room/RoomAnnouncement/AnnouncementComponent.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type AnnouncementComponenttParams = {
77
};
88

99
const AnnouncementComponent: FC<AnnouncementComponenttParams> = ({ children, onClickOpen }) => (
10-
<RoomBanner className='rcx-header-section' onClick={onClickOpen}>
10+
<RoomBanner className='rcx-header-section rcx-announcement-section' onClick={onClickOpen}>
1111
<RoomBannerContent data-qa='AnnouncementAnnoucementComponent'>{children}</RoomBannerContent>
1212
</RoomBanner>
1313
);

apps/meteor/client/views/room/body/RoomTopic.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const RoomTopic = ({ room, user }: RoomTopicProps) => {
5151
if (!topic && !roomLeader) return null;
5252

5353
return (
54-
<RoomBanner className='rcx-header-section' role='note'>
54+
<RoomBanner className='rcx-header-section rcx-topic-section' role='note'>
5555
<RoomBannerContent>
5656
{roomLeader && !topic && canEdit ? (
5757
<Box is='a' href={href}>

packages/ui-client/src/components/RoomBanner/RoomBanner.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ const clickable = css`
1010
}
1111
`;
1212

13+
const style = css`
14+
background-color: ${Palette.surface['surface-room']};
15+
`;
16+
1317
export const RoomBanner = ({ onClick, className, ...props }: ComponentProps<typeof Box>) => {
1418
const { isMobile } = useLayout();
1519

@@ -25,8 +29,7 @@ export const RoomBanner = ({ onClick, className, ...props }: ComponentProps<type
2529
alignItems='center'
2630
overflow='hidden'
2731
flexDirection='row'
28-
bg='room'
29-
className={[onClick && clickable, ...(Array.isArray(className) ? className : [className])]}
32+
className={[style, onClick && clickable, ...(Array.isArray(className) ? className : [className])]}
3033
onClick={onClick}
3134
tabIndex={onClick ? 0 : -1}
3235
role={onClick ? 'button' : 'banner'}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
import { Box } from '@rocket.chat/fuselage';
1+
import { css } from '@rocket.chat/css-in-js';
2+
import { Box, Palette } from '@rocket.chat/fuselage';
23
import { HTMLAttributes } from 'react';
34

45
export const RoomBannerContent = (props: Omit<HTMLAttributes<HTMLElement>, 'is'>) => (
5-
<Box color='hint' fontScale='p2' p={4} flexGrow={1} withTruncatedText {...props} />
6+
<Box
7+
fontScale='p2'
8+
p={4}
9+
flexGrow={1}
10+
withTruncatedText
11+
className={css`
12+
color: ${Palette.text['font-hint']};
13+
`}
14+
{...props}
15+
/>
616
);

0 commit comments

Comments
 (0)