File tree 4 files changed +76
-60
lines changed
4 files changed +76
-60
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ const styles = StyleSheet.create({
27
27
title : {
28
28
flexDirection : 'row' ,
29
29
alignItems : 'center' ,
30
- marginBottom : 15
30
+ marginBottom : 10
31
31
} ,
32
32
33
33
avatar : {
@@ -45,6 +45,16 @@ const styles = StyleSheet.create({
45
45
fontSize : 16
46
46
} ,
47
47
48
+ time : {
49
+ fontSize : 14 ,
50
+ opacity : 0.8
51
+ } ,
52
+
53
+ text : {
54
+ fontSize : 16 ,
55
+ color : '#222222'
56
+ } ,
57
+
48
58
button : {
49
59
position : 'absolute' ,
50
60
right : 0 ,
@@ -107,10 +117,10 @@ export class NoteListItem extends PureComponent {
107
117
< Image style = { styles . avatar } source = { avatar } />
108
118
< View style = { styles . info } >
109
119
< Text style = { styles . name } > { userName } </ Text >
110
- < Text style = { styles . name } > { editTime } </ Text >
120
+ < Text style = { styles . time } > { editTime } </ Text >
111
121
</ View >
112
122
</ View >
113
- < Text style = { styles . name } > { text } </ Text >
123
+ < Text style = { styles . text } > { text } </ Text >
114
124
< MenuButton
115
125
style = { styles . button }
116
126
ref = { ref => this . _buttonRef = ref }
Original file line number Diff line number Diff line change 1
- const currentUser = {
2
- userName : 'Alex Lavrov' ,
3
- avatar : require ( '../images/avatar_1.jpg' ) ,
4
- }
1
+ import { currentUser } from './testData'
5
2
6
3
export const actionTypes = {
7
4
PROJECT_ADDED : 'PROJECT_ADDED' ,
@@ -29,8 +26,7 @@ export const actions = {
29
26
projectId,
30
27
note : {
31
28
id : noteId ,
32
- userName : currentUser . userName ,
33
- avatar : currentUser . avatar ,
29
+ ...currentUser ,
34
30
editTime : new Date ( ) . toDateString ( ) ,
35
31
text
36
32
}
@@ -43,8 +39,7 @@ export const actions = {
43
39
projectId,
44
40
note : {
45
41
id : noteId ,
46
- userName : currentUser . userName ,
47
- avatar : currentUser . avatar ,
42
+ ...currentUser ,
48
43
editTime : new Date ( ) . toDateString ( ) ,
49
44
text
50
45
}
Original file line number Diff line number Diff line change 1
1
import { createStore } from 'redux'
2
2
import { reducer } from './reducer'
3
-
4
- const avatar_2 = require ( '../images/avatar_2.jpg' )
5
- const avatar_3 = require ( '../images/avatar_3.jpg' )
6
-
7
- export const initialState = {
8
- projects : [
9
- {
10
- id : 'project_1' ,
11
- name : 'Project #1' ,
12
- notes : [
13
- {
14
- id : '1' ,
15
- userName : 'Alex' ,
16
- avatar : avatar_2 ,
17
- editTime : '11-11-2011' ,
18
- text : 'Some text here'
19
- } ,
20
- {
21
- id : '2' ,
22
- userName : 'Alex' ,
23
- avatar : avatar_3 ,
24
- editTime : '11-11-2011' ,
25
- text : 'Test \n\n text \n\n here'
26
- } ,
27
- {
28
- id : '3' ,
29
- userName : 'Alex' ,
30
- avatar : avatar_2 ,
31
- editTime : '11-11-2011' ,
32
- text : 'Test text Test textTest textTest textTest textTest textTest textTest textTest textTest textTest text'
33
- }
34
- ]
35
- } ,
36
- {
37
- id : 'project_2' ,
38
- name : 'Second Project' ,
39
- notes : [
40
- {
41
- id : '1' ,
42
- userName : 'Alex' ,
43
- avatar : avatar_3 ,
44
- editTime : '11-11-2011' ,
45
- text : 'asdfdasfsadf sadfsadf asdfsad sadfas'
46
- }
47
- ]
48
- }
49
- ]
50
- }
51
-
3
+ import { initialState } from './testData'
52
4
53
5
export const store = createStore ( reducer , initialState )
Original file line number Diff line number Diff line change
1
+ const avatar_1 = require ( '../images/avatar_1.jpg' )
2
+ const avatar_2 = require ( '../images/avatar_2.jpg' )
3
+ const avatar_3 = require ( '../images/avatar_3.jpg' )
4
+
5
+ const user_1 = {
6
+ userName : 'Мурзик' ,
7
+ avatar : avatar_2
8
+ }
9
+
10
+ const user_2 = {
11
+ userName : 'Томас' ,
12
+ avatar : avatar_3
13
+ }
14
+
15
+ export const currentUser = {
16
+ userName : 'Корнелиус' ,
17
+ avatar : avatar_1
18
+ }
19
+
20
+ export const initialState = {
21
+ projects : [
22
+ {
23
+ id : 'project_1' ,
24
+ name : 'Первый тестовый проект' ,
25
+ notes : [
26
+ {
27
+ id : '1' ,
28
+ ...user_2 ,
29
+ editTime : 'Mon Aug 27 2018' ,
30
+ text : 'Тестирую возможности приложения'
31
+ }
32
+ ]
33
+ } ,
34
+ {
35
+ id : 'project_2' ,
36
+ name : 'Кража сосиски' ,
37
+ notes : [
38
+ {
39
+ id : '1' ,
40
+ ...user_1 ,
41
+ editTime : 'Sat Aug 25 2018' ,
42
+ text : 'Активные действия беру на себя!'
43
+ } ,
44
+ {
45
+ id : '2' ,
46
+ ...user_2 ,
47
+ editTime : 'Sun Aug 26 2018' ,
48
+ text : 'Я отвлеку хозяина'
49
+ } ,
50
+ {
51
+ id : '3' ,
52
+ ...currentUser ,
53
+ editTime : 'Mon Aug 27 2018' ,
54
+ text : 'Парни, в этот раз без меня. Я пока отлежусь. Позовите, если у вас все получится'
55
+ }
56
+ ]
57
+ }
58
+ ]
59
+ }
You can’t perform that action at this time.
0 commit comments