-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add redux, react-testing-library
- Loading branch information
Showing
15 changed files
with
473 additions
and
246 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
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 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,53 @@ | ||
import React, { useState } from "react"; | ||
import styled from "styled-components"; | ||
|
||
// This is example of styled-components | ||
const Container = styled.main` | ||
min-height: 100vh; | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
`; | ||
|
||
// This is example of styled-components with TypeScript or you can make interface of props | ||
const Header = styled("header")<{ toggleState: boolean }>` | ||
background: linear-gradient(#eee, #333); | ||
-webkit-background-clip: text; | ||
color: ${({ toggleState }) => (toggleState ? "grey" : "black")} | ||
transition: 0.5s ease-in-out; | ||
font-size: 3rem; | ||
font-weight: 900; | ||
text-transform: uppercase; | ||
`; | ||
|
||
// This is example of react-hooks with TypeScript | ||
function useToggle(defaultValue: boolean) { | ||
const [toggleState, setToggleState] = useState(defaultValue); | ||
|
||
function onMouseOver() { | ||
setToggleState(true); | ||
} | ||
|
||
function onMouseOut() { | ||
setToggleState(false); | ||
} | ||
|
||
return { toggleState, onMouseOver, onMouseOut }; | ||
} | ||
|
||
function App() { | ||
const toggle = useToggle(false); | ||
return ( | ||
<Container className="App"> | ||
<Header {...toggle} className="App-header"> | ||
react, typescript, styled-components | ||
<br /> | ||
boilerplate | ||
</Header> | ||
</Container> | ||
); | ||
} | ||
|
||
export default App; |
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,5 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import App from "./App"; | ||
|
||
ReactDOM.render(<App />, document.getElementById("root")); |
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 @@ | ||
/// <reference types="react-scripts" /> |
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,45 @@ | ||
{ | ||
"compilerOptions": { | ||
"outDir": "build/dist", | ||
"module": "esnext", | ||
"target": "es2020", | ||
"lib": [ | ||
"es6", | ||
"es7", | ||
"dom", | ||
"es2017.object", | ||
"esnext.asynciterable", | ||
"es2016.array.include" | ||
], | ||
"typeRoots": ["./src/types/alltypes.d.ts", "../../node_modules/@types"], | ||
"sourceMap": true, | ||
"allowJs": true, | ||
"jsx": "preserve", | ||
"moduleResolution": "node", | ||
"rootDir": "src", | ||
"forceConsistentCasingInFileNames": true, | ||
"noImplicitReturns": true, | ||
"noImplicitThis": true, | ||
"noImplicitAny": true, | ||
"strictNullChecks": true, | ||
"suppressImplicitAnyIndexErrors": true, | ||
"noUnusedLocals": true, | ||
"allowSyntheticDefaultImports": true, | ||
"skipLibCheck": true, | ||
"esModuleInterop": true, | ||
"strict": true, | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
"build", | ||
"scripts", | ||
"acceptance-tests", | ||
"webpack", | ||
"jest", | ||
"src/setupTests.ts" | ||
], | ||
"include": ["src"] | ||
} |
Oops, something went wrong.