bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-reply-intention/styles.tsx

105 lines
2.1 KiB
TypeScript
Raw Normal View History

2024-10-03 06:28:02 +08:00
import styled, { css } from 'styled-components';
import ReactMarkdown from 'react-markdown';
2024-10-03 06:28:02 +08:00
import {
2024-10-17 03:10:27 +08:00
colorGrayLightest,
colorPrimary,
colorText,
colorWhite,
2024-10-03 06:28:02 +08:00
} from '/imports/ui/stylesheets/styled-components/palette';
2024-10-17 03:10:27 +08:00
import {
mdPadding, smPadding, smPaddingX, xlPadding,
} from '/imports/ui/stylesheets/styled-components/general';
import EmojiButton from '../chat-message-list/page/chat-message/message-toolbar/emoji-button/component';
2024-10-03 06:28:02 +08:00
const Container = styled.div<{ $hidden: boolean; $animations: boolean }>`
2024-10-17 03:10:27 +08:00
border-radius: 0.375rem;
background-color: ${colorWhite};
2024-10-17 03:10:27 +08:00
box-shadow: inset 0 0 0 1px ${colorGrayLightest};
display: flex;
align-items: center;
overflow: hidden;
2024-10-17 03:10:27 +08:00
[dir='ltr'] & {
border-right: 0.375rem solid ${colorPrimary};
}
[dir='rtl'] & {
border-left: 0.375rem solid ${colorPrimary};
}
2024-10-03 06:28:02 +08:00
${({ $hidden }) => ($hidden
? css`
height: 0;
2024-10-17 03:10:27 +08:00
min-height: 0;
2024-10-03 06:28:02 +08:00
`
: css`
min-height: calc(1rlh + ${mdPadding} * 2);
height: calc(1rlh + ${mdPadding} * 2);
2024-10-17 03:10:27 +08:00
padding: ${mdPadding} calc(${smPaddingX} * 1.25);
margin-bottom: ${smPadding};
[dir='ltr'] & {
margin-right: ${xlPadding};
}
[dir='rtl'] & {
margin-left: ${xlPadding};
}
2024-10-03 06:28:02 +08:00
`
)}
${({ $animations }) => $animations
&& css`
2024-10-17 03:10:27 +08:00
transition-property: height, min-height;
2024-10-03 06:28:02 +08:00
transition-duration: 0.1s;
`}
`;
const Message = styled.div`
line-height: 1rlh;
flex-grow: 1;
2024-10-03 06:28:02 +08:00
`;
const Markdown = styled(ReactMarkdown)<{
$emphasizedMessage: boolean;
}>`
color: ${colorText};
${({ $emphasizedMessage }) => $emphasizedMessage && `
font-weight: bold;
`}
& img {
max-width: 100%;
max-height: 100%;
}
& p {
line-height: 1rlh;
margin: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
& code {
line-height: 1rlh;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
`;
2024-10-03 06:28:02 +08:00
2024-10-17 03:10:27 +08:00
const CloseBtn = styled(EmojiButton)`
font-size: 75%;
height: 1rem;
padding: 0;
2024-10-03 06:28:02 +08:00
`;
export default {
Container,
CloseBtn,
Message,
Markdown,
2024-10-03 06:28:02 +08:00
};