All files DefaultToolTip.jsx

9.09% Statements 1/11
0% Branches 0/8
0% Functions 0/3
9.09% Lines 1/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52                                                                                                1x      
import React from 'react';
 
class DefaultToolTip extends React.Component {
	render() {
		const { count, step, end, prevStep, nextStep, goToStepNumber } = this.props;
		const prevProps = {
			onClick: prevStep,
		}
		if (step === 1) {
			prevProps.disabled = 'disabled'
		}
		const nextProps = {
			onClick: nextStep,
		}
		if (step === count) {
			nextProps.onClick = end;
		}
		return <div>detault tips
			<div>
				<ul style={{
					listStyle: 'none',
					display: 'flex',
					textAlign: 'center',
					width: '50%',
					margin: '10px auto'
				}}>
					{new Array(count).fill(0).map((v, index) => {
						return <li
							key={index}
							onClick={() => goToStepNumber(index + 1)}
							style={{
								margin: '0 5px',
								cursor: 'pointer',
								width: '5px', 'height': '5px', borderRadius: '50%',
								background: step === (index + 1) ? '#333' : '#eee',
							}}>
 
						</li>
					})}
				</ul>
				<button onClick={end}>skip</button>
				<button {...prevProps}>previous</button>
				<button {...nextProps}>{step === count ? 'end' : 'next'}</button>
			</div>
		</div>;
	}
}
 
DefaultToolTip.propTypes = {};
 
export default DefaultToolTip;