@@ -17,12 +17,12 @@ import {
17
17
import CircularProgress from '@material-ui/core/CircularProgress' ;
18
18
import styles from "./styles/DataView360.module.css" ;
19
19
import _ from 'lodash' ;
20
-
21
20
import SearchBar from './components/SearchBar' ;
22
21
import ContactInfo from './components/ContactInfo' ;
23
22
import Volunteer from './components/Volunteer' ;
24
23
import Donations from './components/Donations' ;
25
24
import Adoptions from './components/Adoptions' ;
25
+ import { formatPhoneNumber } from "../../utils/utils" ;
26
26
27
27
28
28
const customStyles = theme => ( {
@@ -87,8 +87,8 @@ class DataView360 extends Component {
87
87
response = await response . json ( ) ;
88
88
89
89
this . setState ( {
90
- participantData : response . result ,
91
- isDataBusy : false ,
90
+ participantData : response . result ,
91
+ isDataBusy : false ,
92
92
showParticipant : true ,
93
93
showTable : false ,
94
94
showSearchBar : false
@@ -126,13 +126,13 @@ class DataView360 extends Component {
126
126
_ . map ( participantListGrouped , ( row_group , index ) => {
127
127
return _ . map ( row_group , ( row , idx ) => {
128
128
return < TableRow key = { `${ row . source_id } ${ idx } ` }
129
- className = { tableRowColors [ index % _ . size ( tableRowColors ) ] }
130
- onClick = { ( ) => this . handleGetParticipant ( row . matching_id ) } >
129
+ className = { tableRowColors [ index % _ . size ( tableRowColors ) ] }
130
+ onClick = { ( ) => this . handleGetParticipant ( row . matching_id ) } >
131
131
< TableCell align = "left" > { row . matching_id } </ TableCell >
132
132
< TableCell align = "left" > { row . first_name } </ TableCell >
133
133
< TableCell align = "left" > { row . last_name } </ TableCell >
134
134
< TableCell align = "left" > { row . email } </ TableCell >
135
- < TableCell align = "left" > { row . mobile } </ TableCell >
135
+ < TableCell align = "left" > { formatPhoneNumber ( row . mobile ) } </ TableCell >
136
136
< TableCell align = "left" > { row . source_type } </ TableCell >
137
137
< TableCell align = "left" > { row . source_id } </ TableCell >
138
138
</ TableRow >
@@ -157,7 +157,7 @@ class DataView360 extends Component {
157
157
158
158
this . state . participantTable = this . renderParticipantsTable ( ) ;
159
159
this . setState ( {
160
- isDataBusy : false ,
160
+ isDataBusy : false ,
161
161
showParticipant : false ,
162
162
showTable : true
163
163
} ) ;
@@ -167,33 +167,37 @@ class DataView360 extends Component {
167
167
const { classes} = this . props ;
168
168
return (
169
169
< Container >
170
- { this . state . showSearchBar &&
170
+ { this . state . showSearchBar &&
171
171
( < SearchBar participant = { this . state . participant }
172
- handleParticipantChange = { this . handleGetParticipant }
173
- handleSearchChange = { this . handleSearchChange } />
172
+ handleParticipantChange = { this . handleGetParticipant }
173
+ handleSearchChange = { this . handleSearchChange } />
174
174
) }
175
- { ( _ . isEmpty ( this . state . participantTable ) !== true &&
176
- this . state . isDataBusy !== true &&
177
- this . state . showTable === true &&
178
- this . state . showParticipant === false ) && (
175
+ { ( _ . isEmpty ( this . state . participantTable ) !== true &&
176
+ this . state . isDataBusy !== true &&
177
+ this . state . showTable === true &&
178
+ this . state . showParticipant === false ) && (
179
179
< Container className = { styles . main } elevation = { 1 } style = { { "padding" : "1em" } } >
180
180
{ this . state . participantTable }
181
181
</ Container >
182
182
) }
183
- { ( _ . isEmpty ( this . state . participantData ) !== true &&
184
- this . state . isDataBusy !== true &&
185
- this . state . showParticipant === true ) && (
183
+ { ( _ . isEmpty ( this . state . participantData ) !== true &&
184
+ this . state . isDataBusy !== true &&
185
+ this . state . showParticipant === true ) && (
186
186
< Paper className = { styles . main } elevation = { 1 } style = { { "padding" : "1em" } } >
187
187
< ContactInfo participant = { _ . get ( this . state , 'participantData.contact_details' ) } />
188
- < Grid container direction = "row" justify = "center" >
189
- < Grid item style = { { "marginTop" : "1em" , "position" : "fixed" } } >
190
- < Button variant = "contained" color = "primary"
191
- onClick = { ( ) => {
192
- this . setState ( { showParticipant : false , showTable : true , showSearchBar : true } )
188
+ < Grid container direction = "row" justify = "center" >
189
+ < Grid item style = { { "marginTop" : "1em" , "position" : "fixed" } } >
190
+ < Button variant = "contained" color = "primary"
191
+ onClick = { ( ) => {
192
+ this . setState ( {
193
+ showParticipant : false ,
194
+ showTable : true ,
195
+ showSearchBar : true
196
+ } )
193
197
} } > Back to Results
194
- </ Button >
195
- </ Grid >
198
+ </ Button >
196
199
</ Grid >
200
+ </ Grid >
197
201
< Donations donations = { _ . get ( this . state , 'participantData.donations' ) } />
198
202
< Adoptions adoptions = { _ . get ( this . state , 'participantData.adoptions' ) } />
199
203
< Volunteer volunteer = { _ . get ( this . state , 'participantData.shifts' ) }
0 commit comments