-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
788 additions
and
792 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import axios from "axios" | ||
import axios from "axios"; | ||
|
||
const mapApi = axios.create({ | ||
withCredentials: true, | ||
baseURL: window.API_URL | ||
}) | ||
baseURL: window.API_URL, | ||
}); | ||
|
||
export default mapApi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
|
||
export default function ErrorWrapper({ title, children }) { | ||
return ( | ||
<div> | ||
{children} | ||
</div> | ||
) | ||
} | ||
export default function ErrorWrapper({ children }) { | ||
return <div>{children}</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,32 @@ | ||
import { Element } from 'react-bulma-components'; | ||
import logo from '../assets/logowhite.png'; | ||
import React from 'react'; | ||
import { Element } from "react-bulma-components"; | ||
import logo from "../assets/logowhite.png"; | ||
|
||
export default function Footer() { | ||
return ( | ||
<Element id="footer" backgroundColor='primary' px={5} display='flex' alignItems='baseline' py={1} justifyContent='center'> | ||
<Element className='has-text-white' href="https://www.nina.no" renderAs='a' display='flex' alignItems='baseline'> | ||
<img src={logo} alt="nina logo" className='logo' /> | ||
<Element className='has-text-white is-size-7' ml={2}>Norsk institutt for naturforskning - www.nina.no</Element> | ||
</Element> | ||
<Element className='has-text-white is-size-7' ml="auto">Samarbeid og kunnskap for framtidas miljøløsninger</Element> | ||
return ( | ||
<Element | ||
id="footer" | ||
backgroundColor="primary" | ||
px={5} | ||
display="flex" | ||
alignItems="baseline" | ||
py={1} | ||
justifyContent="center" | ||
> | ||
<Element | ||
className="has-text-white" | ||
href="https://www.nina.no" | ||
renderAs="a" | ||
display="flex" | ||
alignItems="baseline" | ||
> | ||
<img src={logo} alt="nina logo" className="logo" /> | ||
<Element className="has-text-white is-size-7" ml={2}> | ||
Norsk institutt for naturforskning - www.nina.no | ||
</Element> | ||
) | ||
} | ||
</Element> | ||
<Element className="has-text-white is-size-7" ml="auto"> | ||
Samarbeid og kunnskap for framtidas miljøløsninger | ||
</Element> | ||
</Element> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import * as Sentry from "@sentry/react"; | ||
|
||
if (window.SENTRY_DSN) { | ||
Sentry.init({ | ||
dsn: window.SENTRY_DSN, | ||
environment: window.SENTRY_ENV, | ||
integrations: [ | ||
Sentry.browserTracingIntegration(), | ||
Sentry.replayIntegration({ | ||
maskAllText: false, | ||
blockAllMedia: false, | ||
}), | ||
], | ||
// Performance Monitoring | ||
tracesSampleRate: 1.0, // Capture 100% of the transactions | ||
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled | ||
// tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], | ||
// Session Replay | ||
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. | ||
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. | ||
}); | ||
} | ||
Sentry.init({ | ||
dsn: window.SENTRY_DSN, | ||
environment: window.SENTRY_ENV, | ||
integrations: [ | ||
Sentry.browserTracingIntegration(), | ||
Sentry.replayIntegration({ | ||
maskAllText: false, | ||
blockAllMedia: false, | ||
}), | ||
], | ||
// Performance Monitoring | ||
tracesSampleRate: 1.0, // Capture 100% of the transactions | ||
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled | ||
// tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], | ||
// Session Replay | ||
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. | ||
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
|
||
export const BACKGROUND_LAYER_ID = '###BACKGROUND###'; | ||
export const BACKGROUND_LAYER_ID = "###BACKGROUND###"; | ||
export const BACKGROUND_TILES = { | ||
x: 8, | ||
y: 4, | ||
z: 4, | ||
} | ||
x: 8, | ||
y: 4, | ||
z: 4, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
import useSWR from "swr"; | ||
|
||
const fetcher = async url => { | ||
const res = await fetch(url, { credentials: 'include' }) | ||
const fetcher = async (url) => { | ||
const res = await fetch(url, { credentials: "include" }); | ||
|
||
// If the status code is not in the range 200-299, | ||
// we still try to parse and throw it. | ||
if (!res.ok) { | ||
const error = new Error('An error occurred while fetching the data.') | ||
const error = new Error("An error occurred while fetching the data."); | ||
// Attach extra info to the error object. | ||
error.info = await res.json() | ||
error.status = res.status | ||
throw error | ||
error.info = await res.json(); | ||
error.status = res.status; | ||
throw error; | ||
} | ||
return res.json() | ||
} | ||
|
||
return res.json(); | ||
}; | ||
export default function useMetadata() { | ||
return useSWR(window.MAPS_API_URL.replace('{MAP_ID}', location.hash.slice(1)), fetcher); | ||
return useSWR( | ||
window.MAPS_API_URL.replace("{MAP_ID}", location.hash.slice(1)), | ||
fetcher, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
|
||
export class NotFoundError extends Error {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom/client' | ||
import './components/plausible.js'; | ||
import './components/sentry.js'; | ||
import App from './App.jsx' | ||
import './styles/app.scss' | ||
import React from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
import "./components/plausible.js"; | ||
import "./components/sentry.js"; | ||
import App from "./App.jsx"; | ||
import "./styles/app.scss"; | ||
|
||
ReactDOM.createRoot(document.getElementById('app')).render( | ||
ReactDOM.createRoot(document.getElementById("app")).render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
) | ||
); |
Oops, something went wrong.