Skip to content
Snippets Groups Projects
Commit 39ee1794 authored by Marek Veselý's avatar Marek Veselý
Browse files

Merge branch 'qa-3' into 'main'

Qa 3

Closes #286

See merge request inject/frontend!239
parents 427e0874 c55d93b6
No related branches found
No related tags found
No related merge requests found
import { Colors } from '@blueprintjs/core'
import { css } from '@emotion/css' import { css } from '@emotion/css'
import type { FC, PropsWithChildren } from 'react' import type { FC, PropsWithChildren } from 'react'
const div = css` const div = css`
background: #c20b0b; background: ${Colors.RED1};
color: var(--white-1); color: ${Colors.WHITE};
border-radius: var(--md); border-radius: 0.5rem;
padding: var(--md) var(--lg); padding: 0.5rem 1rem;
` `
const ErrorMessage: FC<PropsWithChildren> = ({ children }) => ( const ErrorMessage: FC<PropsWithChildren> = ({ children }) => (
......
...@@ -5,27 +5,12 @@ html, body, #root { ...@@ -5,27 +5,12 @@ html, body, #root {
html { html {
overflow-x: hidden; overflow-x: hidden;
/* overflow-y: hidden; */
} }
body.bp5-dark { body.bp5-dark {
background-color: #2f343c; 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; box-sizing: border-box;
} }
...@@ -64,7 +49,6 @@ h6 { ...@@ -64,7 +49,6 @@ h6 {
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
border-radius: 8px; border-radius: 8px;
background-color: transparent; background-color: transparent;
/* border: 1px solid rgba(255, 255, 255, 0.2); */
border-left: 2px none; border-left: 2px none;
border-right: 2px none; border-right: 2px none;
border-top: 2px none; border-top: 2px none;
......
...@@ -2,11 +2,12 @@ import { EmailSelection } from '@/analyst/utilities' ...@@ -2,11 +2,12 @@ import { EmailSelection } from '@/analyst/utilities'
import type { LinkType } from '@/components/LinkButton' import type { LinkType } from '@/components/LinkButton'
import LinkButton from '@/components/LinkButton' import LinkButton from '@/components/LinkButton'
import type { Path } from '@/router' 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 type { Channel } from '@inject/graphql/fragments/Channel.generated'
import { useWriteReadReceiptChannel } from '@inject/graphql/mutations/clientonly/WriteReadReceiptChannel.generated' import { useWriteReadReceiptChannel } from '@inject/graphql/mutations/clientonly/WriteReadReceiptChannel.generated'
import type { ChannelType } from '@inject/graphql/types' import type { ChannelType } from '@inject/graphql/types'
import type { FC } from 'react' import { useMemo, type FC } from 'react'
import { matchPath } from 'react-router-dom' import { matchPath } from 'react-router-dom'
interface ChannelButtonProps { interface ChannelButtonProps {
...@@ -131,24 +132,30 @@ const ChannelButton: FC<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 ( return (
<LinkButton <LinkButton
key={getLink(channel)[0] as string} key={getLink(channel)[0] as string}
link={getLink(channel)} link={getLink(channel)}
button={{ button={{
icon: getIcon(channel.type), icon: getIcon(channel.type),
text: !hideLabel && channel.name,
title: channel.name, title: channel.name,
fill: true, fill: true,
alignText: 'left', alignText: 'left',
minimal: true, minimal: true,
active: getActive(channel), active: getActive(channel),
intent: channel.readReceipt?.find( intent: isUnread ? 'warning' : undefined,
x => x?.teamId == teamId && x.readReceipt === null rightIcon: isUnread ? <Dot color={Colors.RED3} /> : undefined,
)
? 'warning'
: undefined,
onClick: mutate, onClick: mutate,
children: !hideLabel && isUnread ? <b>{channel.name}</b> : channel.name,
}} }}
/> />
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment