Skip to content

Commit 56d0dc0

Browse files
authored
Merge pull request #340 from keep-network/scalio-master
[WIP] Scalio master
2 parents 069dd83 + 5c934c5 commit 56d0dc0

File tree

160 files changed

+27916
-12336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+27916
-12336
lines changed

.eslintrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@
1010
},
1111
"rules": {
1212
// Fixes eslint no-invalid-this error for fat arrow class methods
13-
"no-invalid-this": 0
13+
"no-invalid-this": 0,
14+
"prettier/prettier": [
15+
"error",
16+
{
17+
"endOfLine": "auto"
18+
}
19+
]
1420
},
1521
"settings": {
1622
"react": {

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"semi": false,
3+
"tabWidth": 2
4+
}

jest.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* For a detailed explanation regarding each configuration property, visit:
3+
* https://jestjs.io/docs/en/configuration.html
4+
*/
5+
6+
module.exports = {
7+
testEnvironment: "node",
8+
testRegex: "(src/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$",
9+
}

package-lock.json

Lines changed: 16074 additions & 9644 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
"version": "0.1.0",
55
"private": true,
66
"dependencies": {
7+
"aos": "^2.3.4",
78
"axios": "^0.21.1",
9+
"bignumber.js": "^9.0.1",
810
"bootstrap-css-only": "^4.4.1",
911
"bulma": "^0.8.0",
12+
"ethers": "^5.1.4",
1013
"gatsby": "^2.13.31",
1114
"gatsby-image": "^2.0.23",
1215
"gatsby-plugin-favicon": "^3.1.6",
@@ -22,6 +25,7 @@
2225
"gatsby-source-filesystem": "^2.0.26",
2326
"gatsby-transformer-remark": "^2.6.9",
2427
"gatsby-transformer-sharp": "^2.1.9",
28+
"jest": "^26.6.3",
2529
"lodash": "^4.17.19",
2630
"lodash-webpack-plugin": "^0.11.4",
2731
"netlify-cms-app": "^2.9.6",
@@ -33,6 +37,7 @@
3337
"react-helmet": "^5.2.0",
3438
"react-redux": "^7.2.0",
3539
"react-scroll": "^1.7.16",
40+
"react-ticker": "^1.2.2",
3641
"reactstrap": "^8.4.1",
3742
"redux": "^4.0.5",
3843
"redux-devtools-extension": "^2.13.8",
@@ -53,7 +58,7 @@
5358
"build:prefixed": "npm run clean && gatsby build --prefix-paths",
5459
"develop": "npm run clean && gatsby develop",
5560
"format": "prettier --trailing-comma es5 --no-semi --single-quote --write \"{gatsby-*.js,src/**/*.js}\"",
56-
"test": "echo \"Error: no test specified\" && exit 1",
61+
"test": "jest",
5762
"lint": "eslint src/ gatsby-*.js",
5863
"lint:fix": "eslint --fix src/ gatsby-*.js"
5964
},
@@ -63,7 +68,10 @@
6368
"not op_mini all"
6469
],
6570
"devDependencies": {
71+
"@babel/core": "^7.14.3",
72+
"@babel/preset-env": "^7.14.2",
6673
"babel-eslint": "^10.1.0",
74+
"babel-jest": "^26.6.3",
6775
"eslint": "^6.8.0",
6876
"eslint-config-keep": "git+https://github.com/keep-network/eslint-config-keep.git#0.3.0",
6977
"eslint-plugin-react": "^7.19.0",

src/components/Button.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import React from "react"
2+
import classNames from "classnames"
3+
import PropTypes from "prop-types"
4+
import Link from "./Link"
5+
6+
const Button = ({ className, label, url, onClick }) => {
7+
return url ? (
8+
<Link url={url} className={classNames(["btn", className])}>
9+
{label}
10+
</Link>
11+
) : (
12+
<button className={classNames(["btn", className])} onClick={onClick}>
13+
{label}
14+
</button>
15+
)
16+
}
17+
18+
Button.propTypes = {
19+
className: PropTypes.string,
20+
label: PropTypes.string,
21+
url: PropTypes.string,
22+
onClick: PropTypes.func,
23+
}
24+
25+
Button.defaultProps = {
26+
className: "",
27+
label: "",
28+
url: "",
29+
onClick: null,
30+
}
31+
32+
export default Button

src/components/CollapsibleList.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import React, { useState } from "react"
22
import { Button, Collapse } from "reactstrap"
3+
import { Image } from "../components"
34
import PropTypes from "prop-types"
45
import classNames from "classnames"
56

6-
import { ArrowDown } from "./Icons"
7-
8-
const CollapsibleList = ({ label, children, className = "" }) => {
7+
const CollapsibleList = ({ label, children, className = "", plusIcon }) => {
98
const [isOpen, setIsOpen] = useState(false)
109
const toggleOpen = () => setIsOpen(!isOpen)
1110

@@ -15,7 +14,8 @@ const CollapsibleList = ({ label, children, className = "" }) => {
1514
>
1615
<div className="collapsible-list-label">
1716
<Button onClick={toggleOpen}>
18-
<span>{label}</span> <ArrowDown />
17+
<span>{label}</span>
18+
{plusIcon && <Image imageData={plusIcon} className="icon" />}
1919
</Button>
2020
</div>
2121
<Collapse isOpen={isOpen}>{children}</Collapse>
@@ -30,6 +30,7 @@ CollapsibleList.propTypes = {
3030
PropTypes.node,
3131
]),
3232
className: PropTypes.string,
33+
plusIcon: PropTypes.object,
3334
}
3435

3536
export default CollapsibleList

src/components/Contact.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import React from "react"
2+
import PropTypes from "prop-types"
3+
4+
import Button from "./Button"
5+
import EmailForm from "./EmailForm"
6+
import Image from "./Image"
7+
import { actionTypes } from "../redux"
8+
9+
const Card = ({ icon, title, body, link }) => {
10+
return (
11+
<div className="contact-card">
12+
<div className="contact-icon-sm">
13+
<Image imageData={icon} />
14+
</div>
15+
<div className="contact-card-content">
16+
<div className="contact-card-title">
17+
<div className="contact-icon-xs">
18+
<Image imageData={icon} />
19+
</div>
20+
<h4>{title}</h4>
21+
</div>
22+
<p className="description">{body}</p>
23+
<Button className="btn-primary" label={link.name} url={link.url} />
24+
</div>
25+
</div>
26+
)
27+
}
28+
29+
Card.propTypes = {
30+
title: PropTypes.string,
31+
body: PropTypes.string,
32+
link: PropTypes.object,
33+
icon: PropTypes.object,
34+
}
35+
36+
const Contact = ({
37+
title,
38+
header,
39+
description,
40+
cards,
41+
signupMailingList,
42+
ajaxRequestStates,
43+
}) => {
44+
return (
45+
<>
46+
<h1>{title}</h1>
47+
<EmailForm
48+
label="Email"
49+
placeholder="Enter email address"
50+
onSubmit={signupMailingList}
51+
requestStates={ajaxRequestStates}
52+
request={actionTypes.SIGNUP_MAILING_LIST}
53+
>
54+
<h4>{header}</h4>
55+
<p className="description">{description}</p>
56+
</EmailForm>
57+
<div className="contact-cards">
58+
{cards &&
59+
cards.map((card, index) => (
60+
<Card key={`contact-card-${index}`} {...card} />
61+
))}
62+
</div>
63+
</>
64+
)
65+
}
66+
67+
Contact.propTypes = {
68+
title: PropTypes.string,
69+
header: PropTypes.string,
70+
description: PropTypes.string,
71+
cards: PropTypes.array,
72+
signupMailingList: PropTypes.func,
73+
ajaxRequestStates: PropTypes.object,
74+
}
75+
76+
export default Contact

src/components/EmailForm.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,10 @@ class EmailForm extends Component {
125125
e.preventDefault()
126126
}}
127127
>
128-
<FormGroup>
128+
<FormGroup className="col-md-12 px-0 pr-xs-2">
129129
<Label style={{ display: "none" }}>{label}</Label>
130130
<Input
131+
className="form-group-input"
131132
type="email"
132133
value={email}
133134
placeholder={placeholder}
@@ -140,6 +141,7 @@ class EmailForm extends Component {
140141
onClick={this.onClick}
141142
>
142143
<ArrowRightLong />
144+
<span className="button-text">Subscribe</span>
143145
</SubmitButton>
144146
</Form>
145147
{hasError && <small className="error-message">{errorMsg}</small>}

src/components/FeatureCard.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import React from "react"
2+
import PropTypes from "prop-types"
3+
import {
4+
Card,
5+
CardImg,
6+
CardText,
7+
CardBody,
8+
CardTitle,
9+
CardSubtitle,
10+
} from "reactstrap"
11+
import { withPrefix } from "gatsby"
12+
13+
import Button from "./Button"
14+
15+
const FeatureCard = ({
16+
className,
17+
bodyClass,
18+
btnClass,
19+
image,
20+
icon,
21+
title,
22+
subtitle,
23+
text,
24+
button,
25+
}) => {
26+
return (
27+
<Card className={className}>
28+
<CardImg
29+
top
30+
src={withPrefix(image || icon)}
31+
alt={title}
32+
className={icon ? "card-icon" : "card-image"}
33+
/>
34+
<CardBody className={bodyClass}>
35+
<CardTitle tag="h5">{title}</CardTitle>
36+
{subtitle && <CardSubtitle tag="h5">{subtitle}</CardSubtitle>}
37+
{text && <CardText>{text}</CardText>}
38+
{button && (
39+
<Button {...button} className={btnClass} onClick={(e) => {}} />
40+
)}
41+
</CardBody>
42+
</Card>
43+
)
44+
}
45+
46+
FeatureCard.propTypes = {
47+
className: PropTypes.string,
48+
bodyClass: PropTypes.string,
49+
btnClass: PropTypes.string,
50+
image: PropTypes.string,
51+
icon: PropTypes.string,
52+
title: PropTypes.string,
53+
subtitle: PropTypes.string,
54+
text: PropTypes.string,
55+
button: PropTypes.object,
56+
}
57+
58+
export default FeatureCard

0 commit comments

Comments
 (0)