@@ -67,47 +67,39 @@ class _EditChannel extends React.Component<Props, State> {
6767 />
6868 ) : (
6969 ! Styles . isMobile && (
70- < Kb . Text
71- type = "Header"
72- style = { { marginBottom : Styles . globalMargins . tiny , marginTop : Styles . globalMargins . tiny } }
73- >
74- { this . props . title }
75- </ Kb . Text >
70+ < Kb . Box2 direction = "horizontal" fullWidth = { true } >
71+ < Kb . Text center = { true } lineClamp = { 1 } type = "Header" style = { styles . title } >
72+ { this . props . title }
73+ </ Kb . Text >
74+ </ Kb . Box2 >
7675 )
7776 ) }
78- { ! ! this . props . errorText && (
79- < Kb . Banner color = "red" >
80- < Kb . BannerParagraph bannerColor = "red" content = { this . props . errorText } />
81- </ Kb . Banner >
82- ) }
83- < Kb . Box style = { { position : 'relative' } } >
84- < Kb . Input
85- autoFocus = { true }
86- onChangeText = { this . onChangeChannelName }
87- hintText = { this . props . waitingForGetInfo ? 'Loading channel name...' : 'Channel name' }
88- editable = { ! this . props . waitingForGetInfo && ! this . props . deleteRenameDisabled }
89- value = { this . state . newChannelName }
90- />
9177
78+ < Kb . Box2 direction = "vertical" fullWidth = { true } style = { styles . bannerContainer } >
79+ { ! ! this . props . errorText && (
80+ < Kb . Banner color = "red" >
81+ < Kb . BannerParagraph bannerColor = "red" content = { this . props . errorText } />
82+ </ Kb . Banner >
83+ ) }
9284 { this . props . deleteRenameDisabled && (
93- < Kb . Text
94- center = { true }
95- type = "BodySmall"
96- style = { {
97- left : 0 ,
98- position : 'absolute' ,
99- right : 0 ,
100- top : 60 ,
101- } }
102- >
103- #general can’t be renamed or deleted.
104- </ Kb . Text >
85+ < Kb . Banner color = "blue" >
86+ < Kb . BannerParagraph bannerColor = "blue" content = "#general can’t be renamed or deleted." />
87+ </ Kb . Banner >
10588 ) }
89+ </ Kb . Box2 >
10690
107- < Kb . Input
91+ < Kb . Box2 direction = "vertical" fullWidth = { true } gap = "tiny" style = { styles . inputContainer } >
92+ < Kb . LabeledInput
93+ autoFocus = { true }
94+ onChangeText = { this . onChangeChannelName }
95+ placeholder = { this . props . waitingForGetInfo ? 'Loading channel name...' : 'Channel name' }
96+ disabled = { this . props . waitingForGetInfo || this . props . deleteRenameDisabled }
97+ value = { this . state . newChannelName }
98+ />
99+ < Kb . LabeledInput
108100 onChangeText = { this . onChangeTopic }
109- editable = { ! this . props . waitingForGetInfo }
110- hintText = {
101+ disabled = { this . props . waitingForGetInfo }
102+ placeholder = {
111103 this . props . waitingForGetInfo
112104 ? 'Loading channel description...'
113105 : 'Add a description or topic...'
@@ -121,16 +113,9 @@ class _EditChannel extends React.Component<Props, State> {
121113 // From go/chat/msgchecker/constants.go#HeadlineMaxLength
122114 maxLength = { 280 }
123115 />
124- </ Kb . Box >
125- < Kb . Box style = { styles . bottomRow } >
126- { ! Styles . isMobile && this . props . showDelete && ! this . props . deleteRenameDisabled && (
127- < DeleteChannel
128- channelName = { this . props . channelName }
129- onConfirmedDelete = { this . props . onConfirmedDelete }
130- disabled = { this . props . deleteRenameDisabled }
131- />
132- ) }
133- < Kb . ButtonBar >
116+ </ Kb . Box2 >
117+ < Kb . Box2 direction = "vertical" fullWidth = { true } >
118+ < Kb . ButtonBar fullWidth = { true } style = { styles . buttonBar } >
134119 < Kb . Button type = "Dim" label = "Cancel" onClick = { this . props . onCancel } />
135120 < Kb . Button
136121 label = "Save"
@@ -140,17 +125,16 @@ class _EditChannel extends React.Component<Props, State> {
140125 }
141126 waiting = { this . props . waitingOnSave }
142127 onClick = { this . onSave }
143- style = { { marginLeft : Styles . globalMargins . tiny } }
144128 />
145129 </ Kb . ButtonBar >
146- </ Kb . Box >
147- { Styles . isMobile && this . props . showDelete && ! this . props . deleteRenameDisabled && (
148- < DeleteChannel
149- channelName = { this . props . channelName }
150- onConfirmedDelete = { this . props . onConfirmedDelete }
151- disabled = { false }
152- />
153- ) }
130+ { this . props . showDelete && ! this . props . deleteRenameDisabled && (
131+ < DeleteChannel
132+ channelName = { this . props . channelName }
133+ onConfirmedDelete = { this . props . onConfirmedDelete }
134+ disabled = { this . props . deleteRenameDisabled }
135+ />
136+ ) }
137+ </ Kb . Box2 >
154138 </ Kb . Box >
155139 </ Kb . ScrollView >
156140 )
@@ -161,14 +145,8 @@ const EditChannel = Kb.HeaderOrPopupWithHeader(_EditChannel)
161145const styles = Styles . styleSheetCreate (
162146 ( ) =>
163147 ( {
164- bottomRow : {
165- ...Styles . globalStyles . flexBoxRow ,
166- alignItems : 'flex-end' ,
167- alignSelf : 'stretch' ,
168- flex : 1 ,
169- justifyContent : 'center' ,
170- position : 'relative' ,
171- ...( Styles . isMobile ? { } : { minWidth : '500px' } ) ,
148+ bannerContainer : {
149+ marginBottom : Styles . globalMargins . small ,
172150 } ,
173151 box : {
174152 ...Styles . globalStyles . flexBoxColumn ,
@@ -177,8 +155,25 @@ const styles = Styles.styleSheetCreate(
177155 paddingTop : Styles . globalMargins . medium ,
178156 ...( Styles . isMobile ? { flex : 1 } : { } ) ,
179157 } ,
180- scroll : {
181- flex : 1 ,
158+ buttonBar : { alignItems : 'center' } ,
159+ inputContainer : Styles . platformStyles ( {
160+ isElectron : {
161+ paddingLeft : Styles . globalMargins . large ,
162+ paddingRight : Styles . globalMargins . large ,
163+ } ,
164+ isMobile : {
165+ paddingLeft : Styles . globalMargins . small ,
166+ paddingRight : Styles . globalMargins . small ,
167+ } ,
168+ } ) ,
169+ scroll : Styles . platformStyles ( {
170+ common : { flex : 1 } ,
171+ isElectron : { width : 400 } ,
172+ } ) ,
173+ title : {
174+ marginBottom : Styles . globalMargins . tiny ,
175+ marginTop : Styles . globalMargins . tiny ,
176+ width : '100%' ,
182177 } ,
183178 } as const )
184179)
0 commit comments