├── @test ├── config │ ├── fileMock.js │ ├── setupTests.js │ └── componentsMock.js └── src │ ├── routes │ └── index.test.js │ ├── screens │ └── Home │ │ └── Home.test.js │ ├── components │ ├── Home │ │ ├── Path.test.js │ │ └── HelloWorld.test.js │ └── @shared │ │ ├── Footer.test.js │ │ └── Header.test.js │ └── layouts │ └── App.test.js ├── src ├── screens │ └── Home │ │ ├── Home.scss │ │ └── Home.js ├── components │ ├── Home │ │ ├── Path.scss │ │ ├── HelloWorld.scss │ │ ├── HelloWorld.js │ │ └── Path.js │ └── @shared │ │ ├── Footer.scss │ │ ├── Header.scss │ │ ├── Footer.js │ │ └── Header.js ├── layouts │ ├── App.scss │ └── App.js ├── assets │ └── images │ │ └── logo.png ├── themes │ ├── App.global.scss │ └── Ant.vars.scss ├── config │ └── index.js ├── routes │ └── Root.js └── index.js ├── .npmignore ├── public ├── favicon.png └── index.html ├── .editorconfig ├── postcss.config.js ├── .eslintrc ├── .babelrc ├── .gitignore ├── LICENSE ├── README.md ├── main.js ├── package.json └── webpack.config.babel.js /@test/config/fileMock.js: -------------------------------------------------------------------------------- 1 | export default 'file' 2 | -------------------------------------------------------------------------------- /src/screens/Home/Home.scss: -------------------------------------------------------------------------------- 1 | .home { 2 | padding: 0 50px; 3 | } 4 | -------------------------------------------------------------------------------- /src/components/Home/Path.scss: -------------------------------------------------------------------------------- 1 | .path { 2 | margin: 16px 0; 3 | } 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | _ignore/ 2 | docs/ 3 | release/ 4 | dist/ 5 | .editorconfig 6 | __snapshots__ 7 | 8 | -------------------------------------------------------------------------------- /src/layouts/App.scss: -------------------------------------------------------------------------------- 1 | .app { 2 | padding: 10px 15px 15px 15px; 3 | background: #f0f2f5; 4 | } 5 | -------------------------------------------------------------------------------- /public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytesleo/electron-react-ant-boilerplate/HEAD/public/favicon.png -------------------------------------------------------------------------------- /src/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytesleo/electron-react-ant-boilerplate/HEAD/src/assets/images/logo.png -------------------------------------------------------------------------------- /src/components/Home/HelloWorld.scss: -------------------------------------------------------------------------------- 1 | .hello-world { 2 | background: #fff; 3 | padding: 24px; 4 | height: calc(100vh - 190px); 5 | } -------------------------------------------------------------------------------- /@test/config/setupTests.js: -------------------------------------------------------------------------------- 1 | // Libs 2 | import { configure } from "enzyme"; 3 | import Adapter from "enzyme-adapter-react-16"; 4 | // Adapter 5 | configure({ adapter: new Adapter() }); 6 | -------------------------------------------------------------------------------- /src/components/@shared/Footer.scss: -------------------------------------------------------------------------------- 1 | .footer { 2 | text-align: center; 3 | padding: 5px 10px 20px 10px; 4 | 5 | .logo { 6 | width: 20px; 7 | height: 20px; 8 | margin-right: 5px; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/themes/App.global.scss: -------------------------------------------------------------------------------- 1 | // Variables 2 | @import "./Ant.vars.scss"; 3 | 4 | // Example import .css 5 | //@import '~name_in_node_modules/dist/style.css'; 6 | 7 | // Global styles 8 | body { 9 | background-color: #f0f2f5; 10 | } 11 | -------------------------------------------------------------------------------- /src/components/@shared/Header.scss: -------------------------------------------------------------------------------- 1 | .header { 2 | .logo { 3 | width: 120px; 4 | height: 31px; 5 | background: rgba(255, 255, 255, 0.2); 6 | margin: 16px 24px 16px 0; 7 | float: left; 8 | } 9 | 10 | .menu { 11 | line-height: 64px; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = crlf 8 | indent_size = 2 9 | indent_style = space 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /src/config/index.js: -------------------------------------------------------------------------------- 1 | // Example url API 2 | const URL_API = "http://localhost:8000"; 3 | 4 | // Example Key JWT 5 | const KEY_JWT = "ABC123456"; 6 | 7 | // Example Images 8 | const IMAGES = { 9 | LOGO: require("@/assets/images/logo.png") 10 | }; 11 | 12 | export { URL_API, KEY_JWT, IMAGES }; 13 | -------------------------------------------------------------------------------- /src/routes/Root.js: -------------------------------------------------------------------------------- 1 | // Libs 2 | import React from "react"; 3 | import { HashRouter, Switch, Route } from "react-router-dom"; 4 | // Screens 5 | import Home from "@/screens/Home/Home"; 6 | 7 | const Routes = () => ( 8 | 9 | 10 | 11 | 12 | 13 | ); 14 | 15 | export default Routes; 16 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My App 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /@test/src/routes/index.test.js: -------------------------------------------------------------------------------- 1 | // Libs 2 | import React from "react"; 3 | import { shallow } from "enzyme"; 4 | import toJson from "enzyme-to-json"; 5 | 6 | // Module 7 | import Root from "@/routes/Root"; 8 | 9 | describe("Routes", () => { 10 | it('should render correctly in "debug" mode', () => { 11 | const component = shallow(); 12 | expect(toJson(component)).toMatchSnapshot(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /@test/src/screens/Home/Home.test.js: -------------------------------------------------------------------------------- 1 | // Libs 2 | import React from "react"; 3 | import { shallow } from "enzyme"; 4 | import toJson from "enzyme-to-json"; 5 | // Module 6 | import Home from "@/screens/Home/Home.js"; 7 | 8 | describe("Screen Home", () => { 9 | it('should render correctly in "debug" mode', () => { 10 | const component = shallow(); 11 | expect(toJson(component)).toMatchSnapshot(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /@test/src/components/Home/Path.test.js: -------------------------------------------------------------------------------- 1 | // Libs 2 | import React from "react"; 3 | import { shallow } from "enzyme"; 4 | import toJson from "enzyme-to-json"; 5 | // Module 6 | import Path from "@/components/Home/Path"; 7 | 8 | describe("Component Path", () => { 9 | it('should render correctly in "debug" mode', () => { 10 | const component = shallow(); 11 | expect(toJson(component)).toMatchSnapshot(); 12 | 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /@test/config/componentsMock.js: -------------------------------------------------------------------------------- 1 | // Libs 2 | import React from "react"; 3 | import PropTypes from "prop-types"; 4 | 5 | module.exports = new Proxy( 6 | {}, 7 | { 8 | get: (target, property) => { 9 | const Mock = ({ children }) => {children}; 10 | 11 | Mock.displayName = property; 12 | Mock.propTypes = { 13 | children: PropTypes.any 14 | }; 15 | 16 | return Mock; 17 | } 18 | } 19 | ); 20 | -------------------------------------------------------------------------------- /@test/src/components/@shared/Footer.test.js: -------------------------------------------------------------------------------- 1 | // Libs 2 | import React from "react"; 3 | import { shallow } from "enzyme"; 4 | import toJson from "enzyme-to-json"; 5 | // Module 6 | import Footer from "@/components/@shared/Footer"; 7 | 8 | describe("Component Footer", () => { 9 | it('should render correctly in "debug" mode', () => { 10 | const component = shallow(