Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit 2c0c6b2

Browse files
author
george
committed
Merge branch 'develop'
2 parents d2db358 + 7bb7bfe commit 2c0c6b2

File tree

3 files changed

+13
-39
lines changed

3 files changed

+13
-39
lines changed

app/pages/Home/Home.js

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,18 @@ import { downloadPath, introductionPath } from "app/routes"
1111

1212
import pkg from "projectRoot/package.json"
1313
import { StatusBadges, InstallNpm, InstallAssets } from "./markdownContent"
14+
import { ANIMATION_DATA } from "./animations"
1415

1516
import "./styles.scss"
1617

1718
export default class Home extends React.Component {
18-
ANIMATION_DATA = [
19-
{
20-
title: "Tiny",
21-
subtitle:
22-
"CSS and JS under 12kb minified + gzipped; you can be assured performance isn’t an issue.",
23-
animation: null,
24-
},
25-
{
26-
title: "Modular",
27-
subtitle:
28-
"Include only the pieces you need, or even namespace the components for existing projects.",
29-
animation: null,
30-
},
31-
{
32-
title: "Configurable",
33-
subtitle:
34-
"Built for a great developer experience, you can customize and extend the library with ease.",
35-
animation: null,
36-
},
37-
{
38-
title: "Accessible",
39-
subtitle:
40-
"Interactive components are designed with WAI-ARIA guidelines in mind to ensure your HTML is accessible.",
41-
animation: null,
42-
},
43-
]
44-
4519
componentDidMount() {
4620
Prism.highlightAll()
4721
this.loadAnimations()
4822
}
4923

5024
loadAnimations() {
51-
this.ANIMATION_DATA.forEach(data => {
25+
ANIMATION_DATA.forEach(data => {
5226
const name = data.title.toLowerCase()
5327

5428
const loadedAnimation = lottie.loadAnimation({
@@ -64,28 +38,24 @@ export default class Home extends React.Component {
6438
})
6539

6640
window.setTimeout(() => {
67-
this.ANIMATION_DATA.forEach(lottieInstance => lottieInstance.animation.play())
41+
ANIMATION_DATA.forEach(instance => instance.animation.play())
6842
}, 1500)
6943
}
7044

7145
componentWillUnmount() {
72-
this.ANIMATION_DATA.forEach(lottieInstance => lottieInstance.animation.destroy())
73-
}
74-
75-
renderAnimatedIcon(name) {
76-
return <div className="animated-icon" id={`animated-${name}`} />
46+
ANIMATION_DATA.forEach(instance => instance.animation.destroy())
7747
}
7848

7949
renderAnimations() {
80-
return this.ANIMATION_DATA.map(animation => {
50+
return ANIMATION_DATA.map(animation => {
8151
const animationName = animation.title.toLowerCase()
8252

8353
return (
8454
<li
8555
className="large-3 small-6 xsmall-12 columns has-center-text has-no-padding-bottom"
8656
key={animation.title}
8757
>
88-
{this.renderAnimatedIcon(animationName)}
58+
<div className="animated-icon" id={`animated-${animationName}`} />
8959
<h2 className="h6 has-white-text">{animation.title}</h2>
9060
<p className="has-white-text">{animation.subtitle}</p>
9161
</li>

app/pages/Home/__tests__/__snapshots__/Home.spec.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ exports[`<Home /> renders 1`] = `
174174
<p
175175
className="has-white-text"
176176
>
177-
CSS and JS under 12kb minified + gzipped; you can be assured performance isn’t an issue.
177+
CSS and JS under 14kb minified + gzipped; you can be assured performance isn’t an issue.
178178
</p>
179179
</li>
180180
<li
@@ -193,7 +193,7 @@ exports[`<Home /> renders 1`] = `
193193
<p
194194
className="has-white-text"
195195
>
196-
Include only the pieces you need, or even namespace the components for existing projects.
196+
Remove and namespace pieces of the framework to prevent collisions and take only what you need.
197197
</p>
198198
</li>
199199
<li

app/pages/Home/animations.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1-
export default [
1+
export const ANIMATION_DATA = [
22
{
33
title: "Tiny",
44
subtitle:
55
"CSS and JS under 14kb minified + gzipped; you can be assured performance isn’t an issue.",
6+
animation: null,
67
},
78
{
89
title: "Modular",
910
subtitle:
1011
"Remove and namespace pieces of the framework to prevent collisions and take only what you need.",
12+
animation: null,
1113
},
1214
{
1315
title: "Configurable",
1416
subtitle:
1517
"Built for a great developer experience, you can customize and extend the library with ease.",
18+
animation: null,
1619
},
1720
{
1821
title: "Accessible",
1922
subtitle:
2023
"Interactive components are designed with WAI-ARIA guidelines in mind to ensure your HTML is accessible.",
24+
animation: null,
2125
},
2226
]

0 commit comments

Comments
 (0)