Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit ef72645

Browse files
authored
Merge pull request #150 from BoostIO/fix-style
Fix style
2 parents 2f85161 + 4f1a07a commit ef72645

File tree

2 files changed

+45
-37
lines changed

2 files changed

+45
-37
lines changed

app/views/note/DropboxNoteModal.js

Lines changed: 44 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,35 @@ const DROPBOX_ACCESS_TOKEN = 'DROPBOX:ACCESS_TOKEN'
3737

3838
const styles = {
3939
switchButton: {
40-
backgroundColor: 'transparent',
41-
borderColor: '#EFF1F5',
42-
borderWidth: 1
40+
backgroundColor: 'transparent',
41+
borderColor: '#1ec38b',
42+
borderWidth: 1
4343
},
4444
switchButtonActive: {
45-
backgroundColor: '#EFF1F5',
46-
borderColor: '#EFF1F5',
47-
borderWidth: 1
45+
backgroundColor: '#EFF1F5',
46+
borderColor: '#1ec38b',
47+
borderWidth: 1
48+
},
49+
switchEditButton: {
50+
position:'absolute',
51+
width: 40,
52+
right: 20
53+
},
54+
switchEditText: {
55+
color: '#1ec38b',
56+
fontSize: 16,
57+
lineHeight: 16
4858
},
4959
noteDetailButton: {
50-
color: '#EFF1F5',
51-
fontSize: 23
60+
color: '#1ec38b',
61+
fontSize: 23
5262
},
63+
backHomeText: {
64+
color: '#1ec38b',
65+
fontSize: 17,
66+
lineHeight: 17,
67+
paddingLeft: 10
68+
}
5369
}
5470

5571
export default class DropboxNoteModal extends React.Component {
@@ -62,7 +78,7 @@ export default class DropboxNoteModal extends React.Component {
6278
path: props.path,
6379
note: { content: '' },
6480
height: 0,
65-
isLeftSegmentActive: true,
81+
isEditting: true,
6682
visibleHeight: 230,
6783
endOfSelection: 0,
6884
isNoteOpen: props.isNoteOpen,
@@ -76,7 +92,7 @@ export default class DropboxNoteModal extends React.Component {
7692
this.getNoteData(props.path)
7793

7894
this.setState({
79-
isLeftSegmentActive: true,
95+
isEditting: true,
8096
path: props.path,
8197
})
8298
}
@@ -154,7 +170,7 @@ export default class DropboxNoteModal extends React.Component {
154170
}
155171

156172
getNoteComponent() {
157-
if (this.state.isLeftSegmentActive) {
173+
if (this.state.isEditting) {
158174
return <View style={{ flex: 1 }}>
159175
<ScrollView keyboardShouldPersistTaps='always'>
160176
<TextInput
@@ -261,6 +277,12 @@ export default class DropboxNoteModal extends React.Component {
261277
this.updateNoteContent(lines.join('\n'))
262278
}
263279

280+
handleSwitchEditButtonClick () {
281+
this.setState({
282+
isEditting: !this.state.isEditting
283+
})
284+
}
285+
264286
render() {
265287
return (
266288
<Modal
@@ -272,39 +294,25 @@ export default class DropboxNoteModal extends React.Component {
272294
<Container>
273295
<Header style={Platform.OS === 'android' ? {
274296
height: 47,
275-
backgroundColor: '#6C81A6'
276-
} : { backgroundColor: '#6C81A6' }} androidStatusBarColor='#239F85'>
297+
backgroundColor: '#f9f9f9'
298+
} : { backgroundColor: '#f9f9f9' }} androidStatusBarColor='#239F85'>
277299
<Left style={Platform.OS === 'android' ? { top: 0 } : null}>
278300
<Button transparent onPress={() => this.props.setNoteModalClose()} disable={this.state.isLoading}>
279-
<Text><Icon name='md-close' style={styles.noteDetailButton}/></Text>
301+
<Text><Icon name='ios-arrow-back' style={styles.noteDetailButton}/></Text>
302+
<Text style={styles.backHomeText}>Dropbox</Text>
280303
</Button>
281304
</Left>
282305

283-
<Body style={Platform.OS === 'android' ? { top: 0 } : null}>
284-
<Segment style={Platform.OS === 'android' ? {
285-
paddingRight: 25,
286-
position: 'relative',
287-
backgroundColor: 'transparent',
288-
borderWidth: 1
289-
} : { marginLeft: 50, position: 'absolute', top: -22, backgroundColor: 'transparent' }}>
290-
<Button onPress={() => {
291-
this.setState({ isLeftSegmentActive: true })
292-
}} first active={this.state.isLeftSegmentActive}
293-
style={this.state.isLeftSegmentActive ? styles.switchButtonActive : styles.switchButton}>
294-
<Text><Icon name='create' style={this.state.isLeftSegmentActive ? { color: '#6C81A6' } : {}}/></Text>
295-
</Button>
296-
<Button onPress={() => {
297-
this.setState({ isLeftSegmentActive: false })
298-
}} last active={!this.state.isLeftSegmentActive}
299-
style={this.state.isLeftSegmentActive ? styles.switchButton : styles.switchButtonActive}>
300-
<Text><Icon name='eye'
301-
style={this.state.isLeftSegmentActive ? { color: '#EFF1F5' } : { color: '#6C81A6' }}/></Text>
302-
</Button>
303-
</Segment>
304-
</Body>
305306
<Right style={Platform.OS === 'android' ? {top: 0} : {top: 3}}>
306307
<View>
307308
<Root>
309+
<Button transparent
310+
style={styles.switchEditButton}
311+
onPress={this.handleSwitchEditButtonClick.bind(this)}>
312+
<Text style={styles.switchEditText}>
313+
{this.state.isEditting ? 'Done' : 'Edit'}
314+
</Text>
315+
</Button>
308316
<Button transparent onPress={() => ActionSheet.show(
309317
{
310318
options: ["Delete", "Cancel"],

app/views/note/NoteModal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export default class NoteModal extends React.Component {
223223
</Button>
224224
</Left>
225225

226-
<Right style={Platform.OS === 'android' ? {top: 0} : {top: 3, flex: 1, flexDirection: 'row'}}>
226+
<Right style={Platform.OS === 'android' ? {top: 0} : {top: 3}}>
227227
<View>
228228
<Root>
229229
<Button transparent

0 commit comments

Comments
 (0)