No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

66 líneas
2.1 KiB

  1. /*!
  2. =========================================================
  3. * NextJS Material Kit v1.1.0 based on Material Kit Free - v2.0.2 (Bootstrap 4.0.0 Final Edition) and Material Kit React v1.8.0
  4. =========================================================
  5. * Product Page: https://www.creative-tim.com/product/nextjs-material-kit
  6. * Copyright 2020 Creative Tim (https://www.creative-tim.com)
  7. * Licensed under MIT (https://github.com/creativetimofficial/nextjs-material-kit/blob/master/LICENSE.md)
  8. * Coded by Creative Tim
  9. =========================================================
  10. * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  11. */
  12. import React from "react";
  13. import ReactDOM from "react-dom";
  14. import App from "next/app";
  15. import Head from "next/head";
  16. import Router from "next/router";
  17. import PageChange from "components/PageChange/PageChange.js";
  18. import "assets/scss/nextjs-material-kit.scss?v=1.1.0";
  19. // import styles from "assets/jss/nextjs-material-kit/pages/components.js";
  20. Router.events.on("routeChangeStart", (url) => {
  21. console.log(`Loading: ${url}`);
  22. document.body.classList.add("body-page-transition");
  23. ReactDOM.render(
  24. <PageChange path={url} />,
  25. document.getElementById("page-transition")
  26. );
  27. });
  28. Router.events.on("routeChangeComplete", () => {
  29. ReactDOM.unmountComponentAtNode(document.getElementById("page-transition"));
  30. document.body.classList.remove("body-page-transition");
  31. });
  32. Router.events.on("routeChangeError", () => {
  33. ReactDOM.unmountComponentAtNode(document.getElementById("page-transition"));
  34. document.body.classList.remove("body-page-transition");
  35. });
  36. export default class MyApp extends App {
  37. static async getInitialProps({ Component, router, ctx }) {
  38. let pageProps = {};
  39. if (Component.getInitialProps) {
  40. pageProps = await Component.getInitialProps(ctx);
  41. }
  42. return { pageProps };
  43. }
  44. render() {
  45. const { Component, pageProps } = this.props;
  46. return (
  47. <React.Fragment>
  48. <Head>
  49. <title>Thamrin Group</title>
  50. </Head>
  51. <Component {...pageProps} />
  52. </React.Fragment>
  53. );
  54. }
  55. }