aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-04 05:08:08 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-04 05:08:08 +0800
commit700b7068a157a0f9d3d6ce3f61150c2961d81617 (patch)
tree3e8d7df053ef2f3285bbcc5e45f2855a7853ee9b
parentbce43a0050056195acb9c4890f57526985268da9 (diff)
downloaddexon-0x-contracts-700b7068a157a0f9d3d6ce3f61150c2961d81617.tar.gz
dexon-0x-contracts-700b7068a157a0f9d3d6ce3f61150c2961d81617.tar.zst
dexon-0x-contracts-700b7068a157a0f9d3d6ce3f61150c2961d81617.zip
Add styled-components with theme
-rw-r--r--packages/instant/package.json5
-rw-r--r--packages/instant/src/components/zero_ex_instant.tsx8
-rw-r--r--packages/instant/src/style/theme.ts27
-rw-r--r--yarn.lock32
4 files changed, 70 insertions, 2 deletions
diff --git a/packages/instant/package.json b/packages/instant/package.json
index 365312a70..9f97b1caa 100644
--- a/packages/instant/package.json
+++ b/packages/instant/package.json
@@ -51,7 +51,10 @@
"ethereum-types": "^1.0.8",
"lodash": "^4.17.10",
"react": "^16.5.2",
- "react-dom": "^16.5.2"
+ "react-dom": "^16.5.2",
+ "react-redux": "^5.0.7",
+ "redux": "^4.0.0",
+ "styled-components": "^3.4.9"
},
"devDependencies": {
"@0xproject/tslint-config": "^1.0.7",
diff --git a/packages/instant/src/components/zero_ex_instant.tsx b/packages/instant/src/components/zero_ex_instant.tsx
index 67e1b683d..43398cf3b 100644
--- a/packages/instant/src/components/zero_ex_instant.tsx
+++ b/packages/instant/src/components/zero_ex_instant.tsx
@@ -1,5 +1,11 @@
import * as React from 'react';
+import { ThemeProvider } from '../style/theme';
+
export interface ZeroExInstantProps {}
-export const ZeroExInstant: React.StatelessComponent<ZeroExInstantProps> = () => <div>ZeroExInstant</div>;
+export const ZeroExInstant: React.StatelessComponent<ZeroExInstantProps> = () => (
+ <ThemeProvider>
+ <div> ZeroExInstant </div>
+ </ThemeProvider>
+);
diff --git a/packages/instant/src/style/theme.ts b/packages/instant/src/style/theme.ts
new file mode 100644
index 000000000..838378c99
--- /dev/null
+++ b/packages/instant/src/style/theme.ts
@@ -0,0 +1,27 @@
+import * as styledComponents from 'styled-components';
+
+const {
+ default: styled,
+ css,
+ injectGlobal,
+ keyframes,
+ ThemeProvider,
+} = styledComponents as styledComponents.ThemedStyledComponentsModule<IThemeInterface>;
+
+export interface IThemeInterface {
+ primaryColor: string;
+ black: string;
+ white: string;
+ darkGrey: string;
+ lightGrey: string;
+}
+
+export const theme: IThemeInterface = {
+ primaryColor: '#512D80',
+ black: 'black',
+ lightGrey: '#999999',
+ darkGrey: '#333333',
+ white: 'white',
+};
+
+export { styled, css, injectGlobal, keyframes, ThemeProvider };
diff --git a/yarn.lock b/yarn.lock
index b0449b654..eb17d9da9 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -12742,6 +12742,17 @@ react-redux@^5.0.3:
loose-envify "^1.1.0"
prop-types "^15.6.0"
+react-redux@^5.0.7:
+ version "5.0.7"
+ resolved "http://localhost:4873/react-redux/-/react-redux-5.0.7.tgz#0dc1076d9afb4670f993ffaef44b8f8c1155a4c8"
+ dependencies:
+ hoist-non-react-statics "^2.5.0"
+ invariant "^2.0.0"
+ lodash "^4.17.5"
+ lodash-es "^4.17.5"
+ loose-envify "^1.1.0"
+ prop-types "^15.6.0"
+
react-router-dom@^4.1.1:
version "4.2.2"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.2.2.tgz#c8a81df3adc58bba8a76782e946cbd4eae649b8d"
@@ -13126,6 +13137,13 @@ redux@^3.6.0:
loose-envify "^1.1.0"
symbol-observable "^1.0.3"
+redux@^4.0.0:
+ version "4.0.0"
+ resolved "http://localhost:4873/redux/-/redux-4.0.0.tgz#aa698a92b729315d22b34a0553d7e6533555cc03"
+ dependencies:
+ loose-envify "^1.1.0"
+ symbol-observable "^1.2.0"
+
regenerate@^1.2.1:
version "1.3.3"
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f"
@@ -14711,6 +14729,20 @@ styled-components@^3.3.3:
stylis-rule-sheet "^0.0.10"
supports-color "^3.2.3"
+styled-components@^3.4.9:
+ version "3.4.9"
+ resolved "http://localhost:4873/styled-components/-/styled-components-3.4.9.tgz#519abeb351b37be5b7de6a15ff9e4efeb9d772da"
+ dependencies:
+ buffer "^5.0.3"
+ css-to-react-native "^2.0.3"
+ fbjs "^0.8.16"
+ hoist-non-react-statics "^2.5.0"
+ prop-types "^15.5.4"
+ react-is "^16.3.1"
+ stylis "^3.5.0"
+ stylis-rule-sheet "^0.0.10"
+ supports-color "^3.2.3"
+
stylis-rule-sheet@^0.0.10:
version "0.0.10"
resolved "https://registry.npmjs.org/stylis-rule-sheet/-/stylis-rule-sheet-0.0.10.tgz#44e64a2b076643f4b52e5ff71efc04d8c3c4a430"