Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AC-3788] chore: file support design qa #357

Merged
merged 9 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/components/FormInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ const Chip = styled.div<ChipProps>`
outline: 'none',
'box-shadow': `0 0 0 1px ${theme.borderColor.formChip.focus}`,
},
'&:active': {
color: theme.textColor.formChip.selected,
backgroundColor: theme.bgColor.formChip.selected,
border: `1px solid ${theme.borderColor.formChip.selected}`,
},
};
}
case 'selected': {
Expand All @@ -133,6 +138,11 @@ const Chip = styled.div<ChipProps>`
outline: 'none',
'box-shadow': `0 0 0 1px ${theme.borderColor.formChip.focus}`,
},
'&:active': {
color: theme.textColor.formChip.selected,
backgroundColor: theme.bgColor.formChip.selected,
border: `1px solid ${theme.borderColor.formChip.selected}`,
},
};
}
case 'submittedDefault': {
Expand Down
23 changes: 13 additions & 10 deletions src/components/chat/ui/ChatInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ const container = css`
display: flex;
align-items: center;
.sendbird-message-input-text-field {
min-height: 40px;
min-height: 36px;
max-height: 100px;
height: 40px;
height: 36px;
overflow-y: auto;
padding: 8px 16px;
padding-top: 8px;
padding-bottom: 8px;
padding-inline-start: 16px;
border-radius: 20px;
// Not to zoom in on mobile set font-size to 16px which blocks the zooming on iOS
// @link: https://weblog.west-wind.com/posts/2023/Apr/17/Preventing-iOS-Safari-Textbox-Zooming
Expand All @@ -99,17 +101,18 @@ const container = css`
bottom: unset;
background-color: transparent;
}
.sendbird-iconbutton__inner {
height: unset;
}
.sendbird-message-input--attach {
right: unset;
bottom: unset;
inset-inline-end: 12px;
inset-block-start: 50%;
transform: translateY(-50%);
path {
fill: ${themedColors.onbackground1};
inset-block-end: 2px;
& .sendbird-iconbutton__inner {
height: 16px;
}
&:hover {
path {
fill: ${themedColors.oncontent_inverse1};
}
}
}
.sendbird-message-input--placeholder {
Expand Down
9 changes: 7 additions & 2 deletions src/components/chat/ui/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { css, cx } from '@linaria/core';
import { ChatHeader } from './ChatHeader';
import { ChatInput } from './ChatInput';
import { ChatMessageList } from './ChatMessageList';
import { themedColors, themedColorVars } from '../../../foundation/colors/css';
import { themedColorVars } from '../../../foundation/colors/css';
import { useDragDropArea } from '../../../tools/hooks/useDragDropFiles';
import { PoweredByBanner } from '../../ui/PoweredByBanner';

Expand All @@ -26,8 +26,13 @@ const container = css`
font-family: var(--sendbird-font-family-default);
height: 100%;
width: 100%;
background-color: ${themedColors.bg1};
display: flex;
flex-direction: column;
flex: 1;
.sendbird-theme--light & {
background-color: var(--sendbird-light-background-50);
}
.sendbird-theme--dark & {
background-color: var(--sendbird-dark-background-700);
}
`;
11 changes: 1 addition & 10 deletions src/components/ui/FileViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,11 @@ import { FileMessage } from '@sendbird/chat/message';

import { FileViewerView } from '@uikit/modules/GroupChannel/components/FileViewer/FileViewerView';

import { useChatContext } from '../chat/context/ChatProvider';

interface Props {
message: FileMessage;
onClose: () => void;
}
// TODO: Remove UIKit
export const FileViewer = ({ message, onClose }: Props) => {
const { dataSource } = useChatContext();
return (
<FileViewerView
message={message}
deleteMessage={(message: any) => dataSource.deleteMessage(message)}
onCancel={onClose}
/>
);
return <FileViewerView message={message} onCancel={onClose} />;
};