@@ -37,19 +37,35 @@ const DROPBOX_ACCESS_TOKEN = 'DROPBOX:ACCESS_TOKEN'
37
37
38
38
const styles = {
39
39
switchButton : {
40
- backgroundColor : 'transparent' ,
41
- borderColor : '#EFF1F5 ' ,
42
- borderWidth : 1
40
+ backgroundColor : 'transparent' ,
41
+ borderColor : '#1ec38b ' ,
42
+ borderWidth : 1
43
43
} ,
44
44
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
48
58
} ,
49
59
noteDetailButton : {
50
- color : '#EFF1F5 ' ,
51
- fontSize : 23
60
+ color : '#1ec38b ' ,
61
+ fontSize : 23
52
62
} ,
63
+ backHomeText : {
64
+ color : '#1ec38b' ,
65
+ fontSize : 17 ,
66
+ lineHeight : 17 ,
67
+ paddingLeft : 10
68
+ }
53
69
}
54
70
55
71
export default class DropboxNoteModal extends React . Component {
@@ -62,7 +78,7 @@ export default class DropboxNoteModal extends React.Component {
62
78
path : props . path ,
63
79
note : { content : '' } ,
64
80
height : 0 ,
65
- isLeftSegmentActive : true ,
81
+ isEditting : true ,
66
82
visibleHeight : 230 ,
67
83
endOfSelection : 0 ,
68
84
isNoteOpen : props . isNoteOpen ,
@@ -76,7 +92,7 @@ export default class DropboxNoteModal extends React.Component {
76
92
this . getNoteData ( props . path )
77
93
78
94
this . setState ( {
79
- isLeftSegmentActive : true ,
95
+ isEditting : true ,
80
96
path : props . path ,
81
97
} )
82
98
}
@@ -154,7 +170,7 @@ export default class DropboxNoteModal extends React.Component {
154
170
}
155
171
156
172
getNoteComponent ( ) {
157
- if ( this . state . isLeftSegmentActive ) {
173
+ if ( this . state . isEditting ) {
158
174
return < View style = { { flex : 1 } } >
159
175
< ScrollView keyboardShouldPersistTaps = 'always' >
160
176
< TextInput
@@ -261,6 +277,12 @@ export default class DropboxNoteModal extends React.Component {
261
277
this . updateNoteContent ( lines . join ( '\n' ) )
262
278
}
263
279
280
+ handleSwitchEditButtonClick ( ) {
281
+ this . setState ( {
282
+ isEditting : ! this . state . isEditting
283
+ } )
284
+ }
285
+
264
286
render ( ) {
265
287
return (
266
288
< Modal
@@ -272,39 +294,25 @@ export default class DropboxNoteModal extends React.Component {
272
294
< Container >
273
295
< Header style = { Platform . OS === 'android' ? {
274
296
height : 47 ,
275
- backgroundColor : '#6C81A6 '
276
- } : { backgroundColor : '#6C81A6 ' } } androidStatusBarColor = '#239F85' >
297
+ backgroundColor : '#f9f9f9 '
298
+ } : { backgroundColor : '#f9f9f9 ' } } androidStatusBarColor = '#239F85' >
277
299
< Left style = { Platform . OS === 'android' ? { top : 0 } : null } >
278
300
< 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 >
280
303
</ Button >
281
304
</ Left >
282
305
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 >
305
306
< Right style = { Platform . OS === 'android' ? { top : 0 } : { top : 3 } } >
306
307
< View >
307
308
< 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 >
308
316
< Button transparent onPress = { ( ) => ActionSheet . show (
309
317
{
310
318
options : [ "Delete" , "Cancel" ] ,
0 commit comments