Skip to content

Commit

Permalink
feat: add css
Browse files Browse the repository at this point in the history
  • Loading branch information
varshamenon4 committed Nov 18, 2024
1 parent 9209182 commit 7da8c9c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 30 deletions.
36 changes: 15 additions & 21 deletions src/components/MessageDivider/MessageDivider.scss
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
@use '../../utils/variables';

.divider {
width: fit-content;
max-width: 70%;
border-radius: 10px;
divider {
display: flex;
flex-direction: row;
font-size: 15px;

&.user {
background: variables.$dark-green;
color: white;
}

&.assistant {
background: #F2F0EF;
}
}

// bootstrap automatically adds a bottom margin of 1rem,
// which we do not need for the chat messages
.message p {
margin-bottom: 0rem;
divider:before, divider:after{
content: "";
flex: 1 1;
border-bottom: 1px solid;
margin: auto;
}

.time {
font-size: 10px;
divider:before {
margin-right: 10px;
margin-left: 10px
}
divider:after {
margin-right: 10px;
margin-left: 10px
}
12 changes: 3 additions & 9 deletions src/components/MessageDivider/index.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import React from 'react';
import ReactMarkdown from 'react-markdown';
import './MessageDivider.scss';
import PropTypes from 'prop-types';

const MessageDivider = ({ text }) => (
<div
className={`divider ${text} text-center my-1 mx-2 py-2 px-3`}
data-hj-suppress
>
<ReactMarkdown>
{text}
</ReactMarkdown>
</div>
<divider>
{text}
</divider>
);

MessageDivider.propTypes = {
Expand Down

0 comments on commit 7da8c9c

Please sign in to comment.