Skip to content

Commit 7e914d3

Browse files
authored
Remove underlined inputs. (keybase#21707)
* Update inputs and clean up channel editor. * Update input styles on git. * Update input styles on new channel modal. * Update input styles on delete repo modal. * Update some team input styles. * Update input style on invitations. * Update input styles on account name modal. * Fix dark mode hover colors. * Prettier * Update some stragglers, unify some others. * Saving files is helpful. * Update proof username modal input styles. * Update more inputs. * Storyshots * Prettier
1 parent f7ab053 commit 7e914d3

19 files changed

Lines changed: 4288 additions & 2465 deletions

File tree

‎shared/chat/create-channel/index.desktop.tsx‎

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,19 @@ const CreateChannel = (props: Props) => (
2525
)}
2626
<Kb.Box style={styles.box}>
2727
<Kb.Box style={styles.back} onClick={props.onBack}>
28-
<Kb.Icon style={styles.back} type="iconfont-arrow-left" />
28+
<Kb.Icon style={styles.backIcon} type="iconfont-arrow-left" />
2929
<Kb.Text type="BodyPrimaryLink">Back</Kb.Text>
3030
</Kb.Box>
31-
<Kb.Box style={styles.input}>
32-
<Kb.Input
31+
<Kb.Box2 direction="vertical" fullWidth={true} gap="tiny" gapEnd={true} gapStart={true}>
32+
<Kb.LabeledInput
3333
autoFocus={true}
34-
style={{minWidth: 450}}
35-
hintText="Channel name"
34+
style={styles.input}
35+
placeholder="Channel name"
3636
value={props.channelname}
3737
onEnterKeyDown={props.onSubmit}
3838
onChangeText={channelname => props.onChannelnameChange(channelname)}
3939
/>
40-
</Kb.Box>
41-
<Kb.Box style={styles.input}>
42-
<Kb.Input
40+
<Kb.LabeledInput
4341
autoFocus={false}
4442
autoCorrect={true}
4543
autoCapitalize="sentences"
@@ -48,14 +46,14 @@ const CreateChannel = (props: Props) => (
4846
rowsMax={10}
4947
// From go/chat/msgchecker/constants.go#HeadlineMaxLength
5048
maxLength={280}
51-
style={{minWidth: 450}}
52-
hintText="Add a description or topic..."
49+
style={styles.input}
50+
placeholder="Add a description or topic..."
5351
value={props.description}
5452
onEnterKeyDown={props.onSubmit}
5553
onChangeText={description => props.onDescriptionChange(description)}
5654
/>
57-
</Kb.Box>
58-
<Kb.ButtonBar>
55+
</Kb.Box2>
56+
<Kb.ButtonBar fullWidth={true} style={styles.buttonBar}>
5957
<Kb.Button type="Dim" onClick={props.onClose} label="Cancel" />
6058
<Kb.WaitingButton
6159
waitingKey={Constants.createChannelWaitingKey(props.teamname)}
@@ -77,32 +75,26 @@ const styles = Styles.styleSheetCreate(
7775
position: 'absolute',
7876
top: 32,
7977
},
80-
backIcon: Styles.platformStyles({
81-
common: {
82-
marginRight: Styles.globalMargins.xtiny,
83-
},
84-
isElectron: {
85-
display: 'block',
86-
},
87-
}),
78+
backIcon: {
79+
marginRight: Styles.globalMargins.xtiny,
80+
},
8881
box: {
8982
...Styles.globalStyles.flexBoxColumn,
9083
alignItems: 'center',
9184
paddingLeft: Styles.globalMargins.large,
9285
paddingRight: Styles.globalMargins.large,
9386
},
87+
buttonBar: {alignItems: 'center'},
9488
container: {
95-
height: 520,
96-
width: 620,
89+
maxHeight: 520,
90+
width: 400,
9791
},
9892
cover: {
9993
alignItems: 'center',
100-
backgroundColor: Styles.globalColors.black_50,
10194
justifyContent: 'center',
10295
},
10396
input: {
104-
...Styles.globalStyles.flexBoxRow,
105-
marginTop: Styles.globalMargins.medium,
97+
width: '100%',
10698
},
10799
} as const)
108100
)

‎shared/chat/create-channel/index.native.tsx‎

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@ const CreateChannel = (props: Props) => (
1212
</Kb.Banner>
1313
)}
1414
<Kb.Box style={styles.box}>
15-
<Kb.Box style={styles.input}>
16-
<Kb.Input
15+
<Kb.Box2 direction="vertical" fullWidth={true} gap="small">
16+
<Kb.LabeledInput
1717
autoFocus={true}
18-
hintText="Channel name"
18+
placeholder="Channel name"
1919
value={props.channelname}
2020
onChangeText={channelname => props.onChannelnameChange(channelname)}
2121
/>
22-
</Kb.Box>
23-
<Kb.Box style={styles.input}>
24-
<Kb.Input
22+
<Kb.LabeledInput
2523
autoCorrect={true}
2624
autoFocus={false}
2725
autoCapitalize="sentences"
@@ -30,12 +28,12 @@ const CreateChannel = (props: Props) => (
3028
rowsMax={2}
3129
// From go/chat/msgchecker/constants.go#HeadlineMaxLength
3230
maxLength={280}
33-
hintText="Add a description or topic..."
31+
placeholder="Add a description or topic..."
3432
value={props.description}
3533
onChangeText={description => props.onDescriptionChange(description)}
3634
/>
37-
</Kb.Box>
38-
<Kb.ButtonBar>
35+
</Kb.Box2>
36+
<Kb.ButtonBar fullWidth={true} style={styles.buttonBar}>
3937
<Kb.WaitingButton
4038
waitingKey={Constants.createChannelWaitingKey(props.teamname)}
4139
onClick={props.onSubmit}
@@ -49,12 +47,8 @@ const CreateChannel = (props: Props) => (
4947
const styles = Styles.styleSheetCreate(
5048
() =>
5149
({
52-
box: {
53-
padding: 16,
54-
},
55-
input: {
56-
marginTop: Styles.globalMargins.large,
57-
},
50+
box: {padding: 16},
51+
buttonBar: {alignItems: 'center'},
5852
} as const)
5953
)
6054

‎shared/chat/manage-channels/delete-channel.tsx‎

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,20 @@ class _DeleteChannel extends React.Component<Props, State> {
4343
]
4444

4545
return (
46-
<Kb.Box style={Styles.collapseStyles([styles.container, disabled && {opacity: 0.5}])}>
46+
<Kb.Box2
47+
alignItems="center"
48+
direction="horizontal"
49+
style={Styles.collapseStyles([styles.container, disabled && {opacity: 0.5}])}
50+
>
4751
<Kb.Icon type="iconfont-trash" style={styles.trashIcon} color={Styles.globalColors.red} />
52+
<Kb.Text
53+
type="BodyBigLink"
54+
style={styles.colorRed}
55+
onClick={this.props.toggleShowingMenu}
56+
ref={this.props.setAttachmentRef}
57+
>
58+
Delete channel
59+
</Kb.Text>
4860
<Kb.FloatingMenu
4961
closeOnSelect={true}
5062
header={header}
@@ -54,37 +66,16 @@ class _DeleteChannel extends React.Component<Props, State> {
5466
onHidden={this.props.toggleShowingMenu}
5567
containerStyle={styles.menuContainer}
5668
/>
57-
<Kb.Text
58-
type="BodyBigLink"
59-
style={styles.colorRed}
60-
onClick={this.props.toggleShowingMenu}
61-
ref={this.props.setAttachmentRef}
62-
>
63-
Delete channel
64-
</Kb.Text>
65-
</Kb.Box>
69+
</Kb.Box2>
6670
)
6771
}
6872
}
6973

7074
const styles = Styles.styleSheetCreate(() => ({
7175
colorRed: {color: Styles.globalColors.redDark},
72-
container: Styles.platformStyles({
73-
common: {
74-
...Styles.globalStyles.flexBoxRow,
75-
},
76-
isElectron: {
77-
left: 12,
78-
position: 'absolute',
79-
top: 55,
80-
},
81-
isMobile: {
82-
paddingBottom: Styles.globalMargins.medium,
83-
paddingLeft: Styles.globalMargins.large,
84-
paddingRight: Styles.globalMargins.large,
85-
paddingTop: Styles.globalMargins.medium,
86-
},
87-
}),
76+
container: {
77+
marginTop: Styles.globalMargins.tiny,
78+
},
8879
headerContainer: Styles.platformStyles({
8980
common: {
9081
...Styles.globalStyles.flexBoxColumn,

‎shared/chat/manage-channels/edit-channel.tsx‎

Lines changed: 58 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -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)
161145
const 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
)

‎shared/fs/browser/rows/editing.tsx‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,16 @@ const Editing = (props: EditingProps) => {
2929
}
3030
body={
3131
<Kb.Box key="main" style={rowStyles.itemBox}>
32-
<Kb.Input
33-
hideUnderline={true}
34-
small={true}
32+
<Kb.PlainInput
3533
value={filename}
36-
hintText={props.hint}
37-
inputStyle={styles.text}
34+
placeholder={props.hint}
35+
style={styles.text}
3836
onEnterKeyDown={props.onSubmit}
3937
onChangeText={name => {
4038
setFilename(name)
4139
props.onUpdate(name)
4240
}}
4341
autoFocus={true}
44-
selectTextOnFocus={true}
4542
/>
4643
</Kb.Box>
4744
}

0 commit comments

Comments
 (0)