Skip to content

Commit 9c66764

Browse files
committed
style: spaces
1 parent e115640 commit 9c66764

File tree

2 files changed

+230
-230
lines changed

2 files changed

+230
-230
lines changed
Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,95 @@
11
import merge from 'lodash.merge';
2-
import React, { PureComponent } from 'react';
3-
import { getParams } from '../../utils';
4-
import { tsParticles } from 'tsparticles';
2+
import React, {PureComponent} from 'react';
3+
import {getParams} from '../../utils';
4+
import {tsParticles} from 'tsparticles';
55

66
interface ParticlesProps {
7-
/**
8-
* Determines wheter to render Particles
9-
*
10-
* @default "particles-js"
11-
*/
12-
id?: string;
13-
/**
14-
* Determines the configuration for Particles JS
15-
*/
16-
params: any;
17-
/**
18-
* Determines the styles for the Particles container
19-
*
20-
* @default {}
21-
*/
22-
style?: any;
23-
/**
24-
* Determines the width for the Particles container
25-
*
26-
* @default "auto"
27-
*/
28-
width?: string;
29-
/**
30-
* Determines the height for the Particles container
31-
*
32-
* @default "100vh"
33-
*/
34-
height?: string;
35-
/**
36-
* Determines a custom className to apply to Particles container
37-
*/
38-
className?: string;
39-
/**
40-
* Determines if should merge values from params with lib defaults
41-
*
42-
* @default true
43-
*/
44-
withDefaults?: boolean;
7+
/**
8+
* Determines wheter to render Particles
9+
*
10+
* @default "particles-js"
11+
*/
12+
id?: string;
13+
/**
14+
* Determines the configuration for Particles JS
15+
*/
16+
params: any;
17+
/**
18+
* Determines the styles for the Particles container
19+
*
20+
* @default {}
21+
*/
22+
style?: any;
23+
/**
24+
* Determines the width for the Particles container
25+
*
26+
* @default "auto"
27+
*/
28+
width?: string;
29+
/**
30+
* Determines the height for the Particles container
31+
*
32+
* @default "100vh"
33+
*/
34+
height?: string;
35+
/**
36+
* Determines a custom className to apply to Particles container
37+
*/
38+
className?: string;
39+
/**
40+
* Determines if should merge values from params with lib defaults
41+
*
42+
* @default true
43+
*/
44+
withDefaults?: boolean;
4545
}
4646

4747
export class Particles extends PureComponent<ParticlesProps> {
48-
static displayName = 'Particles';
48+
static displayName = 'Particles';
4949

50-
static defaultProps = {
51-
style: {},
52-
width: 'auto',
53-
height: '100vh',
54-
id: 'particles-js',
55-
withDefaults: true,
56-
};
50+
static defaultProps = {
51+
style: {},
52+
width: 'auto',
53+
height: '100vh',
54+
id: 'particles-js',
55+
withDefaults: true,
56+
};
5757

58-
componentDidMount() {
59-
tsParticles.load(this.props.id ?? "tsparticles", this.getParticles());
60-
}
58+
componentDidMount() {
59+
tsParticles.load(this.props.id ?? "tsparticles", this.getParticles());
60+
}
6161

62-
componentDidUpdate(prevProps: ParticlesProps) {
63-
tsParticles.load(this.props.id ?? "tsparticles", this.getParticles());
64-
}
62+
componentDidUpdate(prevProps: ParticlesProps) {
63+
tsParticles.load(this.props.id ?? "tsparticles", this.getParticles());
64+
}
6565

66-
componentWillUnmount() {
67-
tsParticles.dom().forEach((container) => container.destroy());
68-
}
66+
componentWillUnmount() {
67+
tsParticles.dom().forEach((container) => container.destroy());
68+
}
6969

70-
render() {
71-
const { className, style, width, height, id } = this.props;
70+
render() {
71+
const {className, style, width, height, id} = this.props;
7272

73-
return (
74-
<div
75-
id={ id }
76-
className={ className }
77-
style={ {
78-
...style,
79-
width: width,
80-
height: height,
81-
} }
82-
/>
83-
);
84-
}
73+
return (
74+
<div
75+
id={id}
76+
className={className}
77+
style={{
78+
...style,
79+
width: width,
80+
height: height,
81+
}}
82+
/>
83+
);
84+
}
8585

86-
getParticles = () => {
87-
if (this.props.withDefaults) {
88-
return merge({}, getParams(), this.props.params);
89-
} else {
90-
return this.props.params;
91-
}
92-
};
86+
getParticles = () => {
87+
if (this.props.withDefaults) {
88+
return merge({}, getParams(), this.props.params);
89+
} else {
90+
return this.props.params;
91+
}
92+
};
9393
}
9494

9595
export default Particles;

0 commit comments

Comments
 (0)