Skip to content

Commit

Permalink
misc: update ui style
Browse files Browse the repository at this point in the history
  • Loading branch information
embbnux committed Dec 5, 2024
1 parent ed2f2bb commit 226ea92
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
17 changes: 14 additions & 3 deletions src/components/GlipChatPanel/GlipMarkdown.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import type { ReactNode } from 'react';
import ReactMarkdown from 'react-markdown';
import { styled } from '@ringcentral/juno';
import { styled, palette2 } from '@ringcentral/juno';
import { replaceEmojiText, replaceAtTeamText } from './formatPost';

function ImageRender(props: {
Expand Down Expand Up @@ -78,6 +78,17 @@ function TextRender({
);
}

const Container = styled.div`
blockquote {
padding: 6px 6px 6px 16px;
margin: 4px 0px 8px;
border-left: 1px solid ${palette2('interactive', 'b02')};
background-color: ${palette2('neutral', 'b02')};
color: ${palette2('neutral', 'f04')};
overflow-x: auto;
}
`;

export function GlipMarkdown({
className = undefined,
text,
Expand All @@ -88,7 +99,7 @@ export function GlipMarkdown({
atRender?: (...args: any[]) => any;
}) {
return (
<div className={className}>
<Container className={className}>
<ReactMarkdown
components={{
a: LinkRender,
Expand All @@ -103,6 +114,6 @@ export function GlipMarkdown({
>
{replaceAtTeamText(replaceEmojiText(text))}
</ReactMarkdown>
</div>
</Container>
);
}
7 changes: 1 addition & 6 deletions src/components/GlipChatPanel/GlipPostItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,15 @@ const TimeText = styled.span`

function PostName({
creator = null,
showName,
viewProfile,
dateTime,
}: {
creator: Creator | null;
showName: boolean;
viewProfile: (id: string) => void;
dateTime?: string;
sendStatus?: string | null;
}) {
if (!creator || !showName) {
if (!creator) {
return null;
}
return (
Expand Down Expand Up @@ -145,15 +143,13 @@ export function GlipPostItem({
post = {},
className = undefined,
creationTime = undefined,
showName = true,
atRender = () => null,
viewProfile,
showCreator = true,
}: {
post: any;
className?: string;
creationTime?: string;
showName?: boolean;
showCreator?: boolean;
atRender: (...args: any[]) => any;
viewProfile: (...args: any[]) => any;
Expand Down Expand Up @@ -183,7 +179,6 @@ export function GlipPostItem({
showCreator ? (
<PostName
creator={post.creator}
showName={showName || post.type !== 'TextMessage'}
viewProfile={viewProfile}
dateTime={creationTime}
/>
Expand Down
3 changes: 0 additions & 3 deletions src/components/GlipChatPanel/GlipPostList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export function GlipPostList({
className = undefined,
posts = [],
groupId = undefined,
showName = true,
dateTimeFormatter,
viewProfile,
loadNextPage,
Expand All @@ -21,7 +20,6 @@ export function GlipPostList({
className?: string;
posts?: any[];
groupId?: string;
showName?: boolean;
dateTimeFormatter: (...args: any[]) => any;
viewProfile: (...args: any[]) => any;
loadNextPage: (...args: any[]) => any;
Expand Down Expand Up @@ -120,7 +118,6 @@ export function GlipPostList({
<GlipPostItem
post={post}
creationTime={dateTimeFormatter(post.creationTime)}
showName={showName}
atRender={atRender}
viewProfile={viewProfile}
showCreator={showCreator}
Expand Down
1 change: 0 additions & 1 deletion src/components/GlipChatPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export function GlipChatPanel({
posts={posts}
atRender={atRender}
groupId={group.id}
showName={group.members && group.members.length > 2}
dateTimeFormatter={dateTimeFormatter}
viewProfile={viewProfile}
loadNextPage={loadNextPage}
Expand Down
5 changes: 5 additions & 0 deletions src/components/GlipGroupsPanel/GlipGroupItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ function GlipGroupAvatar({
const StyledListItem = styled(RcListItem)`
border-bottom: 1px solid ${palette2('neutral', 'l02')};
background-color: ${palette2('neutral', 'b01')};
height: 57px;
.RcListItemText-primary {
font-size: 0.875rem;
}
`;

const UnreadBadge = styled(RcChip)`
Expand Down

0 comments on commit 226ea92

Please sign in to comment.