diff --git a/frontend/src/components/ErrorMessage/index.tsx b/frontend/src/components/ErrorMessage/index.tsx index 0989b171a04357d38f7777bfb4ff05d17385d490..9db9602454c26cc4087b884e795434180397aecb 100644 --- a/frontend/src/components/ErrorMessage/index.tsx +++ b/frontend/src/components/ErrorMessage/index.tsx @@ -1,11 +1,12 @@ +import { Colors } from '@blueprintjs/core' import { css } from '@emotion/css' import type { FC, PropsWithChildren } from 'react' const div = css` - background: #c20b0b; - color: var(--white-1); - border-radius: var(--md); - padding: var(--md) var(--lg); + background: ${Colors.RED1}; + color: ${Colors.WHITE}; + border-radius: 0.5rem; + padding: 0.5rem 1rem; ` const ErrorMessage: FC<PropsWithChildren> = ({ children }) => ( diff --git a/frontend/src/global.css b/frontend/src/global.css index 7f4526b166382b97ab095eb25fbfa0815cf032e9..e158e8e19abe2906abb76b56b4e14ac5d8e545d1 100644 --- a/frontend/src/global.css +++ b/frontend/src/global.css @@ -5,27 +5,12 @@ html, body, #root { html { overflow-x: hidden; - - /* overflow-y: hidden; */ } body.bp5-dark { background-color: #2f343c; } -body { - --green-1: #12ae12; - --white-1: #fffefe; - --grey-1: #aeaeae; - --grey-2: #9e9e93; - --blue-1: #43d4ee; - --sm: 0.25rem; - --md: 0.5rem; - --lg: 1rem; - --xl: 2rem; - --xxl: 4rem; -} - * { box-sizing: border-box; } @@ -64,7 +49,6 @@ h6 { ::-webkit-scrollbar-track { border-radius: 8px; background-color: transparent; - /* border: 1px solid rgba(255, 255, 255, 0.2); */ border-left: 2px none; border-right: 2px none; border-top: 2px none; diff --git a/frontend/src/views/ChannelButton.tsx b/frontend/src/views/ChannelButton.tsx index c05949f21689ab4f2deb0f579dd5813d4436ddd8..114feedc8f6a2b353fac3403efaa0971cf01d561 100644 --- a/frontend/src/views/ChannelButton.tsx +++ b/frontend/src/views/ChannelButton.tsx @@ -2,11 +2,12 @@ import { EmailSelection } from '@/analyst/utilities' import type { LinkType } from '@/components/LinkButton' import LinkButton from '@/components/LinkButton' import type { Path } from '@/router' -import type { IconName } from '@blueprintjs/core' +import { Colors, type IconName } from '@blueprintjs/core' +import { Dot } from '@blueprintjs/icons' import type { Channel } from '@inject/graphql/fragments/Channel.generated' import { useWriteReadReceiptChannel } from '@inject/graphql/mutations/clientonly/WriteReadReceiptChannel.generated' import type { ChannelType } from '@inject/graphql/types' -import type { FC } from 'react' +import { useMemo, type FC } from 'react' import { matchPath } from 'react-router-dom' interface ChannelButtonProps { @@ -131,24 +132,30 @@ const ChannelButton: FC<ChannelButtonProps> = ({ ) } + const isUnread = useMemo( + () => + channel.readReceipt.find( + ({ readReceipt, teamId: receiptTeamId }) => + receiptTeamId === teamId && readReceipt === null + ), + [channel.readReceipt, teamId] + ) + return ( <LinkButton key={getLink(channel)[0] as string} link={getLink(channel)} button={{ icon: getIcon(channel.type), - text: !hideLabel && channel.name, title: channel.name, fill: true, alignText: 'left', minimal: true, active: getActive(channel), - intent: channel.readReceipt?.find( - x => x?.teamId == teamId && x.readReceipt === null - ) - ? 'warning' - : undefined, + intent: isUnread ? 'warning' : undefined, + rightIcon: isUnread ? <Dot color={Colors.RED3} /> : undefined, onClick: mutate, + children: !hideLabel && isUnread ? <b>{channel.name}</b> : channel.name, }} /> )