Skip to content

Commit

Permalink
Merge branch 'refacto-dojo'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Hohler committed May 24, 2018
2 parents 3277c73 + 7042bbb commit 951b04e
Show file tree
Hide file tree
Showing 27 changed files with 977 additions and 255 deletions.
154 changes: 138 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"lint": "tslint --project ."
},
"devDependencies": {
"@types/react": "^16.3.14",
"@types/react-dom": "^16.0.5",
"awesome-typescript-loader": "^3.4.1",
"babel-core": "^6.26.0",
"html-webpack-plugin": "^2.30.1",
Expand All @@ -25,5 +27,8 @@
],
"author": "Maniae",
"license": "ISC",
"dependencies": {}
"dependencies": {
"react": "^16.3.2",
"react-dom": "^16.3.2"
}
}
25 changes: 25 additions & 0 deletions src/demos/common/button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as React from "react";
import { CssStyleSheet } from "./cssStyleSheet";

interface ButtonProps {
onClick?: () => void;
style?: React.CSSProperties;
children?: React.ReactNode ;
}
export const Button = (props: ButtonProps) => (
<button style={{...styles.button, ...props.style}} {...props}>{props.children}</button>
);

const styles: CssStyleSheet = {
button: {
display: "flex",
justifyContent: "center",
alignItems: "center",
fontSize: 18,
padding: "10px 20px",
background: "white",
borderRadius: "10px",
borderColor: "#f0f0f0",
cursor: "pointer"
}
};
3 changes: 3 additions & 0 deletions src/demos/common/cssStyleSheet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface CssStyleSheet {
[key: string]: React.CSSProperties;
}
33 changes: 33 additions & 0 deletions src/demos/common/statistic.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import * as React from "react";
import { CssStyleSheet } from "./cssStyleSheet";

interface StatisticProps {
title: string;
value: string | number;
color?: string;
style?: React.CSSProperties;
}
export const Statistic = (props: StatisticProps) => (
<div style={{...styles.statistic, ...props.style}}>
<div style={{...styles.value, color: props.color}}>
{props.value}
</div>
<div style={styles.title}>
{props.title}
</div>
</div>
);

const styles: CssStyleSheet = {
statistic: {
display: "flex",
flexDirection: "column",
alignItems: "center"
},
value: {
fontSize: 28
},
title: {
fontSize: 18
}
};
Loading

0 comments on commit 951b04e

Please sign in to comment.