Skip to content

Commit

Permalink
change aiMessage and humanMessage for user and assistant
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Di Nella committed Oct 10, 2023
1 parent f663b77 commit dfcff61
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions src/components/atoms/Message/Message.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default {
component: Message,
args: {
children: 'Soy un mensaje de prueba',
variant: 'aiMessage',
variant: 'assistant',
id: 'test',
backgroundColor: '#171717',
},
Expand All @@ -29,10 +29,10 @@ export default {

export const Default = Template.bind({})

export const HumanMessage = {
export const user = {
args: {
backgroundColor: '#171717',
variant: 'humanMessage',
variant: 'user',
},
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/atoms/Message/Message.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ export default css`
word-break: break-word;
${(props) =>
props.variant === 'aiMessage' &&
props.variant === 'assistant' &&
css`
color: var(--color-neutral-900);
background-color: var(--color-neutral-100);
`}
${(props) =>
props.variant === 'humanMessage' &&
props.variant === 'user' &&
css`
color: ${getReadableTextColor(props.backgroundColor)};
background-color: ${props.backgroundColor};
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/Message/Message.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ initStoryshots({
const componentProps = {
id: 'unique_id',
children: 'Soy un mensaje de prueba',
variant: 'aiMessage',
variant: 'assistant',
}
afterEach(cleanup)

Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/Message/constants.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const options = {
variants: ['aiMessage', 'humanMessage'],
variants: ['assistant', 'user'],
}
10 changes: 5 additions & 5 deletions src/components/layout/ChatWrapper/ChatWrapper.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ const Template = getTemplate(ChatWrapper)
let conversationList = [
{
content: 'Hola Hola',
variant: 'aiMessage',
variant: 'assistant',
},
{
content: 'This is a message, test testing',
variant: 'aiMessage',
variant: 'assistant',
},
{
content:
'It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.',
variant: 'humanMessage',
variant: 'user',
},
{
content: 'This is a message, test testing 😎',
variant: 'humanMessage',
variant: 'user',
},
{
content: <a href="google.com">This is a link</a>,
variant: 'humanMessage',
variant: 'user',
},
]

Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/Conversation/Conversation.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Conversation = ({ id, messages, isMessageLoading, children }) => {
gap="xs"
key={message.id}
alignItems={
message.variant === 'aiMessage' ? 'flex-start' : 'flex-end'
message.variant === 'assistant' ? 'flex-start' : 'flex-end'
}
>
<Message
Expand Down
10 changes: 5 additions & 5 deletions src/components/molecules/Conversation/Conversation.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ const Template = getTemplate(Conversation)
let conversationList = [
{
content: 'Hola Hola',
role: 'aiMessage',
role: 'assistant',
},
{
content: 'This is a message, test testing',
role: 'aiMessage',
role: 'assistant',
},
{
content:
'It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.',
role: 'humanMessage',
role: 'user',
},
{
content: 'This is a message, test testing 😎',
role: 'humanMessage',
role: 'user',
},
{
content: <a href="google.com">This is a link</a>,
role: 'humanMessage',
role: 'user',
},
]

Expand Down
8 changes: 4 additions & 4 deletions src/components/molecules/Conversation/Conversation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ initStoryshots({
let conversationList = [
{
content: 'Hola Hola',
variant: 'aiMessage',
variant: 'assistant',
},
{
content: 'This is a message, test testing',
variant: 'aiMessage',
variant: 'assistant',
},
{
content: 'This is a message, test testing 😎',
variant: 'humanMessage',
variant: 'user',
},
{
content: <a href="google.com">This is a link</a>,
variant: 'humanMessage',
variant: 'user',
},
]

Expand Down

0 comments on commit dfcff61

Please sign in to comment.