├── .gitignore
├── README.md
├── next.config.js
├── package.json
├── public
└── favicon.ico
└── src
├── assets
└── mdb-react-small.png
├── components
├── Carousel.js
├── Footer.js
├── Layout.js
└── NavBar.js
└── pages
├── _app.js
├── index.js
└── register.js
/.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 | # next.js
12 | /.next/
13 | /out/
14 |
15 | # production
16 | /build
17 |
18 | # misc
19 | .DS_Store
20 | .env*
21 |
22 | # debug
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 |
27 | # lock files
28 | package-lock.json
29 | yarn.lock
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |

3 |
4 |
MDB React & Next.js 9.3
5 |
MDBReact with create-next-app integration example.
6 |
MDBReact v.4.25.5
7 |
8 |
9 |
10 | ## Project setup
11 |
12 | ```
13 | yarn install
14 | ```
15 |
16 | ### Compiles and hot-reloads for development
17 |
18 | ```
19 | yarn dev
20 | ```
21 |
22 | ### Compiles and minifies for production
23 |
24 | ```
25 | yarn build
26 | ```
27 |
28 | ### Lints and hot-reloads for production
29 |
30 | ```
31 | yarn start
32 | ```
33 |
--------------------------------------------------------------------------------
/next.config.js:
--------------------------------------------------------------------------------
1 | const withFonts = require('next-fonts');
2 | const withImages = require('next-images');
3 | const withPlugins = require('next-compose-plugins');
4 |
5 | module.exports = withPlugins([withFonts, withImages]);
6 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nextjs-mdb",
3 | "version": "4.25.3",
4 | "description": "Integration example for MDBReact and Next.js create-next-app",
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start"
9 | },
10 | "author": "Jakub Chmura",
11 | "repository": "https://github.com/JakubChm/nextjs-mdbreact.git",
12 | "license": "MIT",
13 | "dependencies": {
14 | "express": "^4.17.1",
15 | "mdbreact": "^4.25.5",
16 | "next": "^9.3.4",
17 | "next-compose-plugins": "^2.2.0",
18 | "next-fonts": "^1.0.3",
19 | "next-images": "^1.4.0",
20 | "react": "^16.13.1",
21 | "react-dom": "^16.13.1"
22 | }
23 | }
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jakubchmura/nextjs-mdbreact/59b8ac122eb7bc59dbc65014cf2ae7fa9852729c/public/favicon.ico
--------------------------------------------------------------------------------
/src/assets/mdb-react-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jakubchmura/nextjs-mdbreact/59b8ac122eb7bc59dbc65014cf2ae7fa9852729c/src/assets/mdb-react-small.png
--------------------------------------------------------------------------------
/src/components/Carousel.js:
--------------------------------------------------------------------------------
1 | import {
2 | MDBCarousel,
3 | MDBCarouselCaption,
4 | MDBCarouselInner,
5 | MDBCarouselItem,
6 | MDBView,
7 | MDBMask,
8 | MDBContainer
9 | } from 'mdbreact';
10 |
11 | const Carousel = () => {
12 | return (
13 |
14 |
21 |
22 |
23 |
24 |
29 |
30 |
31 |
32 | Light mask
33 | First text
34 |
35 |
36 |
37 |
38 |
43 |
44 |
45 |
46 | Strong mask
47 | Second text
48 |
49 |
50 |
51 |
52 |
57 |
58 |
59 |
60 | Slight Mast
61 | Third text
62 |
63 |
64 |
65 |
66 |
67 | );
68 | };
69 |
70 | export default Carousel;
71 |
--------------------------------------------------------------------------------
/src/components/Footer.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { MDBIcon, MDBContainer, MDBFooter } from 'mdbreact';
3 |
4 | const FooterPage = () => {
5 | return (
6 |
10 |
11 | © {new Date().getFullYear()} Copyright:
12 | MDBootstrap.com
13 |
14 |
15 |
16 | );
17 | };
18 |
19 | export default FooterPage;
20 |
--------------------------------------------------------------------------------
/src/components/Layout.js:
--------------------------------------------------------------------------------
1 | import { MDBContainer } from 'mdbreact';
2 | import NavBar from './NavBar';
3 | import Footer from './Footer';
4 |
5 | function Layout(props) {
6 | return (
7 | <>
8 |
9 | {props.children}
10 |
11 |
19 | >
20 | );
21 | }
22 |
23 | export default Layout;
24 |
--------------------------------------------------------------------------------
/src/components/NavBar.js:
--------------------------------------------------------------------------------
1 | import Link from 'next/link';
2 | import {
3 | MDBNavbar,
4 | MDBNavbarBrand,
5 | MDBNavbarNav,
6 | MDBNavItem,
7 | MDBNavbarToggler,
8 | MDBCollapse,
9 | MDBFormInline,
10 | MDBDropdown,
11 | MDBDropdownToggle,
12 | MDBDropdownMenu,
13 | MDBDropdownItem
14 | } from 'mdbreact';
15 |
16 | class Layout extends React.Component {
17 | constructor(props) {
18 | super(props);
19 | this.state = {
20 | isOpen: false
21 | };
22 | }
23 |
24 | toggleCollapse = () => {
25 | this.setState({ isOpen: !this.state.isOpen });
26 | };
27 |
28 | render() {
29 | return (
30 | <>
31 |
32 |
33 | Navbar
34 |
35 |
36 |
37 |
38 |
39 |
40 | Home
41 |
42 |
43 |
44 |
45 | Register
46 |
47 |
48 |
49 |
50 |
51 | Dropdown
52 |
53 |
54 |
55 |
56 | Home
57 |
58 |
59 |
60 |
61 | Register
62 |
63 |
64 |
65 |
66 | Home
67 |
68 |
69 |
70 |
71 | Register
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | >
95 | );
96 | }
97 | }
98 |
99 | export default Layout;
100 |
--------------------------------------------------------------------------------
/src/pages/_app.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import App from 'next/app';
3 | import '@fortawesome/fontawesome-free/js/all';
4 | import 'bootstrap-css-only/css/bootstrap.min.css';
5 | import 'mdbreact/dist/css/mdb.css';
6 | import Layout from '../components/Layout';
7 |
8 | export default class MyApp extends App {
9 | static async getInitialProps({ Component, ctx }) {
10 | let pageProps = {};
11 |
12 | if (Component.getInitialProps) {
13 | pageProps = await Component.getInitialProps(ctx);
14 | }
15 |
16 | return { pageProps };
17 | }
18 |
19 | render() {
20 | const { Component, pageProps } = this.props;
21 |
22 | return (
23 |
24 |
25 |
26 | );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/pages/index.js:
--------------------------------------------------------------------------------
1 | import Carousel from '../components/Carousel';
2 | import ReactImage from '../assets/mdb-react-small.png';
3 |
4 | const WelcomePage = () => (
5 | <>
6 | Welcome to Next.js
7 |
12 |
13 | >
14 | );
15 |
16 | export default WelcomePage;
17 |
--------------------------------------------------------------------------------
/src/pages/register.js:
--------------------------------------------------------------------------------
1 | import {
2 | MDBBtn,
3 | MDBCard,
4 | MDBCardBody,
5 | MDBCardImage,
6 | MDBInput,
7 | MDBCol,
8 | MDBRow
9 | } from 'mdbreact';
10 |
11 | const Example = () => (
12 |
13 |
14 |
15 |
16 |
21 |
22 |
64 |
65 |
66 |
67 |
68 |
69 | );
70 |
71 | export default Example;
72 |
--------------------------------------------------------------------------------