-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
197 changed files
with
5,910 additions
and
6,253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
module.exports = { | ||
parser: "@typescript-eslint/parser", | ||
|
||
extends: [ | ||
"plugin:react/recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier/@typescript-eslint", | ||
"plugin:prettier/recommended", | ||
], | ||
|
||
parserOptions: { | ||
ecmaVersion: 2020, | ||
sourceType: "module", | ||
project: "./tsconfig.build.json", | ||
tsconfigRootDir: "./", | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
|
||
rules: { | ||
"react/display-name": "off", | ||
"react/prop-types": "off", | ||
|
||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/explicit-function-return-type": "off", | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
"@typescript-eslint/no-use-before-define": "off", | ||
|
||
// For the next couple of months ;) | ||
"@typescript-eslint/no-empty-function": "off", | ||
}, | ||
|
||
settings: { | ||
react: { | ||
version: "detect", | ||
}, | ||
"import/resolver": { | ||
node: { | ||
extensions: [ | ||
".js", | ||
".jsx", | ||
".ts", | ||
".tsx", | ||
], | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
semi: true, | ||
trailingComma: 'all', | ||
singleQuote: false, | ||
printWidth: 80, | ||
arrowParens: 'always', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from "react"; | ||
import { shallow } from "enzyme"; | ||
|
||
import AddButton from "."; | ||
|
||
it("renders correctly", () => { | ||
const tree = shallow(<AddButton onClick={() => {}} />); | ||
|
||
expect(tree).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from "react"; | ||
import { withStyles, Fab } from "@material-ui/core"; | ||
import AddIcon from "@material-ui/icons/Add"; | ||
|
||
const styles = (theme: any) => ({ | ||
button: { | ||
position: "fixed", | ||
right: theme.spacing(3), | ||
bottom: theme.spacing(3), | ||
}, | ||
}); | ||
|
||
type AddButtonProps = { | ||
onClick: (...args: any[]) => any; | ||
classes: { | ||
[key: string]: string; | ||
}; | ||
}; | ||
|
||
const AddButton: React.SFC<AddButtonProps> = ({ onClick, classes }) => ( | ||
<Fab | ||
color="secondary" | ||
aria-label="add" | ||
className={classes.button} | ||
onClick={onClick} | ||
> | ||
<AddIcon /> | ||
</Fab> | ||
); | ||
export default withStyles(styles as any)(AddButton); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import AddButton from "./AddButton"; | ||
|
||
export default AddButton; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from "react"; | ||
import { shallow } from "enzyme"; | ||
|
||
import AppContainer from "."; | ||
|
||
describe("Component Info", () => { | ||
it("renders correctly", () => { | ||
const tree = shallow(<AppContainer>Foo</AppContainer>); | ||
|
||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React, { ReactNode } from "react"; | ||
import { blueGrey, orange } from "@material-ui/core/colors"; | ||
import { withStyles, ThemeProvider } from "@material-ui/styles"; | ||
import { createMuiTheme } from "@material-ui/core"; | ||
|
||
const defaultTheme = { | ||
typography: { | ||
useNextVariants: true, | ||
}, | ||
palette: { | ||
primary: { | ||
light: blueGrey[300], | ||
main: blueGrey[500], | ||
dark: blueGrey[700], | ||
}, | ||
secondary: { | ||
light: orange[300], | ||
main: orange[500], | ||
dark: orange[700], | ||
}, | ||
}, | ||
}; | ||
|
||
type AppContainerProps = { | ||
theme?: { | ||
[key: string]: any; | ||
}; | ||
}; | ||
|
||
// Apply some reset | ||
const styles = (theme: any) => ({ | ||
"@global": { | ||
html: { | ||
background: theme.palette.background.default, | ||
WebkitFontSmoothing: "antialiased", // Antialiasing. | ||
MozOsxFontSmoothing: "grayscale", // Antialiasing. | ||
}, | ||
body: { | ||
margin: 0, | ||
}, | ||
}, | ||
}); | ||
|
||
const BaseComponent = withStyles(styles)((props) => props.children as any); | ||
const AppContainer: React.SFC<AppContainerProps> = ({ | ||
theme = defaultTheme, | ||
children, | ||
}) => { | ||
return ( | ||
<ThemeProvider theme={createMuiTheme(theme)}> | ||
<BaseComponent>{children}</BaseComponent> | ||
</ThemeProvider> | ||
); | ||
}; | ||
|
||
export default AppContainer; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import AppContainer from "./AppContainer"; | ||
|
||
export default AppContainer; |
Oops, something went wrong.