Commit bd0ffdd 1 parent 20e00ad commit bd0ffdd Copy full SHA for bd0ffdd
File tree 1 file changed +31
-27
lines changed
src/components/inputs/localized-rich-text-input
1 file changed +31
-27
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,21 @@ import messages from './messages';
16
16
17
17
const COLLAPSED_HEIGHT = 32 ;
18
18
19
- const Wrapper = styled . div `
19
+ const LeftColumn = styled . div `
20
20
flex : 1 ;
21
21
` ;
22
22
23
+ const RightColumn = styled . div `
24
+ flex : 0 ;
25
+ ` ;
26
+
27
+ const Row = styled . div `
28
+ display : flex;
29
+ & : empty {
30
+ margin : 0 !important ;
31
+ }
32
+ ` ;
33
+
23
34
const Editor = props => {
24
35
const intl = useIntl ( ) ;
25
36
const ref = React . useRef ( ) ;
@@ -111,46 +122,39 @@ const Editor = props => {
111
122
{ props . children }
112
123
</ RichTextBody >
113
124
</ div >
114
- < div
115
- css = { css `
116
- display : flex;
117
-
118
- & : empty {
119
- margin : 0 !important ;
120
- }
121
- ` }
122
- >
125
+ < Row >
123
126
{ ( ( ) => {
124
127
if ( props . error )
125
128
return (
126
- < Wrapper >
129
+ < LeftColumn >
127
130
< div > { props . error } </ div >
128
- </ Wrapper >
131
+ </ LeftColumn >
129
132
) ;
130
133
if ( props . warning )
131
134
return (
132
- < Wrapper >
135
+ < LeftColumn >
133
136
< div > { props . warning } </ div >
134
- </ Wrapper >
137
+ </ LeftColumn >
135
138
) ;
136
139
return (
137
- languagesControl && < Wrapper > { languagesControl } </ Wrapper >
140
+ languagesControl && (
141
+ < LeftColumn > { languagesControl } </ LeftColumn >
142
+ )
138
143
) ;
139
144
} ) ( ) }
140
145
{ renderToggleButton && isOpen && (
141
- < div
142
- css = { css `
143
- flex : 0 ;
144
- ` }
145
- >
146
- < FlatButton
147
- onClick = { toggle }
148
- label = { intl . formatMessage ( messages . collapse ) }
149
- icon = { < AngleUpIcon size = "small" /> }
150
- />
151
- </ div >
146
+ < React . Fragment >
147
+ < LeftColumn />
148
+ < RightColumn >
149
+ < FlatButton
150
+ onClick = { toggle }
151
+ label = { intl . formatMessage ( messages . collapse ) }
152
+ icon = { < AngleUpIcon size = "small" /> }
153
+ />
154
+ </ RightColumn >
155
+ </ React . Fragment >
152
156
) }
153
- </ div >
157
+ </ Row >
154
158
{ ( props . error || props . warning ) && props . languagesControl ( ) }
155
159
</ Spacings . Stack >
156
160
) ;
You can’t perform that action at this time.
0 commit comments