├── .gitignore
├── LICENSE
├── README.md
├── lesson-1
├── README.md
├── README.txt
├── license.pdf
├── mdb-app
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── logo.svg
│ │ └── serviceWorker.js
├── package-lock.json
├── package.json
├── public
│ ├── index.html
│ └── manifest.json
└── src
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.png
│ └── registerServiceWorker.js
├── lesson-10
├── README.md
├── README.txt
├── license.pdf
├── package-lock.json
├── package.json
├── public
│ ├── index.html
│ └── manifest.json
└── src
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.png
│ └── registerServiceWorker.js
├── lesson-11
├── README.md
├── README.txt
├── license.pdf
├── package-lock.json
├── package.json
├── public
│ ├── index.html
│ └── manifest.json
└── src
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.png
│ └── registerServiceWorker.js
├── lesson-12
├── README.md
├── README.txt
├── license.pdf
├── package-lock.json
├── package.json
├── public
│ ├── index.html
│ └── manifest.json
└── src
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.png
│ └── registerServiceWorker.js
├── lesson-2
├── README.md
├── README.txt
├── license.pdf
├── package-lock.json
├── package.json
├── public
│ ├── index.html
│ └── manifest.json
└── src
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.png
│ └── registerServiceWorker.js
├── lesson-3
├── README.md
├── README.txt
├── license.pdf
├── package-lock.json
├── package.json
├── public
│ ├── index.html
│ └── manifest.json
└── src
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.png
│ └── registerServiceWorker.js
├── lesson-4
├── README.md
├── README.txt
├── license.pdf
├── package-lock.json
├── package.json
├── public
│ ├── index.html
│ └── manifest.json
└── src
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.png
│ └── registerServiceWorker.js
├── lesson-5
├── README.md
├── README.txt
├── license.pdf
├── package-lock.json
├── package.json
├── public
│ ├── index.html
│ └── manifest.json
└── src
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.png
│ └── registerServiceWorker.js
├── lesson-6
├── README.md
├── README.txt
├── license.pdf
├── package-lock.json
├── package.json
├── public
│ ├── index.html
│ └── manifest.json
└── src
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ └── logo.png
├── lesson-7
├── README.md
├── README.txt
├── license.pdf
├── package-lock.json
├── package.json
├── public
│ ├── index.html
│ └── manifest.json
└── src
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.png
│ └── registerServiceWorker.js
├── lesson-8
├── README.md
├── README.txt
├── license.pdf
├── package-lock.json
├── package.json
├── public
│ ├── index.html
│ └── manifest.json
└── src
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.png
│ └── registerServiceWorker.js
├── lesson-9
├── README.md
├── README.txt
├── license.pdf
├── package-lock.json
├── package.json
├── public
│ ├── index.html
│ └── manifest.json
└── src
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.png
│ └── registerServiceWorker.js
└── start-here
├── README.md
├── README.txt
├── license.pdf
├── package-lock.json
├── package.json
├── public
├── index.html
└── manifest.json
└── src
├── App.js
├── App.test.js
├── index.css
├── index.js
├── logo.png
└── registerServiceWorker.js
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_STORE
2 | node_modules
3 | scripts/flow/*/.flowconfig
4 | *~
5 | *.pyc
6 | .grunt
7 | _SpecRunner.html
8 | __benchmarks__
9 | build/
10 | remote-repo/
11 | coverage/
12 | .module-cache
13 | fixtures/dom/public/react-dom.js
14 | fixtures/dom/public/react.js
15 | test/the-files-to-test.generated.js
16 | *.log*
17 | chrome-user-data
18 | *.sublime-project
19 | *.sublime-workspace
20 | .idea
21 | *.iml
22 | .vscode
23 | *.swp
24 | *.swo
25 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 MDBootstrap
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # React-Tutorial-Agenda-App
2 | This repo contains a lesson files for React development tutorial: https://mdbootstrap.com/education/react/installation-1-npm/
3 |
--------------------------------------------------------------------------------
/lesson-1/README.md:
--------------------------------------------------------------------------------
1 | # React Bootstrap with Material Design
2 | MDBootstrap for React
3 |
4 | ## Getting Started
5 | To test, contribute or just see what we did follow few easy steps:
6 | - clone the repository
7 | - cd to the directory with the repository
8 | - run `yarn install` (or `npm install` if you don't use yarn)
9 | - run the app using `yarn start` (or `npm start`)
10 | - to build project use `yarn run build` (od `npm run build`)
11 | - `yarn run remove-demo` (or `npm run remove-demo`) removes demo app pages
12 | - enjoy!
13 |
14 | ## Bugs
15 | If you want to report a bug or submit your idea feel fre to open an issue
16 |
17 | Before you report a bug, please take your time to find if an issue hasn't been reported yet
18 |
19 | We're also open to pull requests
20 |
21 | ## Something Missing?
22 | If you still have some questions do not hesitate to ask us. Open an issue or [visit our Slack](https://mdbbetatest.slack.com)
23 |
--------------------------------------------------------------------------------
/lesson-1/README.txt:
--------------------------------------------------------------------------------
1 | Material Design for Bootstrap
2 |
3 | Version: MDB React Free 4.8.5
4 |
5 | Documentation:
6 | https://mdbootstrap.com/react/
7 |
8 | Getting started:
9 | https://mdbootstrap.com/react/react-bootstrap-getting-started/
10 |
11 | FAQ
12 | https://mdbootstrap.com/faq/
13 |
14 | Support:
15 | https://mdbootstrap.com/support/cat/mdb-react/
16 |
17 | ChangeLog
18 | https://mdbootstrap.com/react/changelog/
19 |
20 | License:
21 | https://mdbootstrap.com/license/
22 |
23 | Facebook: https://facebook.com/mdbootstrap
24 | Twitter: https://twitter.com/MDBootstrap
25 | Google+: https://plus.google.com/u/0/+Mdbootstrap/posts
26 | Dribbble: https://dribbble.com/mdbootstrap
27 |
28 |
29 | Contact:
30 | office@mdbootstrap.com
31 |
--------------------------------------------------------------------------------
/lesson-1/license.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-1/license.pdf
--------------------------------------------------------------------------------
/lesson-1/mdb-app/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/lesson-1/mdb-app/README.md:
--------------------------------------------------------------------------------
1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2 |
3 | ## Available Scripts
4 |
5 | In the project directory, you can run:
6 |
7 | ### `npm start`
8 |
9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11 |
12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console.
14 |
15 | ### `npm test`
16 |
17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19 |
20 | ### `npm run build`
21 |
22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance.
24 |
25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed!
27 |
28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29 |
30 | ### `npm run eject`
31 |
32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33 |
34 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35 |
36 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37 |
38 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39 |
40 | ## Learn More
41 |
42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43 |
44 | To learn React, check out the [React documentation](https://reactjs.org/).
45 |
46 | ### Code Splitting
47 |
48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49 |
50 | ### Analyzing the Bundle Size
51 |
52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53 |
54 | ### Making a Progressive Web App
55 |
56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57 |
58 | ### Advanced Configuration
59 |
60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61 |
62 | ### Deployment
63 |
64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65 |
66 | ### `npm run build` fails to minify
67 |
68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
69 |
--------------------------------------------------------------------------------
/lesson-1/mdb-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mdb-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "react": "^16.7.0",
7 | "react-dom": "^16.7.0",
8 | "react-scripts": "2.1.2"
9 | },
10 | "scripts": {
11 | "start": "react-scripts start",
12 | "build": "react-scripts build",
13 | "test": "react-scripts test",
14 | "eject": "react-scripts eject"
15 | },
16 | "eslintConfig": {
17 | "extends": "react-app"
18 | },
19 | "browserslist": [
20 | ">0.2%",
21 | "not dead",
22 | "not ie <= 11",
23 | "not op_mini all"
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/lesson-1/mdb-app/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-1/mdb-app/public/favicon.ico
--------------------------------------------------------------------------------
/lesson-1/mdb-app/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/lesson-1/mdb-app/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/lesson-1/mdb-app/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | animation: App-logo-spin infinite 20s linear;
7 | height: 40vmin;
8 | }
9 |
10 | .App-header {
11 | background-color: #282c34;
12 | min-height: 100vh;
13 | display: flex;
14 | flex-direction: column;
15 | align-items: center;
16 | justify-content: center;
17 | font-size: calc(10px + 2vmin);
18 | color: white;
19 | }
20 |
21 | .App-link {
22 | color: #61dafb;
23 | }
24 |
25 | @keyframes App-logo-spin {
26 | from {
27 | transform: rotate(0deg);
28 | }
29 | to {
30 | transform: rotate(360deg);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/lesson-1/mdb-app/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import logo from './logo.svg';
3 | import './App.css';
4 |
5 | class App extends Component {
6 | render() {
7 | return (
8 |
24 | );
25 | }
26 | }
27 |
28 | export default App;
29 |
--------------------------------------------------------------------------------
/lesson-1/mdb-app/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import App from './App';
4 |
5 | it('renders without crashing', () => {
6 | const div = document.createElement('div');
7 | ReactDOM.render( , div);
8 | ReactDOM.unmountComponentAtNode(div);
9 | });
10 |
--------------------------------------------------------------------------------
/lesson-1/mdb-app/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | padding: 0;
4 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
5 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
6 | sans-serif;
7 | -webkit-font-smoothing: antialiased;
8 | -moz-osx-font-smoothing: grayscale;
9 | }
10 |
11 | code {
12 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
13 | monospace;
14 | }
15 |
--------------------------------------------------------------------------------
/lesson-1/mdb-app/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 |
4 | ReactDOM.render(
5 |
6 |
Hello World
7 | Sub heading
8 | ,
9 | document.getElementById("root")
10 | );
11 |
--------------------------------------------------------------------------------
/lesson-1/mdb-app/src/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/lesson-1/mdb-app/src/serviceWorker.js:
--------------------------------------------------------------------------------
1 | // This optional code is used to register a service worker.
2 | // register() is not called by default.
3 |
4 | // This lets the app load faster on subsequent visits in production, and gives
5 | // it offline capabilities. However, it also means that developers (and users)
6 | // will only see deployed updates on subsequent visits to a page, after all the
7 | // existing tabs open on the page have been closed, since previously cached
8 | // resources are updated in the background.
9 |
10 | // To learn more about the benefits of this model and instructions on how to
11 | // opt-in, read http://bit.ly/CRA-PWA
12 |
13 | const isLocalhost = Boolean(
14 | window.location.hostname === 'localhost' ||
15 | // [::1] is the IPv6 localhost address.
16 | window.location.hostname === '[::1]' ||
17 | // 127.0.0.1/8 is considered localhost for IPv4.
18 | window.location.hostname.match(
19 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
20 | )
21 | );
22 |
23 | export function register(config) {
24 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
25 | // The URL constructor is available in all browsers that support SW.
26 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
27 | if (publicUrl.origin !== window.location.origin) {
28 | // Our service worker won't work if PUBLIC_URL is on a different origin
29 | // from what our page is served on. This might happen if a CDN is used to
30 | // serve assets; see https://github.com/facebook/create-react-app/issues/2374
31 | return;
32 | }
33 |
34 | window.addEventListener('load', () => {
35 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
36 |
37 | if (isLocalhost) {
38 | // This is running on localhost. Let's check if a service worker still exists or not.
39 | checkValidServiceWorker(swUrl, config);
40 |
41 | // Add some additional logging to localhost, pointing developers to the
42 | // service worker/PWA documentation.
43 | navigator.serviceWorker.ready.then(() => {
44 | console.log(
45 | 'This web app is being served cache-first by a service ' +
46 | 'worker. To learn more, visit http://bit.ly/CRA-PWA'
47 | );
48 | });
49 | } else {
50 | // Is not localhost. Just register service worker
51 | registerValidSW(swUrl, config);
52 | }
53 | });
54 | }
55 | }
56 |
57 | function registerValidSW(swUrl, config) {
58 | navigator.serviceWorker
59 | .register(swUrl)
60 | .then(registration => {
61 | registration.onupdatefound = () => {
62 | const installingWorker = registration.installing;
63 | if (installingWorker == null) {
64 | return;
65 | }
66 | installingWorker.onstatechange = () => {
67 | if (installingWorker.state === 'installed') {
68 | if (navigator.serviceWorker.controller) {
69 | // At this point, the updated precached content has been fetched,
70 | // but the previous service worker will still serve the older
71 | // content until all client tabs are closed.
72 | console.log(
73 | 'New content is available and will be used when all ' +
74 | 'tabs for this page are closed. See http://bit.ly/CRA-PWA.'
75 | );
76 |
77 | // Execute callback
78 | if (config && config.onUpdate) {
79 | config.onUpdate(registration);
80 | }
81 | } else {
82 | // At this point, everything has been precached.
83 | // It's the perfect time to display a
84 | // "Content is cached for offline use." message.
85 | console.log('Content is cached for offline use.');
86 |
87 | // Execute callback
88 | if (config && config.onSuccess) {
89 | config.onSuccess(registration);
90 | }
91 | }
92 | }
93 | };
94 | };
95 | })
96 | .catch(error => {
97 | console.error('Error during service worker registration:', error);
98 | });
99 | }
100 |
101 | function checkValidServiceWorker(swUrl, config) {
102 | // Check if the service worker can be found. If it can't reload the page.
103 | fetch(swUrl)
104 | .then(response => {
105 | // Ensure service worker exists, and that we really are getting a JS file.
106 | const contentType = response.headers.get('content-type');
107 | if (
108 | response.status === 404 ||
109 | (contentType != null && contentType.indexOf('javascript') === -1)
110 | ) {
111 | // No service worker found. Probably a different app. Reload the page.
112 | navigator.serviceWorker.ready.then(registration => {
113 | registration.unregister().then(() => {
114 | window.location.reload();
115 | });
116 | });
117 | } else {
118 | // Service worker found. Proceed as normal.
119 | registerValidSW(swUrl, config);
120 | }
121 | })
122 | .catch(() => {
123 | console.log(
124 | 'No internet connection found. App is running in offline mode.'
125 | );
126 | });
127 | }
128 |
129 | export function unregister() {
130 | if ('serviceWorker' in navigator) {
131 | navigator.serviceWorker.ready.then(registration => {
132 | registration.unregister();
133 | });
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/lesson-1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "your-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "mdbreact": "4.9.0",
7 | "react": "^16.6.0",
8 | "react-dom": "^16.6.0",
9 | "react-scripts": "2.0.5"
10 | },
11 | "scripts": {
12 | "start": "react-scripts start",
13 | "build": "react-scripts build",
14 | "test": "react-scripts test --env=jsdom",
15 | "eject": "react-scripts eject",
16 | "rename": "renamer --find App-clear.js --replace App.js ./src/App-clear.js",
17 | "remove-demo": "rimraf ./src/font ./src/img ./src/pages ./src/Routes.js ./src/App.js && npm run rename"
18 | },
19 | "devDependencies": {
20 | "renamer": "^1.0.0",
21 | "rimraf": "^2.6.2"
22 | },
23 | "browserslist": [
24 | ">0.2%",
25 | "not dead",
26 | "not ie <= 11",
27 | "not op_mini all"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/lesson-1/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
22 | React App
23 |
24 |
25 |
26 | You need to enable JavaScript to run this app.
27 |
28 |
29 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/lesson-1/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/lesson-1/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Button } from "mdbreact";
3 | import logo from './logo.png';
4 |
5 | class App extends Component {
6 | render() {
7 | return (
8 |
9 |
10 |
11 | Welcome to Your MDB React App
12 |
13 |
The application is configured and ready to import our components.
14 |
Check out our docs!
15 |
16 | );
17 | }
18 | }
19 |
20 | export default App;
--------------------------------------------------------------------------------
/lesson-1/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./App";
4 |
5 | it("renders without crashing", () => {
6 | const div = document.createElement("div");
7 | ReactDOM.render( , div);
8 | });
9 |
--------------------------------------------------------------------------------
/lesson-1/src/index.css:
--------------------------------------------------------------------------------
1 | .App{
2 | height: 100vh;
3 | display: flex;
4 | flex-direction: column;
5 | justify-content: center;
6 | align-items: center;
7 | text-align: center;
8 | }
9 |
10 | .App-logo{
11 | width: 10rem;
12 | }
13 |
14 | .flyout {
15 | display:flex;
16 | flex-direction: column;
17 | min-height:100vh;
18 | justify-content: space-between;
19 | }
20 |
21 | .home-feature-box .fa {
22 | font-size:6rem;
23 | }
24 |
25 | .home-feature-box span {
26 | display: block;
27 | color:#111;
28 | font-weight:bold;
29 | margin-top:1.5rem;
30 | }
31 |
32 | .example-components-list li > a {
33 | color: #495057;
34 | }
35 |
36 | .example-components-list li:last-child > a {
37 | border-bottom:0;
38 | }
39 |
40 | .example-components-list li > a .fa {
41 | color:rgba(0,0,0,.35);
42 | float:right;
43 | }
44 |
--------------------------------------------------------------------------------
/lesson-1/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import '@fortawesome/fontawesome-free/css/all.min.css';
4 | import 'bootstrap-css-only/css/bootstrap.min.css';
5 | import 'mdbreact/dist/css/mdb.css';
6 | import './index.css';
7 | import App from './App';
8 |
9 | import registerServiceWorker from './registerServiceWorker';
10 |
11 | ReactDOM.render( , document.getElementById('root'));
12 |
13 | registerServiceWorker();
--------------------------------------------------------------------------------
/lesson-1/src/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-1/src/logo.png
--------------------------------------------------------------------------------
/lesson-1/src/registerServiceWorker.js:
--------------------------------------------------------------------------------
1 | // In production, we register a service worker to serve assets from local cache.
2 |
3 | // This lets the app load faster on subsequent visits in production, and gives
4 | // it offline capabilities. However, it also means that developers (and users)
5 | // will only see deployed updates on the "N+1" visit to a page, since previously
6 | // cached resources are updated in the background.
7 |
8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
9 | // This link also includes instructions on opting out of this behavior.
10 |
11 | const isLocalhost = Boolean(
12 | window.location.hostname === "localhost" ||
13 | // [::1] is the IPv6 localhost address.
14 | window.location.hostname === "[::1]" ||
15 | // 127.0.0.1/8 is considered localhost for IPv4.
16 | window.location.hostname.match(
17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
18 | )
19 | );
20 |
21 | export default function register() {
22 | if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
23 | // The URL constructor is available in all browsers that support SW.
24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
25 | if (publicUrl.origin !== window.location.origin) {
26 | // Our service worker won't work if PUBLIC_URL is on a different origin
27 | // from what our page is served on. This might happen if a CDN is used to
28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
29 | return;
30 | }
31 |
32 | window.addEventListener("load", () => {
33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
34 |
35 | if (!isLocalhost) {
36 | // Is not local host. Just register service worker
37 | registerValidSW(swUrl);
38 | } else {
39 | // This is running on localhost. Lets check if a service worker still exists or not.
40 | checkValidServiceWorker(swUrl);
41 | }
42 | });
43 | }
44 | }
45 |
46 | function registerValidSW(swUrl) {
47 | navigator.serviceWorker
48 | .register(swUrl)
49 | .then(registration => {
50 | registration.onupdatefound = () => {
51 | const installingWorker = registration.installing;
52 | installingWorker.onstatechange = () => {
53 | if (installingWorker.state === "installed") {
54 | if (navigator.serviceWorker.controller) {
55 | // At this point, the old content will have been purged and
56 | // the fresh content will have been added to the cache.
57 | // It's the perfect time to display a "New content is
58 | // available; please refresh." message in your web app.
59 | console.log("New content is available; please refresh.");
60 | } else {
61 | // At this point, everything has been precached.
62 | // It's the perfect time to display a
63 | // "Content is cached for offline use." message.
64 | console.log("Content is cached for offline use.");
65 | }
66 | }
67 | };
68 | };
69 | })
70 | .catch(error => {
71 | console.error("Error during service worker registration:", error);
72 | });
73 | }
74 |
75 | function checkValidServiceWorker(swUrl) {
76 | // Check if the service worker can be found. If it can't reload the page.
77 | fetch(swUrl)
78 | .then(response => {
79 | // Ensure service worker exists, and that we really are getting a JS file.
80 | if (
81 | response.status === 404 ||
82 | response.headers.get("content-type").indexOf("javascript") === -1
83 | ) {
84 | // No service worker found. Probably a different app. Reload the page.
85 | navigator.serviceWorker.ready.then(registration => {
86 | registration.unregister().then(() => {
87 | window.location.reload();
88 | });
89 | });
90 | } else {
91 | // Service worker found. Proceed as normal.
92 | registerValidSW(swUrl);
93 | }
94 | })
95 | .catch(() => {
96 | console.log(
97 | "No internet connection found. App is running in offline mode."
98 | );
99 | });
100 | }
101 |
102 | export function unregister() {
103 | if ("serviceWorker" in navigator) {
104 | navigator.serviceWorker.ready.then(registration => {
105 | registration.unregister();
106 | });
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lesson-10/README.md:
--------------------------------------------------------------------------------
1 | # React Bootstrap with Material Design
2 | MDBootstrap for React
3 |
4 | ## Getting Started
5 | To test, contribute or just see what we did follow few easy steps:
6 | - clone the repository
7 | - cd to the directory with the repository
8 | - run `yarn install` (or `npm install` if you don't use yarn)
9 | - run the app using `yarn start` (or `npm start`)
10 | - to build project use `yarn run build` (od `npm run build`)
11 | - `yarn run remove-demo` (or `npm run remove-demo`) removes demo app pages
12 | - enjoy!
13 |
14 | ## Bugs
15 | If you want to report a bug or submit your idea feel fre to open an issue
16 |
17 | Before you report a bug, please take your time to find if an issue hasn't been reported yet
18 |
19 | We're also open to pull requests
20 |
21 | ## Something Missing?
22 | If you still have some questions do not hesitate to ask us. Open an issue or [visit our Slack](https://mdbbetatest.slack.com)
23 |
--------------------------------------------------------------------------------
/lesson-10/README.txt:
--------------------------------------------------------------------------------
1 | Material Design for Bootstrap
2 |
3 | Version: MDB React Free 4.8.5
4 |
5 | Documentation:
6 | https://mdbootstrap.com/react/
7 |
8 | Getting started:
9 | https://mdbootstrap.com/react/react-bootstrap-getting-started/
10 |
11 | FAQ
12 | https://mdbootstrap.com/faq/
13 |
14 | Support:
15 | https://mdbootstrap.com/support/cat/mdb-react/
16 |
17 | ChangeLog
18 | https://mdbootstrap.com/react/changelog/
19 |
20 | License:
21 | https://mdbootstrap.com/license/
22 |
23 | Facebook: https://facebook.com/mdbootstrap
24 | Twitter: https://twitter.com/MDBootstrap
25 | Google+: https://plus.google.com/u/0/+Mdbootstrap/posts
26 | Dribbble: https://dribbble.com/mdbootstrap
27 |
28 |
29 | Contact:
30 | office@mdbootstrap.com
31 |
--------------------------------------------------------------------------------
/lesson-10/license.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-10/license.pdf
--------------------------------------------------------------------------------
/lesson-10/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "your-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "mdbreact": "4.9.0",
7 | "react": "^16.6.0",
8 | "react-dom": "^16.6.0",
9 | "react-scripts": "2.0.5"
10 | },
11 | "scripts": {
12 | "start": "react-scripts start",
13 | "build": "react-scripts build",
14 | "test": "react-scripts test --env=jsdom",
15 | "eject": "react-scripts eject",
16 | "rename": "renamer --find App-clear.js --replace App.js ./src/App-clear.js",
17 | "remove-demo": "rimraf ./src/font ./src/img ./src/pages ./src/Routes.js ./src/App.js && npm run rename"
18 | },
19 | "devDependencies": {
20 | "renamer": "^1.0.0",
21 | "rimraf": "^2.6.2"
22 | },
23 | "browserslist": [
24 | ">0.2%",
25 | "not dead",
26 | "not ie <= 11",
27 | "not op_mini all"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/lesson-10/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
16 |
25 | React App
26 |
27 |
28 | You need to enable JavaScript to run this app.
29 |
30 |
31 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/lesson-10/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/lesson-10/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Button } from "mdbreact";
3 | import logo from './logo.png';
4 |
5 | class App extends Component {
6 | render() {
7 | return (
8 |
9 |
10 |
11 | Welcome to Your MDB React App
12 |
13 |
The application is configured and ready to import our components.
14 |
Check out our docs!
15 |
16 | );
17 | }
18 | }
19 |
20 | export default App;
--------------------------------------------------------------------------------
/lesson-10/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./App";
4 |
5 | it("renders without crashing", () => {
6 | const div = document.createElement("div");
7 | ReactDOM.render( , div);
8 | });
9 |
--------------------------------------------------------------------------------
/lesson-10/src/index.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-10/src/index.css
--------------------------------------------------------------------------------
/lesson-10/src/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import ReactDOM from "react-dom";
3 | import '@fortawesome/fontawesome-free/css/all.min.css';
4 | import "bootstrap-css-only/css/bootstrap.min.css";
5 | import "mdbreact/dist/css/mdb.css";
6 | import {
7 | MDBBtn,
8 | MDBInput,
9 | MDBModal,
10 | MDBModalBody,
11 | MDBModalHeader,
12 | MDBModalFooter,
13 | MDBIcon,
14 | MDBBadge,
15 | MDBContainer,
16 | MDBRow,
17 | MDBCol
18 | } from "mdbreact";
19 | import "./index.css";
20 |
21 | class App extends Component {
22 | constructor(props) {
23 | super(props);
24 | this.state = {
25 | events: [
26 | {
27 | id: 1,
28 | time: "10:00",
29 | title: "Breakfast with Simon",
30 | location: "Lounge Caffe",
31 | description: "Discuss Q3 targets"
32 | },
33 | {
34 | id: 2,
35 | time: "10:30",
36 | title: "Daily Standup Meeting (recurring)",
37 | location: "Warsaw Spire Office"
38 | },
39 | { id: 3, time: "11:00", title: "Call with HRs" },
40 | {
41 | id: 4,
42 | time: "12:00",
43 | title: "Lunch with Timmoty",
44 | location: "Canteen",
45 | description:
46 | "Project evalutation ile declaring a variable and using an if statement is a fine way to conditionally render a component, sometimes you might want to use a"
47 | }
48 | ]
49 | };
50 | }
51 | handleDelete = eventId => {
52 | const events = this.state.events.filter(e => e.id !== eventId);
53 | this.setState({ events });
54 | };
55 |
56 | render() {
57 | return (
58 |
59 |
60 |
61 |
62 | Today:
63 |
64 | {this.state.events.map(event => (
65 |
74 | ))}
75 |
76 |
77 |
78 |
79 | Add Event
80 |
81 |
82 |
83 |
84 |
85 | Schedule
86 |
87 | It's going to be busy that today. You have{" "}
88 | {this.state.events.length} events today.
89 |
90 |
91 |
92 |
93 |
94 |
95 | Sunny
96 |
97 |
98 |
99 |
100 |
101 | 23°C
102 |
103 |
104 |
105 | Don't forget your sunglasses. Today will dry and sunny, becoming
106 | warm in the afternoon with temperatures of between 20 and 25
107 | degrees.
108 |
109 |
110 |
111 |
112 |
113 | );
114 | }
115 | }
116 |
117 | class Event extends Component {
118 | render() {
119 | return (
120 |
121 |
122 |
123 | {this.props.time}
124 |
125 |
126 |
this.props.onDelete(this.props.id)}
130 | >
131 | -
132 |
133 |
{this.props.title} {" "}
134 |
135 | {this.props.location && (
136 |
137 |
138 | {this.props.location}
139 |
140 |
141 | )}
142 |
143 |
144 | {this.props.description && (
145 |
146 | {this.props.description}
147 |
148 | )}
149 |
150 | );
151 | }
152 | }
153 |
154 | ReactDOM.render( , document.getElementById("root"));
155 |
--------------------------------------------------------------------------------
/lesson-10/src/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-10/src/logo.png
--------------------------------------------------------------------------------
/lesson-10/src/registerServiceWorker.js:
--------------------------------------------------------------------------------
1 | // In production, we register a service worker to serve assets from local cache.
2 |
3 | // This lets the app load faster on subsequent visits in production, and gives
4 | // it offline capabilities. However, it also means that developers (and users)
5 | // will only see deployed updates on the "N+1" visit to a page, since previously
6 | // cached resources are updated in the background.
7 |
8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
9 | // This link also includes instructions on opting out of this behavior.
10 |
11 | const isLocalhost = Boolean(
12 | window.location.hostname === "localhost" ||
13 | // [::1] is the IPv6 localhost address.
14 | window.location.hostname === "[::1]" ||
15 | // 127.0.0.1/8 is considered localhost for IPv4.
16 | window.location.hostname.match(
17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
18 | )
19 | );
20 |
21 | export default function register() {
22 | if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
23 | // The URL constructor is available in all browsers that support SW.
24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
25 | if (publicUrl.origin !== window.location.origin) {
26 | // Our service worker won't work if PUBLIC_URL is on a different origin
27 | // from what our page is served on. This might happen if a CDN is used to
28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
29 | return;
30 | }
31 |
32 | window.addEventListener("load", () => {
33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
34 |
35 | if (!isLocalhost) {
36 | // Is not local host. Just register service worker
37 | registerValidSW(swUrl);
38 | } else {
39 | // This is running on localhost. Lets check if a service worker still exists or not.
40 | checkValidServiceWorker(swUrl);
41 | }
42 | });
43 | }
44 | }
45 |
46 | function registerValidSW(swUrl) {
47 | navigator.serviceWorker
48 | .register(swUrl)
49 | .then(registration => {
50 | registration.onupdatefound = () => {
51 | const installingWorker = registration.installing;
52 | installingWorker.onstatechange = () => {
53 | if (installingWorker.state === "installed") {
54 | if (navigator.serviceWorker.controller) {
55 | // At this point, the old content will have been purged and
56 | // the fresh content will have been added to the cache.
57 | // It's the perfect time to display a "New content is
58 | // available; please refresh." message in your web app.
59 | console.log("New content is available; please refresh.");
60 | } else {
61 | // At this point, everything has been precached.
62 | // It's the perfect time to display a
63 | // "Content is cached for offline use." message.
64 | console.log("Content is cached for offline use.");
65 | }
66 | }
67 | };
68 | };
69 | })
70 | .catch(error => {
71 | console.error("Error during service worker registration:", error);
72 | });
73 | }
74 |
75 | function checkValidServiceWorker(swUrl) {
76 | // Check if the service worker can be found. If it can't reload the page.
77 | fetch(swUrl)
78 | .then(response => {
79 | // Ensure service worker exists, and that we really are getting a JS file.
80 | if (
81 | response.status === 404 ||
82 | response.headers.get("content-type").indexOf("javascript") === -1
83 | ) {
84 | // No service worker found. Probably a different app. Reload the page.
85 | navigator.serviceWorker.ready.then(registration => {
86 | registration.unregister().then(() => {
87 | window.location.reload();
88 | });
89 | });
90 | } else {
91 | // Service worker found. Proceed as normal.
92 | registerValidSW(swUrl);
93 | }
94 | })
95 | .catch(() => {
96 | console.log(
97 | "No internet connection found. App is running in offline mode."
98 | );
99 | });
100 | }
101 |
102 | export function unregister() {
103 | if ("serviceWorker" in navigator) {
104 | navigator.serviceWorker.ready.then(registration => {
105 | registration.unregister();
106 | });
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lesson-11/README.md:
--------------------------------------------------------------------------------
1 | # React Bootstrap with Material Design
2 | MDBootstrap for React
3 |
4 | ## Getting Started
5 | To test, contribute or just see what we did follow few easy steps:
6 | - clone the repository
7 | - cd to the directory with the repository
8 | - run `yarn install` (or `npm install` if you don't use yarn)
9 | - run the app using `yarn start` (or `npm start`)
10 | - to build project use `yarn run build` (od `npm run build`)
11 | - `yarn run remove-demo` (or `npm run remove-demo`) removes demo app pages
12 | - enjoy!
13 |
14 | ## Bugs
15 | If you want to report a bug or submit your idea feel fre to open an issue
16 |
17 | Before you report a bug, please take your time to find if an issue hasn't been reported yet
18 |
19 | We're also open to pull requests
20 |
21 | ## Something Missing?
22 | If you still have some questions do not hesitate to ask us. Open an issue or [visit our Slack](https://mdbbetatest.slack.com)
23 |
--------------------------------------------------------------------------------
/lesson-11/README.txt:
--------------------------------------------------------------------------------
1 | Material Design for Bootstrap
2 |
3 | Version: MDB React Free 4.8.5
4 |
5 | Documentation:
6 | https://mdbootstrap.com/react/
7 |
8 | Getting started:
9 | https://mdbootstrap.com/react/react-bootstrap-getting-started/
10 |
11 | FAQ
12 | https://mdbootstrap.com/faq/
13 |
14 | Support:
15 | https://mdbootstrap.com/support/cat/mdb-react/
16 |
17 | ChangeLog
18 | https://mdbootstrap.com/react/changelog/
19 |
20 | License:
21 | https://mdbootstrap.com/license/
22 |
23 | Facebook: https://facebook.com/mdbootstrap
24 | Twitter: https://twitter.com/MDBootstrap
25 | Google+: https://plus.google.com/u/0/+Mdbootstrap/posts
26 | Dribbble: https://dribbble.com/mdbootstrap
27 |
28 |
29 | Contact:
30 | office@mdbootstrap.com
31 |
--------------------------------------------------------------------------------
/lesson-11/license.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-11/license.pdf
--------------------------------------------------------------------------------
/lesson-11/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "your-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "mdbreact": "4.9.0",
7 | "react": "^16.6.0",
8 | "react-dom": "^16.6.0",
9 | "react-scripts": "2.0.5"
10 | },
11 | "scripts": {
12 | "start": "react-scripts start",
13 | "build": "react-scripts build",
14 | "test": "react-scripts test --env=jsdom",
15 | "eject": "react-scripts eject",
16 | "rename": "renamer --find App-clear.js --replace App.js ./src/App-clear.js",
17 | "remove-demo": "rimraf ./src/font ./src/img ./src/pages ./src/Routes.js ./src/App.js && npm run rename"
18 | },
19 | "devDependencies": {
20 | "renamer": "^1.0.0",
21 | "rimraf": "^2.6.2"
22 | },
23 | "browserslist": [
24 | ">0.2%",
25 | "not dead",
26 | "not ie <= 11",
27 | "not op_mini all"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/lesson-11/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
16 |
25 | React App
26 |
27 |
28 | You need to enable JavaScript to run this app.
29 |
30 |
31 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/lesson-11/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/lesson-11/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Button } from "mdbreact";
3 | import logo from './logo.png';
4 |
5 | class App extends Component {
6 | render() {
7 | return (
8 |
9 |
10 |
11 | Welcome to Your MDB React App
12 |
13 |
The application is configured and ready to import our components.
14 |
Check out our docs!
15 |
16 | );
17 | }
18 | }
19 |
20 | export default App;
--------------------------------------------------------------------------------
/lesson-11/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./App";
4 |
5 | it("renders without crashing", () => {
6 | const div = document.createElement("div");
7 | ReactDOM.render( , div);
8 | });
9 |
--------------------------------------------------------------------------------
/lesson-11/src/index.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-11/src/index.css
--------------------------------------------------------------------------------
/lesson-11/src/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import ReactDOM from "react-dom";
3 | import '@fortawesome/fontawesome-free/css/all.min.css';
4 | import "bootstrap-css-only/css/bootstrap.min.css";
5 | import "mdbreact/dist/css/mdb.css";
6 | import {
7 | MDBBtn,
8 | MDBInput,
9 | MDBModal,
10 | MDBModalBody,
11 | MDBModalHeader,
12 | MDBModalFooter,
13 | MDBIcon,
14 | MDBBadge,
15 | MDBContainer,
16 | MDBRow,
17 | MDBCol
18 | } from "mdbreact";
19 | import "./index.css";
20 |
21 | class App extends Component {
22 | constructor(props) {
23 | super(props);
24 | this.state = {
25 | modal: false,
26 | events: [
27 | {
28 | id: 1,
29 | time: "10:00",
30 | title: "Breakfast with Simon",
31 | location: "Lounge Caffe",
32 | description: "Discuss Q3 targets"
33 | },
34 | {
35 | id: 2,
36 | time: "10:30",
37 | title: "Daily Standup Meeting (recurring)",
38 | location: "Warsaw Spire Office"
39 | },
40 | { id: 3, time: "11:00", title: "Call with HRs" },
41 | {
42 | id: 4,
43 | time: "12:00",
44 | title: "Lunch with Timmoty",
45 | location: "Canteen",
46 | description:
47 | "Project evalutation ile declaring a variable and using an if statement is a fine way to conditionally render a component, sometimes you might want to use a"
48 | }
49 | ]
50 | };
51 | }
52 | handleDelete = eventId => {
53 | const events = this.state.events.filter(e => e.id !== eventId);
54 | this.setState({ events });
55 | };
56 | toggleModal = () => {
57 | this.setState({
58 | modal: !this.state.modal
59 | });
60 | };
61 |
62 | render() {
63 | return (
64 |
65 |
66 |
67 |
68 | Today:
69 |
70 | {this.state.events.map(event => (
71 |
80 | ))}
81 |
82 |
83 |
84 |
85 | Add Event
86 |
87 |
88 |
89 |
90 |
91 | Schedule
92 |
93 | It's going to be busy that today. You have{" "}
94 | {this.state.events.length} events today.
95 |
96 |
97 |
98 |
99 |
100 |
101 | Sunny
102 |
103 |
104 |
105 |
106 |
107 | 23°C
108 |
109 |
110 |
111 | Don't forget your sunglasses. Today will dry and sunny, becoming
112 | warm in the afternoon with temperatures of between 20 and 25
113 | degrees.
114 |
115 |
116 |
117 |
118 |
119 |
120 |
125 | Add new event
126 |
127 | Body
128 |
129 |
130 |
131 | );
132 | }
133 | }
134 |
135 | class Event extends Component {
136 | render() {
137 | return (
138 |
139 |
140 |
141 | {this.props.time}
142 |
143 |
144 |
this.props.onDelete(this.props.id)}
148 | >
149 | -
150 |
151 |
{this.props.title} {" "}
152 |
153 | {this.props.location && (
154 |
155 |
156 | {this.props.location}
157 |
158 |
159 | )}
160 |
161 |
162 | {this.props.description && (
163 |
164 | {this.props.description}
165 |
166 | )}
167 |
168 | );
169 | }
170 | }
171 |
172 | ReactDOM.render( , document.getElementById("root"));
173 |
--------------------------------------------------------------------------------
/lesson-11/src/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-11/src/logo.png
--------------------------------------------------------------------------------
/lesson-11/src/registerServiceWorker.js:
--------------------------------------------------------------------------------
1 | // In production, we register a service worker to serve assets from local cache.
2 |
3 | // This lets the app load faster on subsequent visits in production, and gives
4 | // it offline capabilities. However, it also means that developers (and users)
5 | // will only see deployed updates on the "N+1" visit to a page, since previously
6 | // cached resources are updated in the background.
7 |
8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
9 | // This link also includes instructions on opting out of this behavior.
10 |
11 | const isLocalhost = Boolean(
12 | window.location.hostname === "localhost" ||
13 | // [::1] is the IPv6 localhost address.
14 | window.location.hostname === "[::1]" ||
15 | // 127.0.0.1/8 is considered localhost for IPv4.
16 | window.location.hostname.match(
17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
18 | )
19 | );
20 |
21 | export default function register() {
22 | if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
23 | // The URL constructor is available in all browsers that support SW.
24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
25 | if (publicUrl.origin !== window.location.origin) {
26 | // Our service worker won't work if PUBLIC_URL is on a different origin
27 | // from what our page is served on. This might happen if a CDN is used to
28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
29 | return;
30 | }
31 |
32 | window.addEventListener("load", () => {
33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
34 |
35 | if (!isLocalhost) {
36 | // Is not local host. Just register service worker
37 | registerValidSW(swUrl);
38 | } else {
39 | // This is running on localhost. Lets check if a service worker still exists or not.
40 | checkValidServiceWorker(swUrl);
41 | }
42 | });
43 | }
44 | }
45 |
46 | function registerValidSW(swUrl) {
47 | navigator.serviceWorker
48 | .register(swUrl)
49 | .then(registration => {
50 | registration.onupdatefound = () => {
51 | const installingWorker = registration.installing;
52 | installingWorker.onstatechange = () => {
53 | if (installingWorker.state === "installed") {
54 | if (navigator.serviceWorker.controller) {
55 | // At this point, the old content will have been purged and
56 | // the fresh content will have been added to the cache.
57 | // It's the perfect time to display a "New content is
58 | // available; please refresh." message in your web app.
59 | console.log("New content is available; please refresh.");
60 | } else {
61 | // At this point, everything has been precached.
62 | // It's the perfect time to display a
63 | // "Content is cached for offline use." message.
64 | console.log("Content is cached for offline use.");
65 | }
66 | }
67 | };
68 | };
69 | })
70 | .catch(error => {
71 | console.error("Error during service worker registration:", error);
72 | });
73 | }
74 |
75 | function checkValidServiceWorker(swUrl) {
76 | // Check if the service worker can be found. If it can't reload the page.
77 | fetch(swUrl)
78 | .then(response => {
79 | // Ensure service worker exists, and that we really are getting a JS file.
80 | if (
81 | response.status === 404 ||
82 | response.headers.get("content-type").indexOf("javascript") === -1
83 | ) {
84 | // No service worker found. Probably a different app. Reload the page.
85 | navigator.serviceWorker.ready.then(registration => {
86 | registration.unregister().then(() => {
87 | window.location.reload();
88 | });
89 | });
90 | } else {
91 | // Service worker found. Proceed as normal.
92 | registerValidSW(swUrl);
93 | }
94 | })
95 | .catch(() => {
96 | console.log(
97 | "No internet connection found. App is running in offline mode."
98 | );
99 | });
100 | }
101 |
102 | export function unregister() {
103 | if ("serviceWorker" in navigator) {
104 | navigator.serviceWorker.ready.then(registration => {
105 | registration.unregister();
106 | });
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lesson-12/README.md:
--------------------------------------------------------------------------------
1 | # React Bootstrap with Material Design
2 | MDBootstrap for React
3 |
4 | ## Getting Started
5 | To test, contribute or just see what we did follow few easy steps:
6 | - clone the repository
7 | - cd to the directory with the repository
8 | - run `yarn install` (or `npm install` if you don't use yarn)
9 | - run the app using `yarn start` (or `npm start`)
10 | - to build project use `yarn run build` (od `npm run build`)
11 | - `yarn run remove-demo` (or `npm run remove-demo`) removes demo app pages
12 | - enjoy!
13 |
14 | ## Bugs
15 | If you want to report a bug or submit your idea feel fre to open an issue
16 |
17 | Before you report a bug, please take your time to find if an issue hasn't been reported yet
18 |
19 | We're also open to pull requests
20 |
21 | ## Something Missing?
22 | If you still have some questions do not hesitate to ask us. Open an issue or [visit our Slack](https://mdbbetatest.slack.com)
23 |
--------------------------------------------------------------------------------
/lesson-12/README.txt:
--------------------------------------------------------------------------------
1 | Material Design for Bootstrap
2 |
3 | Version: MDB React Free 4.8.5
4 |
5 | Documentation:
6 | https://mdbootstrap.com/react/
7 |
8 | Getting started:
9 | https://mdbootstrap.com/react/react-bootstrap-getting-started/
10 |
11 | FAQ
12 | https://mdbootstrap.com/faq/
13 |
14 | Support:
15 | https://mdbootstrap.com/support/cat/mdb-react/
16 |
17 | ChangeLog
18 | https://mdbootstrap.com/react/changelog/
19 |
20 | License:
21 | https://mdbootstrap.com/license/
22 |
23 | Facebook: https://facebook.com/mdbootstrap
24 | Twitter: https://twitter.com/MDBootstrap
25 | Google+: https://plus.google.com/u/0/+Mdbootstrap/posts
26 | Dribbble: https://dribbble.com/mdbootstrap
27 |
28 |
29 | Contact:
30 | office@mdbootstrap.com
31 |
--------------------------------------------------------------------------------
/lesson-12/license.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-12/license.pdf
--------------------------------------------------------------------------------
/lesson-12/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "your-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "mdbreact": "4.9.0",
7 | "react": "^16.6.0",
8 | "react-dom": "^16.6.0",
9 | "react-scripts": "2.0.5"
10 | },
11 | "scripts": {
12 | "start": "react-scripts start",
13 | "build": "react-scripts build",
14 | "test": "react-scripts test --env=jsdom",
15 | "eject": "react-scripts eject",
16 | "rename": "renamer --find App-clear.js --replace App.js ./src/App-clear.js",
17 | "remove-demo": "rimraf ./src/font ./src/img ./src/pages ./src/Routes.js ./src/App.js && npm run rename"
18 | },
19 | "devDependencies": {
20 | "renamer": "^1.0.0",
21 | "rimraf": "^2.6.2"
22 | },
23 | "browserslist": [
24 | ">0.2%",
25 | "not dead",
26 | "not ie <= 11",
27 | "not op_mini all"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/lesson-12/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
16 |
25 | React App
26 |
27 |
28 | You need to enable JavaScript to run this app.
29 |
30 |
31 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/lesson-12/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/lesson-12/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Button } from "mdbreact";
3 | import logo from './logo.png';
4 |
5 | class App extends Component {
6 | render() {
7 | return (
8 |
9 |
10 |
11 | Welcome to Your MDB React App
12 |
13 |
The application is configured and ready to import our components.
14 |
Check out our docs!
15 |
16 | );
17 | }
18 | }
19 |
20 | export default App;
--------------------------------------------------------------------------------
/lesson-12/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./App";
4 |
5 | it("renders without crashing", () => {
6 | const div = document.createElement("div");
7 | ReactDOM.render( , div);
8 | });
9 |
--------------------------------------------------------------------------------
/lesson-12/src/index.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-12/src/index.css
--------------------------------------------------------------------------------
/lesson-12/src/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import ReactDOM from "react-dom";
3 | import '@fortawesome/fontawesome-free/css/all.min.css';
4 | import "bootstrap-css-only/css/bootstrap.min.css";
5 | import "mdbreact/dist/css/mdb.css";
6 | import { MDBBtn, MDBInput, MDBModal, MDBModalBody, MDBModalHeader, MDBModalFooter, MDBIcon, MDBBadge, MDBContainer, MDBRow, MDBCol} from "mdbreact";
7 | import "./index.css";
8 |
9 | class App extends Component {
10 | constructor(props) {
11 | super(props);
12 | this.state = {
13 | modal: false,
14 | events: [
15 | {
16 | id: 1,
17 | time: "10:00",
18 | title: "Breakfast with Simon",
19 | location: "Lounge Caffe",
20 | description: "Discuss Q3 targets"
21 | },
22 | {
23 | id: 2,
24 | time: "10:30",
25 | title: "Daily Standup Meeting (recurring)",
26 | location: "Warsaw Spire Office"
27 | },
28 | { id: 3, time: "11:00", title: "Call with HRs" },
29 | {
30 | id: 4,
31 | time: "12:00",
32 | title: "Lunch with Timmoty",
33 | location: "Canteen",
34 | description:
35 | "Project evalutation ile declaring a variable and using an if statement is a fine way to conditionally render a component, sometimes you might want to use a"
36 | }
37 | ]
38 | };
39 | }
40 | addEvent = () => {
41 | var newArray = [...this.state.events];
42 | newArray.push({
43 | id: newArray.length ? newArray[newArray.length - 1].id + 1 : 1,
44 | time: this.state.time,
45 | title: this.state.title,
46 | location: this.state.location,
47 | description: this.state.description,
48 | value: this.var > 5 ? "Its's grater then 5" : "Its lower or equal 5"
49 | });
50 | this.setState({ events: newArray });
51 | this.setState({
52 | time: "",
53 | title: "",
54 | location: "",
55 | description: ""
56 | });
57 | };
58 |
59 | handleInputChange = inputName => value => {
60 | const nextValue = value;
61 |
62 | this.setState({
63 | [inputName]: nextValue
64 | });
65 | };
66 |
67 | handleDelete = eventId => {
68 | const events = this.state.events.filter(e => e.id !== eventId);
69 | this.setState({ events });
70 | };
71 | toggleModal = () => {
72 | this.setState({
73 | modal: !this.state.modal
74 | });
75 | };
76 |
77 | render() {
78 | return (
79 |
80 |
81 |
82 |
83 | Today:
84 |
85 | {this.state.events.map(event => (
86 |
95 | ))}
96 |
97 |
98 |
99 |
100 | Add Event
101 |
102 |
103 |
104 |
105 |
106 | Schedule
107 |
108 | It's going to be busy that today. You have{" "}
109 | {this.state.events.length} events today.
110 |
111 |
112 |
113 |
114 |
115 |
116 | Sunny
117 |
118 |
119 |
120 |
121 |
122 | 23°C
123 |
124 |
125 |
126 | Don't forget your sunglasses. Today will dry and sunny, becoming
127 | warm in the afternoon with temperatures of between 20 and 25
128 | degrees.
129 |
130 |
131 |
132 |
133 |
134 |
135 |
140 | Add new event
141 |
142 |
143 |
179 |
180 |
181 | {
184 | this.toggleModal();
185 | this.addEvent();
186 | }}
187 | >
188 | Add
189 |
190 |
191 |
192 |
193 | );
194 | }
195 | }
196 |
197 | class Event extends Component {
198 | render() {
199 | return (
200 |
201 |
202 |
203 | {this.props.time}
204 |
205 |
206 |
this.props.onDelete(this.props.id)}
210 | >
211 | -
212 |
213 |
{this.props.title} {" "}
214 |
215 | {this.props.location && (
216 |
217 |
218 | {this.props.location}
219 |
220 |
221 | )}
222 |
223 |
224 | {this.props.description && (
225 |
226 | {this.props.description}
227 |
228 | )}
229 |
230 | );
231 | }
232 | }
233 |
234 | ReactDOM.render( , document.getElementById("root"));
235 |
--------------------------------------------------------------------------------
/lesson-12/src/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-12/src/logo.png
--------------------------------------------------------------------------------
/lesson-12/src/registerServiceWorker.js:
--------------------------------------------------------------------------------
1 | // In production, we register a service worker to serve assets from local cache.
2 |
3 | // This lets the app load faster on subsequent visits in production, and gives
4 | // it offline capabilities. However, it also means that developers (and users)
5 | // will only see deployed updates on the "N+1" visit to a page, since previously
6 | // cached resources are updated in the background.
7 |
8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
9 | // This link also includes instructions on opting out of this behavior.
10 |
11 | const isLocalhost = Boolean(
12 | window.location.hostname === "localhost" ||
13 | // [::1] is the IPv6 localhost address.
14 | window.location.hostname === "[::1]" ||
15 | // 127.0.0.1/8 is considered localhost for IPv4.
16 | window.location.hostname.match(
17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
18 | )
19 | );
20 |
21 | export default function register() {
22 | if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
23 | // The URL constructor is available in all browsers that support SW.
24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
25 | if (publicUrl.origin !== window.location.origin) {
26 | // Our service worker won't work if PUBLIC_URL is on a different origin
27 | // from what our page is served on. This might happen if a CDN is used to
28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
29 | return;
30 | }
31 |
32 | window.addEventListener("load", () => {
33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
34 |
35 | if (!isLocalhost) {
36 | // Is not local host. Just register service worker
37 | registerValidSW(swUrl);
38 | } else {
39 | // This is running on localhost. Lets check if a service worker still exists or not.
40 | checkValidServiceWorker(swUrl);
41 | }
42 | });
43 | }
44 | }
45 |
46 | function registerValidSW(swUrl) {
47 | navigator.serviceWorker
48 | .register(swUrl)
49 | .then(registration => {
50 | registration.onupdatefound = () => {
51 | const installingWorker = registration.installing;
52 | installingWorker.onstatechange = () => {
53 | if (installingWorker.state === "installed") {
54 | if (navigator.serviceWorker.controller) {
55 | // At this point, the old content will have been purged and
56 | // the fresh content will have been added to the cache.
57 | // It's the perfect time to display a "New content is
58 | // available; please refresh." message in your web app.
59 | console.log("New content is available; please refresh.");
60 | } else {
61 | // At this point, everything has been precached.
62 | // It's the perfect time to display a
63 | // "Content is cached for offline use." message.
64 | console.log("Content is cached for offline use.");
65 | }
66 | }
67 | };
68 | };
69 | })
70 | .catch(error => {
71 | console.error("Error during service worker registration:", error);
72 | });
73 | }
74 |
75 | function checkValidServiceWorker(swUrl) {
76 | // Check if the service worker can be found. If it can't reload the page.
77 | fetch(swUrl)
78 | .then(response => {
79 | // Ensure service worker exists, and that we really are getting a JS file.
80 | if (
81 | response.status === 404 ||
82 | response.headers.get("content-type").indexOf("javascript") === -1
83 | ) {
84 | // No service worker found. Probably a different app. Reload the page.
85 | navigator.serviceWorker.ready.then(registration => {
86 | registration.unregister().then(() => {
87 | window.location.reload();
88 | });
89 | });
90 | } else {
91 | // Service worker found. Proceed as normal.
92 | registerValidSW(swUrl);
93 | }
94 | })
95 | .catch(() => {
96 | console.log(
97 | "No internet connection found. App is running in offline mode."
98 | );
99 | });
100 | }
101 |
102 | export function unregister() {
103 | if ("serviceWorker" in navigator) {
104 | navigator.serviceWorker.ready.then(registration => {
105 | registration.unregister();
106 | });
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lesson-2/README.md:
--------------------------------------------------------------------------------
1 | # React Bootstrap with Material Design
2 | MDBootstrap for React
3 |
4 | ## Getting Started
5 | To test, contribute or just see what we did follow few easy steps:
6 | - clone the repository
7 | - cd to the directory with the repository
8 | - run `yarn install` (or `npm install` if you don't use yarn)
9 | - run the app using `yarn start` (or `npm start`)
10 | - to build project use `yarn run build` (od `npm run build`)
11 | - `yarn run remove-demo` (or `npm run remove-demo`) removes demo app pages
12 | - enjoy!
13 |
14 | ## Bugs
15 | If you want to report a bug or submit your idea feel fre to open an issue
16 |
17 | Before you report a bug, please take your time to find if an issue hasn't been reported yet
18 |
19 | We're also open to pull requests
20 |
21 | ## Something Missing?
22 | If you still have some questions do not hesitate to ask us. Open an issue or [visit our Slack](https://mdbbetatest.slack.com)
23 |
--------------------------------------------------------------------------------
/lesson-2/README.txt:
--------------------------------------------------------------------------------
1 | Material Design for Bootstrap
2 |
3 | Version: MDB React Free 4.8.5
4 |
5 | Documentation:
6 | https://mdbootstrap.com/react/
7 |
8 | Getting started:
9 | https://mdbootstrap.com/react/react-bootstrap-getting-started/
10 |
11 | FAQ
12 | https://mdbootstrap.com/faq/
13 |
14 | Support:
15 | https://mdbootstrap.com/support/cat/mdb-react/
16 |
17 | ChangeLog
18 | https://mdbootstrap.com/react/changelog/
19 |
20 | License:
21 | https://mdbootstrap.com/license/
22 |
23 | Facebook: https://facebook.com/mdbootstrap
24 | Twitter: https://twitter.com/MDBootstrap
25 | Google+: https://plus.google.com/u/0/+Mdbootstrap/posts
26 | Dribbble: https://dribbble.com/mdbootstrap
27 |
28 |
29 | Contact:
30 | office@mdbootstrap.com
31 |
--------------------------------------------------------------------------------
/lesson-2/license.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-2/license.pdf
--------------------------------------------------------------------------------
/lesson-2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "your-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "mdbreact": "4.9.0",
7 | "react": "^16.6.0",
8 | "react-dom": "^16.6.0",
9 | "react-scripts": "2.0.5"
10 | },
11 | "scripts": {
12 | "start": "react-scripts start",
13 | "build": "react-scripts build",
14 | "test": "react-scripts test --env=jsdom",
15 | "eject": "react-scripts eject",
16 | "rename": "renamer --find App-clear.js --replace App.js ./src/App-clear.js",
17 | "remove-demo": "rimraf ./src/font ./src/img ./src/pages ./src/Routes.js ./src/App.js && npm run rename"
18 | },
19 | "devDependencies": {
20 | "renamer": "^1.0.0",
21 | "rimraf": "^2.6.2"
22 | },
23 | "browserslist": [
24 | ">0.2%",
25 | "not dead",
26 | "not ie <= 11",
27 | "not op_mini all"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/lesson-2/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
16 |
25 | React App
26 |
27 |
28 | You need to enable JavaScript to run this app.
29 |
30 |
31 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/lesson-2/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/lesson-2/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Button } from "mdbreact";
3 | import logo from './logo.png';
4 |
5 | class App extends Component {
6 | render() {
7 | return (
8 |
9 |
10 |
11 | Welcome to Your MDB React App
12 |
13 |
The application is configured and ready to import our components.
14 |
Check out our docs!
15 |
16 | );
17 | }
18 | }
19 |
20 | export default App;
--------------------------------------------------------------------------------
/lesson-2/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./App";
4 |
5 | it("renders without crashing", () => {
6 | const div = document.createElement("div");
7 | ReactDOM.render( , div);
8 | });
9 |
--------------------------------------------------------------------------------
/lesson-2/src/index.css:
--------------------------------------------------------------------------------
1 | .App {
2 | height: 100vh;
3 | display: flex;
4 | flex-direction: column;
5 | justify-content: center;
6 | align-items: center;
7 | text-align: center;
8 | }
9 |
10 | .App-logo {
11 | width: 10rem;
12 | }
13 |
14 | .flyout {
15 | display: flex;
16 | flex-direction: column;
17 | min-height: 100vh;
18 | justify-content: space-between;
19 | }
20 |
21 | .home-feature-box .fa {
22 | font-size: 6rem;
23 | }
24 |
25 | .home-feature-box span {
26 | display: block;
27 | color: #111;
28 | font-weight: bold;
29 | margin-top: 1.5rem;
30 | }
31 |
32 | .example-components-list li > a {
33 | color: #495057;
34 | }
35 |
36 | .example-components-list li:last-child > a {
37 | border-bottom: 0;
38 | }
39 |
40 | .example-components-list li > a .fa {
41 | color: rgba(0, 0, 0, 0.35);
42 | float: right;
43 | }
44 |
--------------------------------------------------------------------------------
/lesson-2/src/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import ReactDOM from "react-dom";
3 | import '@fortawesome/fontawesome-free/css/all.min.css';
4 | import "bootstrap-css-only/css/bootstrap.min.css";
5 | import "mdbreact/dist/css/mdb.css";
6 | import {
7 | MDBBtn,
8 | MDBInput,
9 | MDBModal,
10 | MDBModalBody,
11 | MDBModalHeader,
12 | MDBModalFooter,
13 | MDBIcon,
14 | MDBBadge,
15 | MDBContainer,
16 | MDBRow,
17 | MDBCol
18 | } from "mdbreact";
19 | import "./index.css";
20 |
21 | class App extends Component {
22 | constructor(props) {
23 | super(props);
24 | this.state = {
25 | modal: false,
26 | events: [
27 | {
28 | id: 1,
29 | time: "10:00",
30 | title: "Breakfast with Simon",
31 | location: "Lounge Caffe",
32 | description: "Discuss Q3 targets"
33 | },
34 | {
35 | id: 2,
36 | time: "10:30",
37 | title: "Daily Standup Meeting (recurring)",
38 | location: "Warsaw Spire Office"
39 | },
40 | { id: 3, time: "11:00", title: "Call with HRs" },
41 | {
42 | id: 4,
43 | time: "12:00",
44 | title: "Lunch with Timmoty",
45 | location: "Canteen",
46 | description:
47 | "Project evalutation ile declaring a variable and using an if statement is a fine way to conditionally render a component, sometimes you might want to use a"
48 | }
49 | ]
50 | };
51 | }
52 | addEvent = () => {
53 | var newArray = [...this.state.events];
54 | newArray.push({
55 | id: newArray.length ? newArray[newArray.length - 1].id + 1 : 1,
56 | time: this.state.time,
57 | title: this.state.title,
58 | location: this.state.location,
59 | description: this.state.description
60 | });
61 | this.setState({ events: newArray });
62 | this.setState({
63 | time: "",
64 | title: "",
65 | location: "",
66 | description: ""
67 | });
68 | };
69 |
70 | handleInputChange = inputName => value => {
71 | const nextValue = value;
72 |
73 | this.setState({
74 | [inputName]: nextValue
75 | });
76 | };
77 |
78 | handleDelete = eventId => {
79 | const events = this.state.events.filter(e => e.id !== eventId);
80 | this.setState({ events });
81 | };
82 | toggleModal = () => {
83 | this.setState({
84 | modal: !this.state.modal
85 | });
86 | };
87 |
88 | render() {
89 | return (
90 |
91 |
92 |
93 |
94 | Today:
95 |
96 | {this.state.events.map(event => (
97 |
106 | ))}
107 |
108 |
109 |
110 |
111 | Add Event
112 |
113 |
114 |
115 |
116 |
117 | Schedule
118 |
119 | It's going to be busy that today. You have{" "}
120 | {this.state.events.length} events today.
121 |
122 |
123 |
124 |
125 |
126 |
127 | Sunny
128 |
129 |
130 |
131 |
132 |
133 | 23°C
134 |
135 |
136 |
137 | Don't forget your sunglasses. Today will dry and sunny, becoming
138 | warm in the afternoon with temperatures of between 20 and 25
139 | degrees.
140 |
141 |
142 |
143 |
144 |
145 |
146 |
151 | Add new event
152 |
153 |
154 |
190 |
191 |
192 | {
195 | this.toggleModal();
196 | this.addEvent();
197 | }}
198 | >
199 | Add
200 |
201 |
202 |
203 |
204 | );
205 | }
206 | }
207 |
208 | class Event extends Component {
209 | render() {
210 | return (
211 |
212 |
213 |
214 | {this.props.time}
215 |
216 |
217 |
this.props.onDelete(this.props.id)}
221 | >
222 | -
223 |
224 |
{this.props.title} {" "}
225 |
226 | {this.props.location && (
227 |
228 |
229 | {this.props.location}
230 |
231 |
232 | )}
233 |
234 |
235 | {this.props.description && (
236 |
237 | {this.props.description}
238 |
239 | )}
240 |
241 | );
242 | }
243 | }
244 |
245 | ReactDOM.render( , document.getElementById("root"));
246 |
--------------------------------------------------------------------------------
/lesson-2/src/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-2/src/logo.png
--------------------------------------------------------------------------------
/lesson-2/src/registerServiceWorker.js:
--------------------------------------------------------------------------------
1 | // In production, we register a service worker to serve assets from local cache.
2 |
3 | // This lets the app load faster on subsequent visits in production, and gives
4 | // it offline capabilities. However, it also means that developers (and users)
5 | // will only see deployed updates on the "N+1" visit to a page, since previously
6 | // cached resources are updated in the background.
7 |
8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
9 | // This link also includes instructions on opting out of this behavior.
10 |
11 | const isLocalhost = Boolean(
12 | window.location.hostname === "localhost" ||
13 | // [::1] is the IPv6 localhost address.
14 | window.location.hostname === "[::1]" ||
15 | // 127.0.0.1/8 is considered localhost for IPv4.
16 | window.location.hostname.match(
17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
18 | )
19 | );
20 |
21 | export default function register() {
22 | if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
23 | // The URL constructor is available in all browsers that support SW.
24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
25 | if (publicUrl.origin !== window.location.origin) {
26 | // Our service worker won't work if PUBLIC_URL is on a different origin
27 | // from what our page is served on. This might happen if a CDN is used to
28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
29 | return;
30 | }
31 |
32 | window.addEventListener("load", () => {
33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
34 |
35 | if (!isLocalhost) {
36 | // Is not local host. Just register service worker
37 | registerValidSW(swUrl);
38 | } else {
39 | // This is running on localhost. Lets check if a service worker still exists or not.
40 | checkValidServiceWorker(swUrl);
41 | }
42 | });
43 | }
44 | }
45 |
46 | function registerValidSW(swUrl) {
47 | navigator.serviceWorker
48 | .register(swUrl)
49 | .then(registration => {
50 | registration.onupdatefound = () => {
51 | const installingWorker = registration.installing;
52 | installingWorker.onstatechange = () => {
53 | if (installingWorker.state === "installed") {
54 | if (navigator.serviceWorker.controller) {
55 | // At this point, the old content will have been purged and
56 | // the fresh content will have been added to the cache.
57 | // It's the perfect time to display a "New content is
58 | // available; please refresh." message in your web app.
59 | console.log("New content is available; please refresh.");
60 | } else {
61 | // At this point, everything has been precached.
62 | // It's the perfect time to display a
63 | // "Content is cached for offline use." message.
64 | console.log("Content is cached for offline use.");
65 | }
66 | }
67 | };
68 | };
69 | })
70 | .catch(error => {
71 | console.error("Error during service worker registration:", error);
72 | });
73 | }
74 |
75 | function checkValidServiceWorker(swUrl) {
76 | // Check if the service worker can be found. If it can't reload the page.
77 | fetch(swUrl)
78 | .then(response => {
79 | // Ensure service worker exists, and that we really are getting a JS file.
80 | if (
81 | response.status === 404 ||
82 | response.headers.get("content-type").indexOf("javascript") === -1
83 | ) {
84 | // No service worker found. Probably a different app. Reload the page.
85 | navigator.serviceWorker.ready.then(registration => {
86 | registration.unregister().then(() => {
87 | window.location.reload();
88 | });
89 | });
90 | } else {
91 | // Service worker found. Proceed as normal.
92 | registerValidSW(swUrl);
93 | }
94 | })
95 | .catch(() => {
96 | console.log(
97 | "No internet connection found. App is running in offline mode."
98 | );
99 | });
100 | }
101 |
102 | export function unregister() {
103 | if ("serviceWorker" in navigator) {
104 | navigator.serviceWorker.ready.then(registration => {
105 | registration.unregister();
106 | });
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lesson-3/README.md:
--------------------------------------------------------------------------------
1 | # React Bootstrap with Material Design
2 | MDBootstrap for React
3 |
4 | ## Getting Started
5 | To test, contribute or just see what we did follow few easy steps:
6 | - clone the repository
7 | - cd to the directory with the repository
8 | - run `yarn install` (or `npm install` if you don't use yarn)
9 | - run the app using `yarn start` (or `npm start`)
10 | - to build project use `yarn run build` (od `npm run build`)
11 | - `yarn run remove-demo` (or `npm run remove-demo`) removes demo app pages
12 | - enjoy!
13 |
14 | ## Bugs
15 | If you want to report a bug or submit your idea feel fre to open an issue
16 |
17 | Before you report a bug, please take your time to find if an issue hasn't been reported yet
18 |
19 | We're also open to pull requests
20 |
21 | ## Something Missing?
22 | If you still have some questions do not hesitate to ask us. Open an issue or [visit our Slack](https://mdbbetatest.slack.com)
23 |
--------------------------------------------------------------------------------
/lesson-3/README.txt:
--------------------------------------------------------------------------------
1 | Material Design for Bootstrap
2 |
3 | Version: MDB React Free 4.8.5
4 |
5 | Documentation:
6 | https://mdbootstrap.com/react/
7 |
8 | Getting started:
9 | https://mdbootstrap.com/react/react-bootstrap-getting-started/
10 |
11 | FAQ
12 | https://mdbootstrap.com/faq/
13 |
14 | Support:
15 | https://mdbootstrap.com/support/cat/mdb-react/
16 |
17 | ChangeLog
18 | https://mdbootstrap.com/react/changelog/
19 |
20 | License:
21 | https://mdbootstrap.com/license/
22 |
23 | Facebook: https://facebook.com/mdbootstrap
24 | Twitter: https://twitter.com/MDBootstrap
25 | Google+: https://plus.google.com/u/0/+Mdbootstrap/posts
26 | Dribbble: https://dribbble.com/mdbootstrap
27 |
28 |
29 | Contact:
30 | office@mdbootstrap.com
31 |
--------------------------------------------------------------------------------
/lesson-3/license.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-3/license.pdf
--------------------------------------------------------------------------------
/lesson-3/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "your-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "mdbreact": "4.9.0",
7 | "react": "^16.6.0",
8 | "react-dom": "^16.6.0",
9 | "react-scripts": "2.0.5"
10 | },
11 | "scripts": {
12 | "start": "react-scripts start",
13 | "build": "react-scripts build",
14 | "test": "react-scripts test --env=jsdom",
15 | "eject": "react-scripts eject",
16 | "rename": "renamer --find App-clear.js --replace App.js ./src/App-clear.js",
17 | "remove-demo": "rimraf ./src/font ./src/img ./src/pages ./src/Routes.js ./src/App.js && npm run rename"
18 | },
19 | "devDependencies": {
20 | "renamer": "^1.0.0",
21 | "rimraf": "^2.6.2"
22 | },
23 | "browserslist": [
24 | ">0.2%",
25 | "not dead",
26 | "not ie <= 11",
27 | "not op_mini all"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/lesson-3/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
16 |
25 | React App
26 |
27 |
28 | You need to enable JavaScript to run this app.
29 |
30 |
31 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/lesson-3/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/lesson-3/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Button } from "mdbreact";
3 | import logo from './logo.png';
4 |
5 | class App extends Component {
6 | render() {
7 | return (
8 |
9 |
10 |
11 | Welcome to Your MDB React App
12 |
13 |
The application is configured and ready to import our components.
14 |
Check out our docs!
15 |
16 | );
17 | }
18 | }
19 |
20 | export default App;
--------------------------------------------------------------------------------
/lesson-3/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./App";
4 |
5 | it("renders without crashing", () => {
6 | const div = document.createElement("div");
7 | ReactDOM.render( , div);
8 | });
9 |
--------------------------------------------------------------------------------
/lesson-3/src/index.css:
--------------------------------------------------------------------------------
1 | div[class^="col"],
2 | div[class*=" col"] {
3 | border: 1px dotted black;
4 | }
5 |
--------------------------------------------------------------------------------
/lesson-3/src/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import ReactDOM from "react-dom";
3 | import '@fortawesome/fontawesome-free/css/all.min.css';
4 | import "bootstrap-css-only/css/bootstrap.min.css";
5 | import "mdbreact/dist/css/mdb.css";
6 | import { MDBContainer, MDBRow, MDBCol } from "mdbreact";
7 | import "./index.css";
8 |
9 | class App extends Component {
10 | state = {};
11 |
12 | render() {
13 | return (
14 |
15 |
16 |
17 | Left column
18 | Right column
19 |
20 |
21 |
22 | );
23 | }
24 | }
25 |
26 | ReactDOM.render( , document.getElementById("root"));
27 |
--------------------------------------------------------------------------------
/lesson-3/src/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-3/src/logo.png
--------------------------------------------------------------------------------
/lesson-3/src/registerServiceWorker.js:
--------------------------------------------------------------------------------
1 | // In production, we register a service worker to serve assets from local cache.
2 |
3 | // This lets the app load faster on subsequent visits in production, and gives
4 | // it offline capabilities. However, it also means that developers (and users)
5 | // will only see deployed updates on the "N+1" visit to a page, since previously
6 | // cached resources are updated in the background.
7 |
8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
9 | // This link also includes instructions on opting out of this behavior.
10 |
11 | const isLocalhost = Boolean(
12 | window.location.hostname === "localhost" ||
13 | // [::1] is the IPv6 localhost address.
14 | window.location.hostname === "[::1]" ||
15 | // 127.0.0.1/8 is considered localhost for IPv4.
16 | window.location.hostname.match(
17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
18 | )
19 | );
20 |
21 | export default function register() {
22 | if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
23 | // The URL constructor is available in all browsers that support SW.
24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
25 | if (publicUrl.origin !== window.location.origin) {
26 | // Our service worker won't work if PUBLIC_URL is on a different origin
27 | // from what our page is served on. This might happen if a CDN is used to
28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
29 | return;
30 | }
31 |
32 | window.addEventListener("load", () => {
33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
34 |
35 | if (!isLocalhost) {
36 | // Is not local host. Just register service worker
37 | registerValidSW(swUrl);
38 | } else {
39 | // This is running on localhost. Lets check if a service worker still exists or not.
40 | checkValidServiceWorker(swUrl);
41 | }
42 | });
43 | }
44 | }
45 |
46 | function registerValidSW(swUrl) {
47 | navigator.serviceWorker
48 | .register(swUrl)
49 | .then(registration => {
50 | registration.onupdatefound = () => {
51 | const installingWorker = registration.installing;
52 | installingWorker.onstatechange = () => {
53 | if (installingWorker.state === "installed") {
54 | if (navigator.serviceWorker.controller) {
55 | // At this point, the old content will have been purged and
56 | // the fresh content will have been added to the cache.
57 | // It's the perfect time to display a "New content is
58 | // available; please refresh." message in your web app.
59 | console.log("New content is available; please refresh.");
60 | } else {
61 | // At this point, everything has been precached.
62 | // It's the perfect time to display a
63 | // "Content is cached for offline use." message.
64 | console.log("Content is cached for offline use.");
65 | }
66 | }
67 | };
68 | };
69 | })
70 | .catch(error => {
71 | console.error("Error during service worker registration:", error);
72 | });
73 | }
74 |
75 | function checkValidServiceWorker(swUrl) {
76 | // Check if the service worker can be found. If it can't reload the page.
77 | fetch(swUrl)
78 | .then(response => {
79 | // Ensure service worker exists, and that we really are getting a JS file.
80 | if (
81 | response.status === 404 ||
82 | response.headers.get("content-type").indexOf("javascript") === -1
83 | ) {
84 | // No service worker found. Probably a different app. Reload the page.
85 | navigator.serviceWorker.ready.then(registration => {
86 | registration.unregister().then(() => {
87 | window.location.reload();
88 | });
89 | });
90 | } else {
91 | // Service worker found. Proceed as normal.
92 | registerValidSW(swUrl);
93 | }
94 | })
95 | .catch(() => {
96 | console.log(
97 | "No internet connection found. App is running in offline mode."
98 | );
99 | });
100 | }
101 |
102 | export function unregister() {
103 | if ("serviceWorker" in navigator) {
104 | navigator.serviceWorker.ready.then(registration => {
105 | registration.unregister();
106 | });
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lesson-4/README.md:
--------------------------------------------------------------------------------
1 | # React Bootstrap with Material Design
2 | MDBootstrap for React
3 |
4 | ## Getting Started
5 | To test, contribute or just see what we did follow few easy steps:
6 | - clone the repository
7 | - cd to the directory with the repository
8 | - run `yarn install` (or `npm install` if you don't use yarn)
9 | - run the app using `yarn start` (or `npm start`)
10 | - to build project use `yarn run build` (od `npm run build`)
11 | - `yarn run remove-demo` (or `npm run remove-demo`) removes demo app pages
12 | - enjoy!
13 |
14 | ## Bugs
15 | If you want to report a bug or submit your idea feel fre to open an issue
16 |
17 | Before you report a bug, please take your time to find if an issue hasn't been reported yet
18 |
19 | We're also open to pull requests
20 |
21 | ## Something Missing?
22 | If you still have some questions do not hesitate to ask us. Open an issue or [visit our Slack](https://mdbbetatest.slack.com)
23 |
--------------------------------------------------------------------------------
/lesson-4/README.txt:
--------------------------------------------------------------------------------
1 | Material Design for Bootstrap
2 |
3 | Version: MDB React Free 4.8.5
4 |
5 | Documentation:
6 | https://mdbootstrap.com/react/
7 |
8 | Getting started:
9 | https://mdbootstrap.com/react/react-bootstrap-getting-started/
10 |
11 | FAQ
12 | https://mdbootstrap.com/faq/
13 |
14 | Support:
15 | https://mdbootstrap.com/support/cat/mdb-react/
16 |
17 | ChangeLog
18 | https://mdbootstrap.com/react/changelog/
19 |
20 | License:
21 | https://mdbootstrap.com/license/
22 |
23 | Facebook: https://facebook.com/mdbootstrap
24 | Twitter: https://twitter.com/MDBootstrap
25 | Google+: https://plus.google.com/u/0/+Mdbootstrap/posts
26 | Dribbble: https://dribbble.com/mdbootstrap
27 |
28 |
29 | Contact:
30 | office@mdbootstrap.com
31 |
--------------------------------------------------------------------------------
/lesson-4/license.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-4/license.pdf
--------------------------------------------------------------------------------
/lesson-4/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "your-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "mdbreact": "4.9.0",
7 | "react": "^16.6.0",
8 | "react-dom": "^16.6.0",
9 | "react-scripts": "2.0.5"
10 | },
11 | "scripts": {
12 | "start": "react-scripts start",
13 | "build": "react-scripts build",
14 | "test": "react-scripts test --env=jsdom",
15 | "eject": "react-scripts eject",
16 | "rename": "renamer --find App-clear.js --replace App.js ./src/App-clear.js",
17 | "remove-demo": "rimraf ./src/font ./src/img ./src/pages ./src/Routes.js ./src/App.js && npm run rename"
18 | },
19 | "devDependencies": {
20 | "renamer": "^1.0.0",
21 | "rimraf": "^2.6.2"
22 | },
23 | "browserslist": [
24 | ">0.2%",
25 | "not dead",
26 | "not ie <= 11",
27 | "not op_mini all"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/lesson-4/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
16 |
25 | React App
26 |
27 |
28 | You need to enable JavaScript to run this app.
29 |
30 |
31 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/lesson-4/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/lesson-4/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Button } from "mdbreact";
3 | import logo from './logo.png';
4 |
5 | class App extends Component {
6 | render() {
7 | return (
8 |
9 |
10 |
11 | Welcome to Your MDB React App
12 |
13 |
The application is configured and ready to import our components.
14 |
Check out our docs!
15 |
16 | );
17 | }
18 | }
19 |
20 | export default App;
--------------------------------------------------------------------------------
/lesson-4/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./App";
4 |
5 | it("renders without crashing", () => {
6 | const div = document.createElement("div");
7 | ReactDOM.render( , div);
8 | });
9 |
--------------------------------------------------------------------------------
/lesson-4/src/index.css:
--------------------------------------------------------------------------------
1 | div[class^="col"],
2 | div[class*=" col"] {
3 | border: 1px dotted black;
4 | }
5 |
--------------------------------------------------------------------------------
/lesson-4/src/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import ReactDOM from "react-dom";
3 | import '@fortawesome/fontawesome-free/css/all.min.css';
4 | import "bootstrap-css-only/css/bootstrap.min.css";
5 | import "mdbreact/dist/css/mdb.css";
6 | import { MDBContainer, MDBRow, MDBCol } from "mdbreact";
7 | import "./index.css";
8 |
9 | class App extends Component {
10 | state = {};
11 |
12 | render() {
13 | return (
14 |
15 |
16 |
17 | Left column
18 | Right column
19 |
20 |
21 |
22 | );
23 | }
24 | }
25 |
26 | ReactDOM.render( , document.getElementById("root"));
27 |
--------------------------------------------------------------------------------
/lesson-4/src/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-4/src/logo.png
--------------------------------------------------------------------------------
/lesson-4/src/registerServiceWorker.js:
--------------------------------------------------------------------------------
1 | // In production, we register a service worker to serve assets from local cache.
2 |
3 | // This lets the app load faster on subsequent visits in production, and gives
4 | // it offline capabilities. However, it also means that developers (and users)
5 | // will only see deployed updates on the "N+1" visit to a page, since previously
6 | // cached resources are updated in the background.
7 |
8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
9 | // This link also includes instructions on opting out of this behavior.
10 |
11 | const isLocalhost = Boolean(
12 | window.location.hostname === "localhost" ||
13 | // [::1] is the IPv6 localhost address.
14 | window.location.hostname === "[::1]" ||
15 | // 127.0.0.1/8 is considered localhost for IPv4.
16 | window.location.hostname.match(
17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
18 | )
19 | );
20 |
21 | export default function register() {
22 | if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
23 | // The URL constructor is available in all browsers that support SW.
24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
25 | if (publicUrl.origin !== window.location.origin) {
26 | // Our service worker won't work if PUBLIC_URL is on a different origin
27 | // from what our page is served on. This might happen if a CDN is used to
28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
29 | return;
30 | }
31 |
32 | window.addEventListener("load", () => {
33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
34 |
35 | if (!isLocalhost) {
36 | // Is not local host. Just register service worker
37 | registerValidSW(swUrl);
38 | } else {
39 | // This is running on localhost. Lets check if a service worker still exists or not.
40 | checkValidServiceWorker(swUrl);
41 | }
42 | });
43 | }
44 | }
45 |
46 | function registerValidSW(swUrl) {
47 | navigator.serviceWorker
48 | .register(swUrl)
49 | .then(registration => {
50 | registration.onupdatefound = () => {
51 | const installingWorker = registration.installing;
52 | installingWorker.onstatechange = () => {
53 | if (installingWorker.state === "installed") {
54 | if (navigator.serviceWorker.controller) {
55 | // At this point, the old content will have been purged and
56 | // the fresh content will have been added to the cache.
57 | // It's the perfect time to display a "New content is
58 | // available; please refresh." message in your web app.
59 | console.log("New content is available; please refresh.");
60 | } else {
61 | // At this point, everything has been precached.
62 | // It's the perfect time to display a
63 | // "Content is cached for offline use." message.
64 | console.log("Content is cached for offline use.");
65 | }
66 | }
67 | };
68 | };
69 | })
70 | .catch(error => {
71 | console.error("Error during service worker registration:", error);
72 | });
73 | }
74 |
75 | function checkValidServiceWorker(swUrl) {
76 | // Check if the service worker can be found. If it can't reload the page.
77 | fetch(swUrl)
78 | .then(response => {
79 | // Ensure service worker exists, and that we really are getting a JS file.
80 | if (
81 | response.status === 404 ||
82 | response.headers.get("content-type").indexOf("javascript") === -1
83 | ) {
84 | // No service worker found. Probably a different app. Reload the page.
85 | navigator.serviceWorker.ready.then(registration => {
86 | registration.unregister().then(() => {
87 | window.location.reload();
88 | });
89 | });
90 | } else {
91 | // Service worker found. Proceed as normal.
92 | registerValidSW(swUrl);
93 | }
94 | })
95 | .catch(() => {
96 | console.log(
97 | "No internet connection found. App is running in offline mode."
98 | );
99 | });
100 | }
101 |
102 | export function unregister() {
103 | if ("serviceWorker" in navigator) {
104 | navigator.serviceWorker.ready.then(registration => {
105 | registration.unregister();
106 | });
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lesson-5/README.md:
--------------------------------------------------------------------------------
1 | # React Bootstrap with Material Design
2 | MDBootstrap for React
3 |
4 | ## Getting Started
5 | To test, contribute or just see what we did follow few easy steps:
6 | - clone the repository
7 | - cd to the directory with the repository
8 | - run `yarn install` (or `npm install` if you don't use yarn)
9 | - run the app using `yarn start` (or `npm start`)
10 | - to build project use `yarn run build` (od `npm run build`)
11 | - `yarn run remove-demo` (or `npm run remove-demo`) removes demo app pages
12 | - enjoy!
13 |
14 | ## Bugs
15 | If you want to report a bug or submit your idea feel fre to open an issue
16 |
17 | Before you report a bug, please take your time to find if an issue hasn't been reported yet
18 |
19 | We're also open to pull requests
20 |
21 | ## Something Missing?
22 | If you still have some questions do not hesitate to ask us. Open an issue or [visit our Slack](https://mdbbetatest.slack.com)
23 |
--------------------------------------------------------------------------------
/lesson-5/README.txt:
--------------------------------------------------------------------------------
1 | Material Design for Bootstrap
2 |
3 | Version: MDB React Free 4.8.5
4 |
5 | Documentation:
6 | https://mdbootstrap.com/react/
7 |
8 | Getting started:
9 | https://mdbootstrap.com/react/react-bootstrap-getting-started/
10 |
11 | FAQ
12 | https://mdbootstrap.com/faq/
13 |
14 | Support:
15 | https://mdbootstrap.com/support/cat/mdb-react/
16 |
17 | ChangeLog
18 | https://mdbootstrap.com/react/changelog/
19 |
20 | License:
21 | https://mdbootstrap.com/license/
22 |
23 | Facebook: https://facebook.com/mdbootstrap
24 | Twitter: https://twitter.com/MDBootstrap
25 | Google+: https://plus.google.com/u/0/+Mdbootstrap/posts
26 | Dribbble: https://dribbble.com/mdbootstrap
27 |
28 |
29 | Contact:
30 | office@mdbootstrap.com
31 |
--------------------------------------------------------------------------------
/lesson-5/license.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-5/license.pdf
--------------------------------------------------------------------------------
/lesson-5/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "your-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "mdbreact": "4.9.0",
7 | "react": "^16.6.0",
8 | "react-dom": "^16.6.0",
9 | "react-scripts": "2.0.5"
10 | },
11 | "scripts": {
12 | "start": "react-scripts start",
13 | "build": "react-scripts build",
14 | "test": "react-scripts test --env=jsdom",
15 | "eject": "react-scripts eject",
16 | "rename": "renamer --find App-clear.js --replace App.js ./src/App-clear.js",
17 | "remove-demo": "rimraf ./src/font ./src/img ./src/pages ./src/Routes.js ./src/App.js && npm run rename"
18 | },
19 | "devDependencies": {
20 | "renamer": "^1.0.0",
21 | "rimraf": "^2.6.2"
22 | },
23 | "browserslist": [
24 | ">0.2%",
25 | "not dead",
26 | "not ie <= 11",
27 | "not op_mini all"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/lesson-5/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
16 |
25 | React App
26 |
27 |
28 | You need to enable JavaScript to run this app.
29 |
30 |
31 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/lesson-5/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/lesson-5/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Button } from "mdbreact";
3 | import logo from './logo.png';
4 |
5 | class App extends Component {
6 | render() {
7 | return (
8 |
9 |
10 |
11 | Welcome to Your MDB React App
12 |
13 |
The application is configured and ready to import our components.
14 |
Check out our docs!
15 |
16 | );
17 | }
18 | }
19 |
20 | export default App;
--------------------------------------------------------------------------------
/lesson-5/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./App";
4 |
5 | it("renders without crashing", () => {
6 | const div = document.createElement("div");
7 | ReactDOM.render( , div);
8 | });
9 |
--------------------------------------------------------------------------------
/lesson-5/src/index.css:
--------------------------------------------------------------------------------
1 | div[class^="col"],
2 | div[class*=" col"] {
3 | border: 1px dotted black;
4 | }
5 |
--------------------------------------------------------------------------------
/lesson-5/src/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import ReactDOM from "react-dom";
3 | import '@fortawesome/fontawesome-free/css/all.min.css';
4 | import "bootstrap-css-only/css/bootstrap.min.css";
5 | import "mdbreact/dist/css/mdb.css";
6 | import { MDBContainer, MDBRow, MDBCol } from "mdbreact";
7 | import "./index.css";
8 |
9 | class App extends Component {
10 | state = {};
11 |
12 | render() {
13 | return (
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | );
26 | }
27 | }
28 |
29 | class Event extends Component {
30 | render() {
31 | return (
32 |
33 | 10:00 - Title
34 |
35 | );
36 | }
37 | }
38 |
39 | ReactDOM.render( , document.getElementById("root"));
40 |
--------------------------------------------------------------------------------
/lesson-5/src/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-5/src/logo.png
--------------------------------------------------------------------------------
/lesson-5/src/registerServiceWorker.js:
--------------------------------------------------------------------------------
1 | // In production, we register a service worker to serve assets from local cache.
2 |
3 | // This lets the app load faster on subsequent visits in production, and gives
4 | // it offline capabilities. However, it also means that developers (and users)
5 | // will only see deployed updates on the "N+1" visit to a page, since previously
6 | // cached resources are updated in the background.
7 |
8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
9 | // This link also includes instructions on opting out of this behavior.
10 |
11 | const isLocalhost = Boolean(
12 | window.location.hostname === "localhost" ||
13 | // [::1] is the IPv6 localhost address.
14 | window.location.hostname === "[::1]" ||
15 | // 127.0.0.1/8 is considered localhost for IPv4.
16 | window.location.hostname.match(
17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
18 | )
19 | );
20 |
21 | export default function register() {
22 | if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
23 | // The URL constructor is available in all browsers that support SW.
24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
25 | if (publicUrl.origin !== window.location.origin) {
26 | // Our service worker won't work if PUBLIC_URL is on a different origin
27 | // from what our page is served on. This might happen if a CDN is used to
28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
29 | return;
30 | }
31 |
32 | window.addEventListener("load", () => {
33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
34 |
35 | if (!isLocalhost) {
36 | // Is not local host. Just register service worker
37 | registerValidSW(swUrl);
38 | } else {
39 | // This is running on localhost. Lets check if a service worker still exists or not.
40 | checkValidServiceWorker(swUrl);
41 | }
42 | });
43 | }
44 | }
45 |
46 | function registerValidSW(swUrl) {
47 | navigator.serviceWorker
48 | .register(swUrl)
49 | .then(registration => {
50 | registration.onupdatefound = () => {
51 | const installingWorker = registration.installing;
52 | installingWorker.onstatechange = () => {
53 | if (installingWorker.state === "installed") {
54 | if (navigator.serviceWorker.controller) {
55 | // At this point, the old content will have been purged and
56 | // the fresh content will have been added to the cache.
57 | // It's the perfect time to display a "New content is
58 | // available; please refresh." message in your web app.
59 | console.log("New content is available; please refresh.");
60 | } else {
61 | // At this point, everything has been precached.
62 | // It's the perfect time to display a
63 | // "Content is cached for offline use." message.
64 | console.log("Content is cached for offline use.");
65 | }
66 | }
67 | };
68 | };
69 | })
70 | .catch(error => {
71 | console.error("Error during service worker registration:", error);
72 | });
73 | }
74 |
75 | function checkValidServiceWorker(swUrl) {
76 | // Check if the service worker can be found. If it can't reload the page.
77 | fetch(swUrl)
78 | .then(response => {
79 | // Ensure service worker exists, and that we really are getting a JS file.
80 | if (
81 | response.status === 404 ||
82 | response.headers.get("content-type").indexOf("javascript") === -1
83 | ) {
84 | // No service worker found. Probably a different app. Reload the page.
85 | navigator.serviceWorker.ready.then(registration => {
86 | registration.unregister().then(() => {
87 | window.location.reload();
88 | });
89 | });
90 | } else {
91 | // Service worker found. Proceed as normal.
92 | registerValidSW(swUrl);
93 | }
94 | })
95 | .catch(() => {
96 | console.log(
97 | "No internet connection found. App is running in offline mode."
98 | );
99 | });
100 | }
101 |
102 | export function unregister() {
103 | if ("serviceWorker" in navigator) {
104 | navigator.serviceWorker.ready.then(registration => {
105 | registration.unregister();
106 | });
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lesson-6/README.md:
--------------------------------------------------------------------------------
1 | # React Bootstrap with Material Design
2 | MDBootstrap for React
3 |
4 | ## Getting Started
5 | To test, contribute or just see what we did follow few easy steps:
6 | - clone the repository
7 | - cd to the directory with the repository
8 | - run `yarn install` (or `npm install` if you don't use yarn)
9 | - run the app using `yarn start` (or `npm start`)
10 | - to build project use `yarn run build` (od `npm run build`)
11 | - `yarn run remove-demo` (or `npm run remove-demo`) removes demo app pages
12 | - enjoy!
13 |
14 | ## Bugs
15 | If you want to report a bug or submit your idea feel fre to open an issue
16 |
17 | Before you report a bug, please take your time to find if an issue hasn't been reported yet
18 |
19 | We're also open to pull requests
20 |
21 | ## Something Missing?
22 | If you still have some questions do not hesitate to ask us. Open an issue or [visit our Slack](https://mdbbetatest.slack.com)
23 |
--------------------------------------------------------------------------------
/lesson-6/README.txt:
--------------------------------------------------------------------------------
1 | Material Design for Bootstrap
2 |
3 | Version: MDB React Free 4.8.5
4 |
5 | Documentation:
6 | https://mdbootstrap.com/react/
7 |
8 | Getting started:
9 | https://mdbootstrap.com/react/react-bootstrap-getting-started/
10 |
11 | FAQ
12 | https://mdbootstrap.com/faq/
13 |
14 | Support:
15 | https://mdbootstrap.com/support/cat/mdb-react/
16 |
17 | ChangeLog
18 | https://mdbootstrap.com/react/changelog/
19 |
20 | License:
21 | https://mdbootstrap.com/license/
22 |
23 | Facebook: https://facebook.com/mdbootstrap
24 | Twitter: https://twitter.com/MDBootstrap
25 | Google+: https://plus.google.com/u/0/+Mdbootstrap/posts
26 | Dribbble: https://dribbble.com/mdbootstrap
27 |
28 |
29 | Contact:
30 | office@mdbootstrap.com
31 |
--------------------------------------------------------------------------------
/lesson-6/license.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-6/license.pdf
--------------------------------------------------------------------------------
/lesson-6/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "your-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "mdbreact": "4.9.0",
7 | "react": "^16.6.0",
8 | "react-dom": "^16.6.0",
9 | "react-scripts": "2.0.5"
10 | },
11 | "scripts": {
12 | "start": "react-scripts start",
13 | "build": "react-scripts build",
14 | "test": "react-scripts test --env=jsdom",
15 | "eject": "react-scripts eject",
16 | "rename": "renamer --find App-clear.js --replace App.js ./src/App-clear.js",
17 | "remove-demo": "rimraf ./src/font ./src/img ./src/pages ./src/Routes.js ./src/App.js && npm run rename"
18 | },
19 | "devDependencies": {
20 | "renamer": "^1.0.0",
21 | "rimraf": "^2.6.2"
22 | },
23 | "browserslist": [
24 | ">0.2%",
25 | "not dead",
26 | "not ie <= 11",
27 | "not op_mini all"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/lesson-6/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
16 |
25 | React App
26 |
27 |
28 | You need to enable JavaScript to run this app.
29 |
30 |
31 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/lesson-6/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/lesson-6/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Button } from "mdbreact";
3 | import logo from './logo.png';
4 |
5 | class App extends Component {
6 | render() {
7 | return (
8 |
9 |
10 |
11 | Welcome to Your MDB React App
12 |
13 |
The application is configured and ready to import our components.
14 |
Check out our docs!
15 |
16 | );
17 | }
18 | }
19 |
20 | export default App;
--------------------------------------------------------------------------------
/lesson-6/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./App";
4 |
5 | it("renders without crashing", () => {
6 | const div = document.createElement("div");
7 | ReactDOM.render( , div);
8 | });
9 |
--------------------------------------------------------------------------------
/lesson-6/src/index.css:
--------------------------------------------------------------------------------
1 | div[class^="col"],
2 | div[class*=" col"] {
3 | border: 1px dotted black;
4 | }
5 |
--------------------------------------------------------------------------------
/lesson-6/src/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import ReactDOM from "react-dom";
3 | import '@fortawesome/fontawesome-free/css/all.min.css';
4 | import "bootstrap-css-only/css/bootstrap.min.css";
5 | import "mdbreact/dist/css/mdb.css";
6 | import { MDBContainer, MDBRow, MDBCol } from "mdbreact";
7 | import "./index.css";
8 |
9 | class App extends Component {
10 | state = {};
11 |
12 | render() {
13 | return (
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | );
26 | }
27 | }
28 |
29 | class Event extends Component {
30 | render() {
31 | return (
32 |
33 |
34 | {this.props.time} - {this.props.title}
35 |
36 | Change my title
37 |
38 | );
39 | }
40 | }
41 |
42 | ReactDOM.render( , document.getElementById("root"));
43 |
--------------------------------------------------------------------------------
/lesson-6/src/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-6/src/logo.png
--------------------------------------------------------------------------------
/lesson-7/README.md:
--------------------------------------------------------------------------------
1 | # React Bootstrap with Material Design
2 | MDBootstrap for React
3 |
4 | ## Getting Started
5 | To test, contribute or just see what we did follow few easy steps:
6 | - clone the repository
7 | - cd to the directory with the repository
8 | - run `yarn install` (or `npm install` if you don't use yarn)
9 | - run the app using `yarn start` (or `npm start`)
10 | - to build project use `yarn run build` (od `npm run build`)
11 | - `yarn run remove-demo` (or `npm run remove-demo`) removes demo app pages
12 | - enjoy!
13 |
14 | ## Bugs
15 | If you want to report a bug or submit your idea feel fre to open an issue
16 |
17 | Before you report a bug, please take your time to find if an issue hasn't been reported yet
18 |
19 | We're also open to pull requests
20 |
21 | ## Something Missing?
22 | If you still have some questions do not hesitate to ask us. Open an issue or [visit our Slack](https://mdbbetatest.slack.com)
23 |
--------------------------------------------------------------------------------
/lesson-7/README.txt:
--------------------------------------------------------------------------------
1 | Material Design for Bootstrap
2 |
3 | Version: MDB React Free 4.8.5
4 |
5 | Documentation:
6 | https://mdbootstrap.com/react/
7 |
8 | Getting started:
9 | https://mdbootstrap.com/react/react-bootstrap-getting-started/
10 |
11 | FAQ
12 | https://mdbootstrap.com/faq/
13 |
14 | Support:
15 | https://mdbootstrap.com/support/cat/mdb-react/
16 |
17 | ChangeLog
18 | https://mdbootstrap.com/react/changelog/
19 |
20 | License:
21 | https://mdbootstrap.com/license/
22 |
23 | Facebook: https://facebook.com/mdbootstrap
24 | Twitter: https://twitter.com/MDBootstrap
25 | Google+: https://plus.google.com/u/0/+Mdbootstrap/posts
26 | Dribbble: https://dribbble.com/mdbootstrap
27 |
28 |
29 | Contact:
30 | office@mdbootstrap.com
31 |
--------------------------------------------------------------------------------
/lesson-7/license.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-7/license.pdf
--------------------------------------------------------------------------------
/lesson-7/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "your-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "mdbreact": "4.9.0",
7 | "react": "^16.6.0",
8 | "react-dom": "^16.6.0",
9 | "react-scripts": "2.0.5"
10 | },
11 | "scripts": {
12 | "start": "react-scripts start",
13 | "build": "react-scripts build",
14 | "test": "react-scripts test --env=jsdom",
15 | "eject": "react-scripts eject",
16 | "rename": "renamer --find App-clear.js --replace App.js ./src/App-clear.js",
17 | "remove-demo": "rimraf ./src/font ./src/img ./src/pages ./src/Routes.js ./src/App.js && npm run rename"
18 | },
19 | "devDependencies": {
20 | "renamer": "^1.0.0",
21 | "rimraf": "^2.6.2"
22 | },
23 | "browserslist": [
24 | ">0.2%",
25 | "not dead",
26 | "not ie <= 11",
27 | "not op_mini all"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/lesson-7/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
16 |
25 | React App
26 |
27 |
28 | You need to enable JavaScript to run this app.
29 |
30 |
31 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/lesson-7/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/lesson-7/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Button } from "mdbreact";
3 | import logo from './logo.png';
4 |
5 | class App extends Component {
6 | render() {
7 | return (
8 |
9 |
10 |
11 | Welcome to Your MDB React App
12 |
13 |
The application is configured and ready to import our components.
14 |
Check out our docs!
15 |
16 | );
17 | }
18 | }
19 |
20 | export default App;
--------------------------------------------------------------------------------
/lesson-7/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./App";
4 |
5 | it("renders without crashing", () => {
6 | const div = document.createElement("div");
7 | ReactDOM.render( , div);
8 | });
9 |
--------------------------------------------------------------------------------
/lesson-7/src/index.css:
--------------------------------------------------------------------------------
1 | div[class^="col"],
2 | div[class*=" col"] {
3 | border: 1px dotted black;
4 | }
5 |
--------------------------------------------------------------------------------
/lesson-7/src/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import ReactDOM from "react-dom";
3 | import '@fortawesome/fontawesome-free/css/all.min.css';
4 | import "bootstrap-css-only/css/bootstrap.min.css";
5 | import "mdbreact/dist/css/mdb.css";
6 | import { MDBContainer, MDBRow, MDBCol } from "mdbreact";
7 | import "./index.css";
8 |
9 | class App extends Component {
10 | state = {};
11 |
12 | render() {
13 | return (
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | );
25 | }
26 | }
27 |
28 | class Event extends Component {
29 | render() {
30 | return (
31 |
32 |
33 | {this.props.time} - {this.props.title}
34 |
35 |
36 | );
37 | }
38 | }
39 |
40 | ReactDOM.render( , document.getElementById("root"));
41 |
--------------------------------------------------------------------------------
/lesson-7/src/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-7/src/logo.png
--------------------------------------------------------------------------------
/lesson-7/src/registerServiceWorker.js:
--------------------------------------------------------------------------------
1 | // In production, we register a service worker to serve assets from local cache.
2 |
3 | // This lets the app load faster on subsequent visits in production, and gives
4 | // it offline capabilities. However, it also means that developers (and users)
5 | // will only see deployed updates on the "N+1" visit to a page, since previously
6 | // cached resources are updated in the background.
7 |
8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
9 | // This link also includes instructions on opting out of this behavior.
10 |
11 | const isLocalhost = Boolean(
12 | window.location.hostname === "localhost" ||
13 | // [::1] is the IPv6 localhost address.
14 | window.location.hostname === "[::1]" ||
15 | // 127.0.0.1/8 is considered localhost for IPv4.
16 | window.location.hostname.match(
17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
18 | )
19 | );
20 |
21 | export default function register() {
22 | if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
23 | // The URL constructor is available in all browsers that support SW.
24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
25 | if (publicUrl.origin !== window.location.origin) {
26 | // Our service worker won't work if PUBLIC_URL is on a different origin
27 | // from what our page is served on. This might happen if a CDN is used to
28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
29 | return;
30 | }
31 |
32 | window.addEventListener("load", () => {
33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
34 |
35 | if (!isLocalhost) {
36 | // Is not local host. Just register service worker
37 | registerValidSW(swUrl);
38 | } else {
39 | // This is running on localhost. Lets check if a service worker still exists or not.
40 | checkValidServiceWorker(swUrl);
41 | }
42 | });
43 | }
44 | }
45 |
46 | function registerValidSW(swUrl) {
47 | navigator.serviceWorker
48 | .register(swUrl)
49 | .then(registration => {
50 | registration.onupdatefound = () => {
51 | const installingWorker = registration.installing;
52 | installingWorker.onstatechange = () => {
53 | if (installingWorker.state === "installed") {
54 | if (navigator.serviceWorker.controller) {
55 | // At this point, the old content will have been purged and
56 | // the fresh content will have been added to the cache.
57 | // It's the perfect time to display a "New content is
58 | // available; please refresh." message in your web app.
59 | console.log("New content is available; please refresh.");
60 | } else {
61 | // At this point, everything has been precached.
62 | // It's the perfect time to display a
63 | // "Content is cached for offline use." message.
64 | console.log("Content is cached for offline use.");
65 | }
66 | }
67 | };
68 | };
69 | })
70 | .catch(error => {
71 | console.error("Error during service worker registration:", error);
72 | });
73 | }
74 |
75 | function checkValidServiceWorker(swUrl) {
76 | // Check if the service worker can be found. If it can't reload the page.
77 | fetch(swUrl)
78 | .then(response => {
79 | // Ensure service worker exists, and that we really are getting a JS file.
80 | if (
81 | response.status === 404 ||
82 | response.headers.get("content-type").indexOf("javascript") === -1
83 | ) {
84 | // No service worker found. Probably a different app. Reload the page.
85 | navigator.serviceWorker.ready.then(registration => {
86 | registration.unregister().then(() => {
87 | window.location.reload();
88 | });
89 | });
90 | } else {
91 | // Service worker found. Proceed as normal.
92 | registerValidSW(swUrl);
93 | }
94 | })
95 | .catch(() => {
96 | console.log(
97 | "No internet connection found. App is running in offline mode."
98 | );
99 | });
100 | }
101 |
102 | export function unregister() {
103 | if ("serviceWorker" in navigator) {
104 | navigator.serviceWorker.ready.then(registration => {
105 | registration.unregister();
106 | });
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lesson-8/README.md:
--------------------------------------------------------------------------------
1 | # React Bootstrap with Material Design
2 | MDBootstrap for React
3 |
4 | ## Getting Started
5 | To test, contribute or just see what we did follow few easy steps:
6 | - clone the repository
7 | - cd to the directory with the repository
8 | - run `yarn install` (or `npm install` if you don't use yarn)
9 | - run the app using `yarn start` (or `npm start`)
10 | - to build project use `yarn run build` (od `npm run build`)
11 | - `yarn run remove-demo` (or `npm run remove-demo`) removes demo app pages
12 | - enjoy!
13 |
14 | ## Bugs
15 | If you want to report a bug or submit your idea feel fre to open an issue
16 |
17 | Before you report a bug, please take your time to find if an issue hasn't been reported yet
18 |
19 | We're also open to pull requests
20 |
21 | ## Something Missing?
22 | If you still have some questions do not hesitate to ask us. Open an issue or [visit our Slack](https://mdbbetatest.slack.com)
23 |
--------------------------------------------------------------------------------
/lesson-8/README.txt:
--------------------------------------------------------------------------------
1 | Material Design for Bootstrap
2 |
3 | Version: MDB React Free 4.8.5
4 |
5 | Documentation:
6 | https://mdbootstrap.com/react/
7 |
8 | Getting started:
9 | https://mdbootstrap.com/react/react-bootstrap-getting-started/
10 |
11 | FAQ
12 | https://mdbootstrap.com/faq/
13 |
14 | Support:
15 | https://mdbootstrap.com/support/cat/mdb-react/
16 |
17 | ChangeLog
18 | https://mdbootstrap.com/react/changelog/
19 |
20 | License:
21 | https://mdbootstrap.com/license/
22 |
23 | Facebook: https://facebook.com/mdbootstrap
24 | Twitter: https://twitter.com/MDBootstrap
25 | Google+: https://plus.google.com/u/0/+Mdbootstrap/posts
26 | Dribbble: https://dribbble.com/mdbootstrap
27 |
28 |
29 | Contact:
30 | office@mdbootstrap.com
31 |
--------------------------------------------------------------------------------
/lesson-8/license.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-8/license.pdf
--------------------------------------------------------------------------------
/lesson-8/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "your-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "mdbreact": "4.9.0",
7 | "react": "^16.6.0",
8 | "react-dom": "^16.6.0",
9 | "react-scripts": "2.0.5"
10 | },
11 | "scripts": {
12 | "start": "react-scripts start",
13 | "build": "react-scripts build",
14 | "test": "react-scripts test --env=jsdom",
15 | "eject": "react-scripts eject",
16 | "rename": "renamer --find App-clear.js --replace App.js ./src/App-clear.js",
17 | "remove-demo": "rimraf ./src/font ./src/img ./src/pages ./src/Routes.js ./src/App.js && npm run rename"
18 | },
19 | "devDependencies": {
20 | "renamer": "^1.0.0",
21 | "rimraf": "^2.6.2"
22 | },
23 | "browserslist": [
24 | ">0.2%",
25 | "not dead",
26 | "not ie <= 11",
27 | "not op_mini all"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/lesson-8/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
16 |
25 | React App
26 |
27 |
28 | You need to enable JavaScript to run this app.
29 |
30 |
31 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/lesson-8/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/lesson-8/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Button } from "mdbreact";
3 | import logo from './logo.png';
4 |
5 | class App extends Component {
6 | render() {
7 | return (
8 |
9 |
10 |
11 | Welcome to Your MDB React App
12 |
13 |
The application is configured and ready to import our components.
14 |
Check out our docs!
15 |
16 | );
17 | }
18 | }
19 |
20 | export default App;
--------------------------------------------------------------------------------
/lesson-8/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./App";
4 |
5 | it("renders without crashing", () => {
6 | const div = document.createElement("div");
7 | ReactDOM.render( , div);
8 | });
9 |
--------------------------------------------------------------------------------
/lesson-8/src/index.css:
--------------------------------------------------------------------------------
1 | div[class^="col"],
2 | div[class*=" col"] {
3 | border: 1px dotted black;
4 | }
5 |
--------------------------------------------------------------------------------
/lesson-8/src/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import ReactDOM from "react-dom";
3 | import '@fortawesome/fontawesome-free/css/all.min.css';
4 | import "bootstrap-css-only/css/bootstrap.min.css";
5 | import "mdbreact/dist/css/mdb.css";
6 | import { MDBContainer, MDBRow, MDBCol } from "mdbreact";
7 | import "./index.css";
8 |
9 | class App extends Component {
10 | constructor(props) {
11 | super(props);
12 | this.state = {
13 | events: [
14 | {
15 | id: 1,
16 | time: "10:00",
17 | title: "Breakfast with Simon",
18 | location: "Lounge Caffe",
19 | description: "Discuss Q3 targets"
20 | },
21 | {
22 | id: 2,
23 | time: "10:30",
24 | title: "Daily Standup Meeting (recurring)",
25 | location: "Warsaw Spire Office"
26 | },
27 | { id: 3, time: "11:00", title: "Call with HRs" },
28 | {
29 | id: 4,
30 | time: "12:00",
31 | title: "Lunch with Timmoty",
32 | location: "Canteen",
33 | description:
34 | "Project evalutation ile declaring a variable and using an if statement is a fine way to conditionally render a component, sometimes you might want to use a"
35 | }
36 | ]
37 | };
38 | }
39 |
40 | render() {
41 | return (
42 |
43 |
44 |
45 |
46 | {this.state.events.map(event => (
47 |
55 | ))}
56 |
57 |
58 |
59 |
60 |
61 | );
62 | }
63 | }
64 |
65 | class Event extends Component {
66 | render() {
67 | return (
68 |
69 |
70 | {this.props.time} - {this.props.title}
71 |
72 | Location: {this.props.location}
73 | Desc: {this.props.description}
74 |
75 | );
76 | }
77 | }
78 |
79 | ReactDOM.render( , document.getElementById("root"));
80 |
--------------------------------------------------------------------------------
/lesson-8/src/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-8/src/logo.png
--------------------------------------------------------------------------------
/lesson-8/src/registerServiceWorker.js:
--------------------------------------------------------------------------------
1 | // In production, we register a service worker to serve assets from local cache.
2 |
3 | // This lets the app load faster on subsequent visits in production, and gives
4 | // it offline capabilities. However, it also means that developers (and users)
5 | // will only see deployed updates on the "N+1" visit to a page, since previously
6 | // cached resources are updated in the background.
7 |
8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
9 | // This link also includes instructions on opting out of this behavior.
10 |
11 | const isLocalhost = Boolean(
12 | window.location.hostname === "localhost" ||
13 | // [::1] is the IPv6 localhost address.
14 | window.location.hostname === "[::1]" ||
15 | // 127.0.0.1/8 is considered localhost for IPv4.
16 | window.location.hostname.match(
17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
18 | )
19 | );
20 |
21 | export default function register() {
22 | if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
23 | // The URL constructor is available in all browsers that support SW.
24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
25 | if (publicUrl.origin !== window.location.origin) {
26 | // Our service worker won't work if PUBLIC_URL is on a different origin
27 | // from what our page is served on. This might happen if a CDN is used to
28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
29 | return;
30 | }
31 |
32 | window.addEventListener("load", () => {
33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
34 |
35 | if (!isLocalhost) {
36 | // Is not local host. Just register service worker
37 | registerValidSW(swUrl);
38 | } else {
39 | // This is running on localhost. Lets check if a service worker still exists or not.
40 | checkValidServiceWorker(swUrl);
41 | }
42 | });
43 | }
44 | }
45 |
46 | function registerValidSW(swUrl) {
47 | navigator.serviceWorker
48 | .register(swUrl)
49 | .then(registration => {
50 | registration.onupdatefound = () => {
51 | const installingWorker = registration.installing;
52 | installingWorker.onstatechange = () => {
53 | if (installingWorker.state === "installed") {
54 | if (navigator.serviceWorker.controller) {
55 | // At this point, the old content will have been purged and
56 | // the fresh content will have been added to the cache.
57 | // It's the perfect time to display a "New content is
58 | // available; please refresh." message in your web app.
59 | console.log("New content is available; please refresh.");
60 | } else {
61 | // At this point, everything has been precached.
62 | // It's the perfect time to display a
63 | // "Content is cached for offline use." message.
64 | console.log("Content is cached for offline use.");
65 | }
66 | }
67 | };
68 | };
69 | })
70 | .catch(error => {
71 | console.error("Error during service worker registration:", error);
72 | });
73 | }
74 |
75 | function checkValidServiceWorker(swUrl) {
76 | // Check if the service worker can be found. If it can't reload the page.
77 | fetch(swUrl)
78 | .then(response => {
79 | // Ensure service worker exists, and that we really are getting a JS file.
80 | if (
81 | response.status === 404 ||
82 | response.headers.get("content-type").indexOf("javascript") === -1
83 | ) {
84 | // No service worker found. Probably a different app. Reload the page.
85 | navigator.serviceWorker.ready.then(registration => {
86 | registration.unregister().then(() => {
87 | window.location.reload();
88 | });
89 | });
90 | } else {
91 | // Service worker found. Proceed as normal.
92 | registerValidSW(swUrl);
93 | }
94 | })
95 | .catch(() => {
96 | console.log(
97 | "No internet connection found. App is running in offline mode."
98 | );
99 | });
100 | }
101 |
102 | export function unregister() {
103 | if ("serviceWorker" in navigator) {
104 | navigator.serviceWorker.ready.then(registration => {
105 | registration.unregister();
106 | });
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lesson-9/README.md:
--------------------------------------------------------------------------------
1 | # React Bootstrap with Material Design
2 | MDBootstrap for React
3 |
4 | ## Getting Started
5 | To test, contribute or just see what we did follow few easy steps:
6 | - clone the repository
7 | - cd to the directory with the repository
8 | - run `yarn install` (or `npm install` if you don't use yarn)
9 | - run the app using `yarn start` (or `npm start`)
10 | - to build project use `yarn run build` (od `npm run build`)
11 | - `yarn run remove-demo` (or `npm run remove-demo`) removes demo app pages
12 | - enjoy!
13 |
14 | ## Bugs
15 | If you want to report a bug or submit your idea feel fre to open an issue
16 |
17 | Before you report a bug, please take your time to find if an issue hasn't been reported yet
18 |
19 | We're also open to pull requests
20 |
21 | ## Something Missing?
22 | If you still have some questions do not hesitate to ask us. Open an issue or [visit our Slack](https://mdbbetatest.slack.com)
23 |
--------------------------------------------------------------------------------
/lesson-9/README.txt:
--------------------------------------------------------------------------------
1 | Material Design for Bootstrap
2 |
3 | Version: MDB React Free 4.8.5
4 |
5 | Documentation:
6 | https://mdbootstrap.com/react/
7 |
8 | Getting started:
9 | https://mdbootstrap.com/react/react-bootstrap-getting-started/
10 |
11 | FAQ
12 | https://mdbootstrap.com/faq/
13 |
14 | Support:
15 | https://mdbootstrap.com/support/cat/mdb-react/
16 |
17 | ChangeLog
18 | https://mdbootstrap.com/react/changelog/
19 |
20 | License:
21 | https://mdbootstrap.com/license/
22 |
23 | Facebook: https://facebook.com/mdbootstrap
24 | Twitter: https://twitter.com/MDBootstrap
25 | Google+: https://plus.google.com/u/0/+Mdbootstrap/posts
26 | Dribbble: https://dribbble.com/mdbootstrap
27 |
28 |
29 | Contact:
30 | office@mdbootstrap.com
31 |
--------------------------------------------------------------------------------
/lesson-9/license.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-9/license.pdf
--------------------------------------------------------------------------------
/lesson-9/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "your-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "mdbreact": "4.9.0",
7 | "react": "^16.6.0",
8 | "react-dom": "^16.6.0",
9 | "react-scripts": "2.0.5"
10 | },
11 | "scripts": {
12 | "start": "react-scripts start",
13 | "build": "react-scripts build",
14 | "test": "react-scripts test --env=jsdom",
15 | "eject": "react-scripts eject",
16 | "rename": "renamer --find App-clear.js --replace App.js ./src/App-clear.js",
17 | "remove-demo": "rimraf ./src/font ./src/img ./src/pages ./src/Routes.js ./src/App.js && npm run rename"
18 | },
19 | "devDependencies": {
20 | "renamer": "^1.0.0",
21 | "rimraf": "^2.6.2"
22 | },
23 | "browserslist": [
24 | ">0.2%",
25 | "not dead",
26 | "not ie <= 11",
27 | "not op_mini all"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/lesson-9/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
16 |
25 | React App
26 |
27 |
28 | You need to enable JavaScript to run this app.
29 |
30 |
31 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/lesson-9/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/lesson-9/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Button } from "mdbreact";
3 | import logo from './logo.png';
4 |
5 | class App extends Component {
6 | render() {
7 | return (
8 |
9 |
10 |
11 | Welcome to Your MDB React App
12 |
13 |
The application is configured and ready to import our components.
14 |
Check out our docs!
15 |
16 | );
17 | }
18 | }
19 |
20 | export default App;
--------------------------------------------------------------------------------
/lesson-9/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./App";
4 |
5 | it("renders without crashing", () => {
6 | const div = document.createElement("div");
7 | ReactDOM.render( , div);
8 | });
9 |
--------------------------------------------------------------------------------
/lesson-9/src/index.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-9/src/index.css
--------------------------------------------------------------------------------
/lesson-9/src/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import ReactDOM from "react-dom";
3 | import '@fortawesome/fontawesome-free/css/all.min.css';
4 | import "bootstrap-css-only/css/bootstrap.min.css";
5 | import "mdbreact/dist/css/mdb.css";
6 | import {
7 | MDBBtn,
8 | MDBInput,
9 | MDBModal,
10 | MDBModalBody,
11 | MDBModalHeader,
12 | MDBModalFooter,
13 | MDBIcon,
14 | MDBBadge,
15 | MDBContainer,
16 | MDBRow,
17 | MDBCol
18 | } from "mdbreact";
19 | import "./index.css";
20 |
21 | class App extends Component {
22 | constructor(props) {
23 | super(props);
24 | this.state = {
25 | events: [
26 | {
27 | id: 1,
28 | time: "10:00",
29 | title: "Breakfast with Simon",
30 | location: "Lounge Caffe",
31 | description: "Discuss Q3 targets"
32 | },
33 | {
34 | id: 2,
35 | time: "10:30",
36 | title: "Daily Standup Meeting (recurring)",
37 | location: "Warsaw Spire Office"
38 | },
39 | { id: 3, time: "11:00", title: "Call with HRs" },
40 | {
41 | id: 4,
42 | time: "12:00",
43 | title: "Lunch with Timmoty",
44 | location: "Canteen",
45 | description:
46 | "Project evalutation ile declaring a variable and using an if statement is a fine way to conditionally render a component, sometimes you might want to use a"
47 | }
48 | ]
49 | };
50 | }
51 |
52 | render() {
53 | return (
54 |
55 |
56 |
57 |
58 | Today:
59 |
60 | {this.state.events.map(event => (
61 |
69 | ))}
70 |
71 |
72 |
73 |
74 | Add Event
75 |
76 |
77 |
78 |
79 |
80 | Schedule
81 |
82 | It's going to be busy that today. You have{" "}
83 | {this.state.events.length} events today.
84 |
85 |
86 |
87 |
88 |
89 |
90 | Sunny
91 |
92 |
93 |
94 |
95 |
96 | 23°C
97 |
98 |
99 |
100 | Don't forget your sunglasses. Today will dry and sunny, becoming
101 | warm in the afternoon with temperatures of between 20 and 25
102 | degrees.
103 |
104 |
105 |
106 |
107 |
108 | );
109 | }
110 | }
111 |
112 | class Event extends Component {
113 | render() {
114 | return (
115 |
116 |
117 |
118 | {this.props.time}
119 |
120 |
121 |
122 | -
123 |
124 |
{this.props.title} {" "}
125 |
126 | {this.props.location && (
127 |
128 |
129 | {this.props.location}
130 |
131 |
132 | )}
133 |
134 |
135 | {this.props.description && (
136 |
137 | {this.props.description}
138 |
139 | )}
140 |
141 | );
142 | }
143 | }
144 |
145 | ReactDOM.render( , document.getElementById("root"));
146 |
--------------------------------------------------------------------------------
/lesson-9/src/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/lesson-9/src/logo.png
--------------------------------------------------------------------------------
/lesson-9/src/registerServiceWorker.js:
--------------------------------------------------------------------------------
1 | // In production, we register a service worker to serve assets from local cache.
2 |
3 | // This lets the app load faster on subsequent visits in production, and gives
4 | // it offline capabilities. However, it also means that developers (and users)
5 | // will only see deployed updates on the "N+1" visit to a page, since previously
6 | // cached resources are updated in the background.
7 |
8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
9 | // This link also includes instructions on opting out of this behavior.
10 |
11 | const isLocalhost = Boolean(
12 | window.location.hostname === "localhost" ||
13 | // [::1] is the IPv6 localhost address.
14 | window.location.hostname === "[::1]" ||
15 | // 127.0.0.1/8 is considered localhost for IPv4.
16 | window.location.hostname.match(
17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
18 | )
19 | );
20 |
21 | export default function register() {
22 | if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
23 | // The URL constructor is available in all browsers that support SW.
24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
25 | if (publicUrl.origin !== window.location.origin) {
26 | // Our service worker won't work if PUBLIC_URL is on a different origin
27 | // from what our page is served on. This might happen if a CDN is used to
28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
29 | return;
30 | }
31 |
32 | window.addEventListener("load", () => {
33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
34 |
35 | if (!isLocalhost) {
36 | // Is not local host. Just register service worker
37 | registerValidSW(swUrl);
38 | } else {
39 | // This is running on localhost. Lets check if a service worker still exists or not.
40 | checkValidServiceWorker(swUrl);
41 | }
42 | });
43 | }
44 | }
45 |
46 | function registerValidSW(swUrl) {
47 | navigator.serviceWorker
48 | .register(swUrl)
49 | .then(registration => {
50 | registration.onupdatefound = () => {
51 | const installingWorker = registration.installing;
52 | installingWorker.onstatechange = () => {
53 | if (installingWorker.state === "installed") {
54 | if (navigator.serviceWorker.controller) {
55 | // At this point, the old content will have been purged and
56 | // the fresh content will have been added to the cache.
57 | // It's the perfect time to display a "New content is
58 | // available; please refresh." message in your web app.
59 | console.log("New content is available; please refresh.");
60 | } else {
61 | // At this point, everything has been precached.
62 | // It's the perfect time to display a
63 | // "Content is cached for offline use." message.
64 | console.log("Content is cached for offline use.");
65 | }
66 | }
67 | };
68 | };
69 | })
70 | .catch(error => {
71 | console.error("Error during service worker registration:", error);
72 | });
73 | }
74 |
75 | function checkValidServiceWorker(swUrl) {
76 | // Check if the service worker can be found. If it can't reload the page.
77 | fetch(swUrl)
78 | .then(response => {
79 | // Ensure service worker exists, and that we really are getting a JS file.
80 | if (
81 | response.status === 404 ||
82 | response.headers.get("content-type").indexOf("javascript") === -1
83 | ) {
84 | // No service worker found. Probably a different app. Reload the page.
85 | navigator.serviceWorker.ready.then(registration => {
86 | registration.unregister().then(() => {
87 | window.location.reload();
88 | });
89 | });
90 | } else {
91 | // Service worker found. Proceed as normal.
92 | registerValidSW(swUrl);
93 | }
94 | })
95 | .catch(() => {
96 | console.log(
97 | "No internet connection found. App is running in offline mode."
98 | );
99 | });
100 | }
101 |
102 | export function unregister() {
103 | if ("serviceWorker" in navigator) {
104 | navigator.serviceWorker.ready.then(registration => {
105 | registration.unregister();
106 | });
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/start-here/README.md:
--------------------------------------------------------------------------------
1 | # React Bootstrap with Material Design
2 | MDBootstrap for React
3 |
4 | ## Getting Started
5 | To test, contribute or just see what we did follow few easy steps:
6 | - clone the repository
7 | - cd to the directory with the repository
8 | - run `yarn install` (or `npm install` if you don't use yarn)
9 | - run the app using `yarn start` (or `npm start`)
10 | - to build project use `yarn run build` (od `npm run build`)
11 | - `yarn run remove-demo` (or `npm run remove-demo`) removes demo app pages
12 | - enjoy!
13 |
14 | ## Bugs
15 | If you want to report a bug or submit your idea feel fre to open an issue
16 |
17 | Before you report a bug, please take your time to find if an issue hasn't been reported yet
18 |
19 | We're also open to pull requests
20 |
21 | ## Something Missing?
22 | If you still have some questions do not hesitate to ask us. Open an issue or [visit our Slack](https://mdbbetatest.slack.com)
23 |
--------------------------------------------------------------------------------
/start-here/README.txt:
--------------------------------------------------------------------------------
1 | Material Design for Bootstrap
2 |
3 | Version: MDB React Free 4.8.5
4 |
5 | Documentation:
6 | https://mdbootstrap.com/react/
7 |
8 | Getting started:
9 | https://mdbootstrap.com/react/react-bootstrap-getting-started/
10 |
11 | FAQ
12 | https://mdbootstrap.com/faq/
13 |
14 | Support:
15 | https://mdbootstrap.com/support/cat/mdb-react/
16 |
17 | ChangeLog
18 | https://mdbootstrap.com/react/changelog/
19 |
20 | License:
21 | https://mdbootstrap.com/license/
22 |
23 | Facebook: https://facebook.com/mdbootstrap
24 | Twitter: https://twitter.com/MDBootstrap
25 | Google+: https://plus.google.com/u/0/+Mdbootstrap/posts
26 | Dribbble: https://dribbble.com/mdbootstrap
27 |
28 |
29 | Contact:
30 | office@mdbootstrap.com
31 |
--------------------------------------------------------------------------------
/start-here/license.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/start-here/license.pdf
--------------------------------------------------------------------------------
/start-here/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "your-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "mdbreact": "4.9.0",
7 | "react": "^16.6.0",
8 | "react-dom": "^16.6.0",
9 | "react-scripts": "2.0.5"
10 | },
11 | "scripts": {
12 | "start": "react-scripts start",
13 | "build": "react-scripts build",
14 | "test": "react-scripts test --env=jsdom",
15 | "eject": "react-scripts eject",
16 | "rename": "renamer --find App-clear.js --replace App.js ./src/App-clear.js",
17 | "remove-demo": "rimraf ./src/font ./src/img ./src/pages ./src/Routes.js ./src/App.js && npm run rename"
18 | },
19 | "devDependencies": {
20 | "renamer": "^1.0.0",
21 | "rimraf": "^2.6.2"
22 | },
23 | "browserslist": [
24 | ">0.2%",
25 | "not dead",
26 | "not ie <= 11",
27 | "not op_mini all"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/start-here/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
22 | React App
23 |
24 |
25 |
26 | You need to enable JavaScript to run this app.
27 |
28 |
29 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/start-here/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/start-here/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Button } from "mdbreact";
3 | import logo from './logo.png';
4 |
5 | class App extends Component {
6 | render() {
7 | return (
8 |
9 |
10 |
11 | Welcome to Your MDB React App
12 |
13 |
The application is configured and ready to import our components.
14 |
Check out our docs!
15 |
16 | );
17 | }
18 | }
19 |
20 | export default App;
--------------------------------------------------------------------------------
/start-here/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import App from "./App";
4 |
5 | it("renders without crashing", () => {
6 | const div = document.createElement("div");
7 | ReactDOM.render( , div);
8 | });
9 |
--------------------------------------------------------------------------------
/start-here/src/index.css:
--------------------------------------------------------------------------------
1 | .App{
2 | height: 100vh;
3 | display: flex;
4 | flex-direction: column;
5 | justify-content: center;
6 | align-items: center;
7 | text-align: center;
8 | }
9 |
10 | .App-logo{
11 | width: 10rem;
12 | }
13 |
14 | .flyout {
15 | display:flex;
16 | flex-direction: column;
17 | min-height:100vh;
18 | justify-content: space-between;
19 | }
20 |
21 | .home-feature-box .fa {
22 | font-size:6rem;
23 | }
24 |
25 | .home-feature-box span {
26 | display: block;
27 | color:#111;
28 | font-weight:bold;
29 | margin-top:1.5rem;
30 | }
31 |
32 | .example-components-list li > a {
33 | color: #495057;
34 | }
35 |
36 | .example-components-list li:last-child > a {
37 | border-bottom:0;
38 | }
39 |
40 | .example-components-list li > a .fa {
41 | color:rgba(0,0,0,.35);
42 | float:right;
43 | }
44 |
--------------------------------------------------------------------------------
/start-here/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import 'font-awesome/css/font-awesome.min.css';
4 | import 'bootstrap-css-only/css/bootstrap.min.css';
5 | import 'mdbreact/dist/css/mdb.css';
6 | import './index.css';
7 | import App from './App';
8 |
9 | import registerServiceWorker from './registerServiceWorker';
10 |
11 | ReactDOM.render( , document.getElementById('root'));
12 |
13 | registerServiceWorker();
--------------------------------------------------------------------------------
/start-here/src/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mdbootstrap/React-Tutorial-Agenda-App/48a7d2bd30c86ef832d314d3223bf5d7fcbbaba6/start-here/src/logo.png
--------------------------------------------------------------------------------
/start-here/src/registerServiceWorker.js:
--------------------------------------------------------------------------------
1 | // In production, we register a service worker to serve assets from local cache.
2 |
3 | // This lets the app load faster on subsequent visits in production, and gives
4 | // it offline capabilities. However, it also means that developers (and users)
5 | // will only see deployed updates on the "N+1" visit to a page, since previously
6 | // cached resources are updated in the background.
7 |
8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
9 | // This link also includes instructions on opting out of this behavior.
10 |
11 | const isLocalhost = Boolean(
12 | window.location.hostname === "localhost" ||
13 | // [::1] is the IPv6 localhost address.
14 | window.location.hostname === "[::1]" ||
15 | // 127.0.0.1/8 is considered localhost for IPv4.
16 | window.location.hostname.match(
17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
18 | )
19 | );
20 |
21 | export default function register() {
22 | if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
23 | // The URL constructor is available in all browsers that support SW.
24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
25 | if (publicUrl.origin !== window.location.origin) {
26 | // Our service worker won't work if PUBLIC_URL is on a different origin
27 | // from what our page is served on. This might happen if a CDN is used to
28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
29 | return;
30 | }
31 |
32 | window.addEventListener("load", () => {
33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
34 |
35 | if (!isLocalhost) {
36 | // Is not local host. Just register service worker
37 | registerValidSW(swUrl);
38 | } else {
39 | // This is running on localhost. Lets check if a service worker still exists or not.
40 | checkValidServiceWorker(swUrl);
41 | }
42 | });
43 | }
44 | }
45 |
46 | function registerValidSW(swUrl) {
47 | navigator.serviceWorker
48 | .register(swUrl)
49 | .then(registration => {
50 | registration.onupdatefound = () => {
51 | const installingWorker = registration.installing;
52 | installingWorker.onstatechange = () => {
53 | if (installingWorker.state === "installed") {
54 | if (navigator.serviceWorker.controller) {
55 | // At this point, the old content will have been purged and
56 | // the fresh content will have been added to the cache.
57 | // It's the perfect time to display a "New content is
58 | // available; please refresh." message in your web app.
59 | console.log("New content is available; please refresh.");
60 | } else {
61 | // At this point, everything has been precached.
62 | // It's the perfect time to display a
63 | // "Content is cached for offline use." message.
64 | console.log("Content is cached for offline use.");
65 | }
66 | }
67 | };
68 | };
69 | })
70 | .catch(error => {
71 | console.error("Error during service worker registration:", error);
72 | });
73 | }
74 |
75 | function checkValidServiceWorker(swUrl) {
76 | // Check if the service worker can be found. If it can't reload the page.
77 | fetch(swUrl)
78 | .then(response => {
79 | // Ensure service worker exists, and that we really are getting a JS file.
80 | if (
81 | response.status === 404 ||
82 | response.headers.get("content-type").indexOf("javascript") === -1
83 | ) {
84 | // No service worker found. Probably a different app. Reload the page.
85 | navigator.serviceWorker.ready.then(registration => {
86 | registration.unregister().then(() => {
87 | window.location.reload();
88 | });
89 | });
90 | } else {
91 | // Service worker found. Proceed as normal.
92 | registerValidSW(swUrl);
93 | }
94 | })
95 | .catch(() => {
96 | console.log(
97 | "No internet connection found. App is running in offline mode."
98 | );
99 | });
100 | }
101 |
102 | export function unregister() {
103 | if ("serviceWorker" in navigator) {
104 | navigator.serviceWorker.ready.then(registration => {
105 | registration.unregister();
106 | });
107 | }
108 | }
109 |
--------------------------------------------------------------------------------