| 
									
										
										
										
											2019-01-30 12:15:07 -08:00
										 |  |  | import React from 'react'; | 
					
						
							|  |  |  | import classNames from 'classnames'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | interface Props { | 
					
						
							| 
									
										
										
										
											2019-06-26 12:33:13 -07:00
										 |  |  |   size?: string; | 
					
						
							|  |  |  |   svgSize: 'small' | 'normal'; | 
					
						
							| 
									
										
										
										
											2019-05-31 15:42:01 -07:00
										 |  |  |   direction?: 'outgoing' | 'incoming' | 'on-background'; | 
					
						
							| 
									
										
										
										
											2019-01-30 12:15:07 -08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export class Spinner extends React.Component<Props> { | 
					
						
							|  |  |  |   public render() { | 
					
						
							| 
									
										
										
										
											2019-06-26 12:33:13 -07:00
										 |  |  |     const { size, svgSize, direction } = this.props; | 
					
						
							| 
									
										
										
										
											2019-01-30 12:15:07 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     return ( | 
					
						
							|  |  |  |       <div | 
					
						
							|  |  |  |         className={classNames( | 
					
						
							|  |  |  |           'module-spinner__container', | 
					
						
							| 
									
										
										
										
											2019-06-26 12:33:13 -07:00
										 |  |  |           `module-spinner__container--${svgSize}`, | 
					
						
							| 
									
										
										
										
											2019-01-30 12:15:07 -08:00
										 |  |  |           direction ? `module-spinner__container--${direction}` : null, | 
					
						
							| 
									
										
										
										
											2019-06-26 12:33:13 -07:00
										 |  |  |           direction | 
					
						
							|  |  |  |             ? `module-spinner__container--${svgSize}-${direction}` | 
					
						
							|  |  |  |             : null | 
					
						
							| 
									
										
										
										
											2019-01-30 12:15:07 -08:00
										 |  |  |         )} | 
					
						
							| 
									
										
										
										
											2019-06-26 12:33:13 -07:00
										 |  |  |         style={{ | 
					
						
							|  |  |  |           height: size, | 
					
						
							|  |  |  |           width: size, | 
					
						
							|  |  |  |         }} | 
					
						
							| 
									
										
										
										
											2019-01-30 12:15:07 -08:00
										 |  |  |       > | 
					
						
							|  |  |  |         <div | 
					
						
							|  |  |  |           className={classNames( | 
					
						
							|  |  |  |             'module-spinner__circle', | 
					
						
							| 
									
										
										
										
											2019-06-26 12:33:13 -07:00
										 |  |  |             `module-spinner__circle--${svgSize}`, | 
					
						
							| 
									
										
										
										
											2019-01-30 12:15:07 -08:00
										 |  |  |             direction ? `module-spinner__circle--${direction}` : null, | 
					
						
							| 
									
										
										
										
											2019-06-26 12:33:13 -07:00
										 |  |  |             direction ? `module-spinner__circle--${svgSize}-${direction}` : null | 
					
						
							| 
									
										
										
										
											2019-01-30 12:15:07 -08:00
										 |  |  |           )} | 
					
						
							|  |  |  |         /> | 
					
						
							|  |  |  |         <div | 
					
						
							|  |  |  |           className={classNames( | 
					
						
							|  |  |  |             'module-spinner__arc', | 
					
						
							| 
									
										
										
										
											2019-06-26 12:33:13 -07:00
										 |  |  |             `module-spinner__arc--${svgSize}`, | 
					
						
							| 
									
										
										
										
											2019-01-30 12:15:07 -08:00
										 |  |  |             direction ? `module-spinner__arc--${direction}` : null, | 
					
						
							| 
									
										
										
										
											2019-06-26 12:33:13 -07:00
										 |  |  |             direction ? `module-spinner__arc--${svgSize}-${direction}` : null | 
					
						
							| 
									
										
										
										
											2019-01-30 12:15:07 -08:00
										 |  |  |           )} | 
					
						
							|  |  |  |         /> | 
					
						
							|  |  |  |       </div> | 
					
						
							|  |  |  |     ); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } |