File tree Expand file tree Collapse file tree 3 files changed +26
-16
lines changed Expand file tree Collapse file tree 3 files changed +26
-16
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export default class AllResponsePreviews extends React.Component {
7
7
super ( props )
8
8
this . DBREF_STRING = "/joseSite/responses/"
9
9
10
- this . waitTime = 10000
10
+ this . waitTime = 10 * 1000
11
11
this . intervalID = ""
12
12
13
13
this . state = {
@@ -32,9 +32,13 @@ export default class AllResponsePreviews extends React.Component {
32
32
. ref ( this . DBREF_STRING )
33
33
. once ( "value" )
34
34
. then ( snapshot => {
35
- let dbValues = snapshot . val ( )
36
- dbValues = dbValues . filter ( function ( el ) {
37
- return el !== undefined
35
+ let dbObjects = snapshot . val ( )
36
+ let dbValues = [ ]
37
+ Object . keys ( dbObjects ) . forEach ( dbKey => {
38
+ let dbObject = dbObjects [ dbKey ]
39
+ if ( dbObject != undefined ) {
40
+ dbValues . push ( dbObject )
41
+ }
38
42
} )
39
43
dbValues . forEach ( response => {
40
44
response [ "randomLeftPos" ] = Math . random ( ) * 90
Original file line number Diff line number Diff line change @@ -18,16 +18,20 @@ export default class Responses extends React.Component {
18
18
. ref ( this . DBREF_STRING )
19
19
. once ( "value" )
20
20
. then ( snapshot => {
21
- let dbValues = snapshot . val ( )
22
- dbValues = dbValues . filter ( function ( el ) {
23
- return el !== undefined
21
+ let dbObjects = snapshot . val ( )
22
+ let dbValues = [ ]
23
+ Object . keys ( dbObjects ) . forEach ( dbKey => {
24
+ let dbObject = dbObjects [ dbKey ]
25
+ if ( dbObject != undefined ) {
26
+ dbValues . push ( dbObject )
27
+ }
24
28
} )
25
29
this . setState ( { firebaseDataList : dbValues } )
26
30
} )
27
31
}
28
32
renderResponses = ( ) => {
29
- return this . state . firebaseDataList . map ( response => (
30
- < div className = { `${ ResponseStyles . responseDetail } half` } >
33
+ return this . state . firebaseDataList . map ( ( response , index ) => (
34
+ < div className = { `${ ResponseStyles . responseDetail } half` } key = { index } >
31
35
< div className = { ResponseStyles . author } > { response . author } </ div >
32
36
< div className = { ResponseStyles . response } > { response . response } </ div >
33
37
</ div >
Original file line number Diff line number Diff line change 41
41
position : fixed;
42
42
bottom : 0px ;
43
43
font-size : 14px ;
44
- padding-bottom : 32px ;
44
+ padding-bottom : 16px ;
45
+ padding-top : 16px ;
45
46
z-index : 2 ;
47
+ background : var (--yellow );
48
+ box-shadow : 0px 0px 12px 10px var (--yellow );
46
49
}
47
50
48
- .button ,
49
51
.responsePreview {
50
52
background : var (--yellow );
51
53
box-shadow : 0px 0px 12px 10px var (--yellow );
52
54
cursor : pointer;
53
55
padding : 4px ;
54
56
}
55
57
58
+ .button {
59
+ cursor : pointer;
60
+ font-size : 18px ;
61
+ }
62
+
56
63
.button : hover ,
57
64
.responsePreview : hover ,
58
65
.expandedResponsePreview {
59
66
background : var (--lightYellow );
60
67
box-shadow : 0px 0px 12px 10px var (--lightYellow );
61
68
}
62
69
63
- .button {
64
- padding-top : 12px ;
65
- padding-bottom : 12px ;
66
- }
67
-
68
70
.add {
69
71
float : left;
70
72
}
You can’t perform that action at this time.
0 commit comments