chore: add announcement and topic classNames (#34140)

pull/34127/head^2
Júlia Jaeger Foresti 1 year ago committed by GitHub
parent d569f26fa4
commit c2cf2d773a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      apps/meteor/client/views/room/RoomAnnouncement/AnnouncementComponent.tsx
  2. 2
      apps/meteor/client/views/room/body/RoomTopic.tsx
  3. 7
      packages/ui-client/src/components/RoomBanner/RoomBanner.tsx
  4. 14
      packages/ui-client/src/components/RoomBanner/RoomBannerContent.tsx

@ -7,7 +7,7 @@ type AnnouncementComponenttParams = {
};
const AnnouncementComponent: FC<AnnouncementComponenttParams> = ({ children, onClickOpen }) => (
<RoomBanner className='rcx-header-section' onClick={onClickOpen}>
<RoomBanner className='rcx-header-section rcx-announcement-section' onClick={onClickOpen}>
<RoomBannerContent data-qa='AnnouncementAnnoucementComponent'>{children}</RoomBannerContent>
</RoomBanner>
);

@ -51,7 +51,7 @@ export const RoomTopic = ({ room, user }: RoomTopicProps) => {
if (!topic && !roomLeader) return null;
return (
<RoomBanner className='rcx-header-section' role='note'>
<RoomBanner className='rcx-header-section rcx-topic-section' role='note'>
<RoomBannerContent>
{roomLeader && !topic && canEdit ? (
<Box is='a' href={href}>

@ -10,6 +10,10 @@ const clickable = css`
}
`;
const style = css`
background-color: ${Palette.surface['surface-room']};
`;
export const RoomBanner = ({ onClick, className, ...props }: ComponentProps<typeof Box>) => {
const { isMobile } = useLayout();
@ -25,8 +29,7 @@ export const RoomBanner = ({ onClick, className, ...props }: ComponentProps<type
alignItems='center'
overflow='hidden'
flexDirection='row'
bg='room'
className={[onClick && clickable, ...(Array.isArray(className) ? className : [className])]}
className={[style, onClick && clickable, ...(Array.isArray(className) ? className : [className])]}
onClick={onClick}
tabIndex={onClick ? 0 : -1}
role={onClick ? 'button' : 'banner'}

@ -1,6 +1,16 @@
import { Box } from '@rocket.chat/fuselage';
import { css } from '@rocket.chat/css-in-js';
import { Box, Palette } from '@rocket.chat/fuselage';
import { HTMLAttributes } from 'react';
export const RoomBannerContent = (props: Omit<HTMLAttributes<HTMLElement>, 'is'>) => (
<Box color='hint' fontScale='p2' p={4} flexGrow={1} withTruncatedText {...props} />
<Box
fontScale='p2'
p={4}
flexGrow={1}
withTruncatedText
className={css`
color: ${Palette.text['font-hint']};
`}
{...props}
/>
);

Loading…
Cancel
Save