Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
not working. vercel/next.js#12079
Browse files Browse the repository at this point in the history
  • Loading branch information
bdavidxyz committed Nov 19, 2020
1 parent 4abcd4b commit 0be82e2
Show file tree
Hide file tree
Showing 58 changed files with 11,236 additions and 200 deletions.
2 changes: 1 addition & 1 deletion ui/nextjs/with-redux/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Switch, Route, withRouter } from "react-router-dom";

import Layout from "./components/Layout";
import { ScrollToTop } from "./components";
import { NotFound, ApiTester, WidgetTester, SearchForTrainingsAndJobs } from "./pages";
import { NotFound, ApiTester, WidgetTester, SearchForTrainingsAndJobs } from "./zpages";

import routes from "./routes.json";

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion ui/nextjs/with-redux/ErrorBoundary.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import ReactDOM from "react-dom";

import * as Sentry from "@sentry/react";
import DomainError from "./pages/SearchForTrainingsAndJobs/components/DomainError/DomainError.js";
import DomainError from "./zpages/SearchForTrainingsAndJobs/components/DomainError/DomainError.js";

export default class ErrorBoundary extends React.Component {
constructor(props) {
Expand Down
2 changes: 1 addition & 1 deletion ui/nextjs/with-redux/components/example/CardMap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Link } from "react-router-dom";
import Link from 'next/link'
import { image } from "../../image";
import shave from "shave";
import "./CardMap.css";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Link } from "react-router-dom";
import Link from 'next/link'
import shave from "shave";

import { image } from "../../../../image";
Expand Down
3 changes: 3 additions & 0 deletions ui/nextjs/with-redux/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
// useFileSystemPublicRoutes: false,
}
99 changes: 94 additions & 5 deletions ui/nextjs/with-redux/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,95 @@
import NotFound from "./NotFound";
import ApiTester from "./ApiTester";
import WidgetTester from "./WidgetTester";
import SearchForTrainingsAndJobs from "./SearchForTrainingsAndJobs";
import React from "react";
import ReactDOM from "react-dom";
import { Provider } from "react-redux";
import { ConnectedRouter } from "connected-react-router";

export { NotFound, ApiTester, WidgetTester, SearchForTrainingsAndJobs };
import * as Sentry from "@sentry/react";
import { Integrations } from "@sentry/tracing";

import configureStore, { history } from "./redux";

import App from "../App";
import * as serviceWorker from "./serviceWorker";

import "bootstrap/dist/css/bootstrap.min.css";
import "../index.css";
import ErrorBoundary from "../ErrorBoundary";
import { getWidgetParameters, getIsTrainingOnly } from "../services/config";
import DomainError from "../pages/SearchForTrainingsAndJobs/components/DomainError/DomainError.js";
import baseUrl from "../utils/baseUrl";
import microAjax from "../utils/microAjax";

const store = configureStore();

async function init() {
Sentry.init({
dsn: "https://57ef0b6bede14fbe8449e584a1044047@o154210.ingest.sentry.io/5417811",
integrations: [new Integrations.BrowserTracing()],
tracesSampleRate: 1.0,
});

const isTrainingOnly = getIsTrainingOnly();
getWidgetParameters();

ReactDOM.render(
<ErrorBoundary>
<Provider store={store}>
<ConnectedRouter history={history}>
<App isTrainingOnly={isTrainingOnly} />
</ConnectedRouter>
</Provider>
</ErrorBoundary>,
document.getElementById("root")
);

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
}


/*
* HACK : Global error catching.
* See https://stackoverflow.com/a/56255288/2595513
*/
let console = (function(oldCons){
return {
log: function(text){
oldCons.log(text);
},
info: function (text) {
oldCons.info(text);
},
warn: function (text) {
oldCons.warn(text);
},
error: function (text) {
oldCons.error(text);
if (text === '__unhandledrejection__') {
Sentry.captureException(text);
ReactDOM.render(<div style={{'textAlign' : 'center'}}><DomainError/></div>, document.getElementById('root'))
}
}
};
}(window.console));
// catch unhandled promises
window.addEventListener("unhandledrejection", (event) => {
console.error('__unhandledrejection__');
console.error(event.reason);
});
/*
* End of Hack
*/

// Print current version
microAjax({
url: baseUrl + '/api/version',
success: (res) => console.log(`version : ${JSON.parse(res).version}`)
});


/*
* ACTUALLY STARTS THE APP
*/
init();
2 changes: 1 addition & 1 deletion ui/nextjs/with-redux/utils/mapTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import distance from "@turf/distance";
import { Marker, MapPopup } from "../pages/SearchForTrainingsAndJobs/components";
import ReactDOM from "react-dom";
import mapboxgl from "mapbox-gl";
// import mapboxgl from "mapbox-gl";
import { Provider } from "react-redux";
import { fetchAddresses } from "../services/baseAdresse";
import { scrollToElementInContainer, getItemElement } from "./tools";
Expand Down
Loading

0 comments on commit 0be82e2

Please sign in to comment.