@@ -10,15 +10,23 @@ import {
1010} from '@leafygreen-ui/tokens' ;
1111
1212const getBaseContainerStyles = ( theme : Theme ) => css `
13+ position : relative;
14+ max-width : 100% ;
15+ width : 100% ;
16+ white-space : pre-line;
17+ overflow-wrap : break-word;
1318 display : flex;
1419 flex-direction : column;
15- gap : ${ spacing [ 150 ] } px;
16- align-items : flex-start;
20+ gap : ${ spacing [ 200 ] } px;
1721 color : ${ color [ theme ] . text [ Variant . Primary ] [ InteractionState . Default ] } ;
1822` ;
1923
20- const senderStyles = css `
21- align-items : flex-end;
24+ const getSenderContainerStyles = ( theme : Theme ) => css `
25+ width : auto;
26+ border-radius : ${ borderRadius [ 300 ] } px ${ borderRadius [ 300 ] } px 0 ;
27+ background-color : ${ palette . gray [ theme === Theme . Dark ? 'dark2' : 'light2' ] } ;
28+ padding : ${ spacing [ 300 ] } px;
29+ align-self : flex-end;
2230` ;
2331
2432export const getContainerStyles = ( {
@@ -33,39 +41,7 @@ export const getContainerStyles = ({
3341 cx (
3442 getBaseContainerStyles ( theme ) ,
3543 {
36- [ senderStyles ] : isSender ,
44+ [ getSenderContainerStyles ( theme ) ] : isSender ,
3745 } ,
3846 className ,
3947 ) ;
40-
41- export const avatarContainerStyles = css `
42- display : flex;
43- gap : ${ spacing [ 150 ] } px;
44- ` ;
45-
46- const baseMessageContainerStyles = css `
47- position : relative;
48- max-width : 100% ;
49- white-space : pre-line;
50- overflow-wrap : break-word;
51- display : flex;
52- flex-direction : column;
53- gap : ${ spacing [ 200 ] } px;
54- ` ;
55-
56- const getSenderMessageContainerStyles = ( theme : Theme ) => css `
57- border-radius : ${ borderRadius [ 300 ] } px ${ borderRadius [ 300 ] } px 0 ;
58- background-color : ${ palette . gray [ theme === Theme . Dark ? 'dark2' : 'light2' ] } ;
59- padding : ${ spacing [ 300 ] } px;
60- ` ;
61-
62- export const getMessageContainerStyles = ( {
63- isSender,
64- theme,
65- } : {
66- isSender : boolean ;
67- theme : Theme ;
68- } ) =>
69- cx ( baseMessageContainerStyles , {
70- [ getSenderMessageContainerStyles ( theme ) ] : isSender ,
71- } ) ;
0 commit comments