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

Adds basic layout #17

Merged
merged 5 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adds console greeting
  • Loading branch information
madsnedergaard committed Nov 3, 2022
commit cdd7ecc794aefc09abbe8168980b0be14eeca89c
8 changes: 7 additions & 1 deletion web/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@
}
}
],
"unicorn/prevent-abbreviations": [
"error",
{
"ignore": [".*[pP]rops"]
}
],
"unicorn/no-nested-ternary": ["error"]
},
"settings": {
Expand All @@ -144,7 +150,7 @@
{
"files": ["src/**/*.ts?(x)"],
"parserOptions": {
"project": ["./web/tsconfig.json"]
"project": ["./tsconfig.json"]
madsnedergaard marked this conversation as resolved.
Show resolved Hide resolved
}
},
{
Expand Down
9 changes: 6 additions & 3 deletions web/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { REFETCH_INTERVAL_MS } from 'api/helpers';
import App from 'App';
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { BrowserRouter } from 'react-router-dom';
import { createConsoleGreeting } from 'utils/createConsoleGreeting';
import { registerSW } from 'virtual:pwa-register';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import './index.css';
import { REFETCH_INTERVAL_MS } from 'api/helpers';

registerSW();
createConsoleGreeting();

const MAX_RETRIES = 1;
const queryClient = new QueryClient({
Expand Down
12 changes: 12 additions & 0 deletions web/src/utils/createConsoleGreeting.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Send a greeting message to the console for curious people
export function createConsoleGreeting() {
console.info(
madsnedergaard marked this conversation as resolved.
Show resolved Hide resolved
`%cWelcome to Electricity Maps!
馃實 %cReady to work on fixing the climate full-time?
https://electricitymaps.com/jobs
馃悪 Got comments or want to contribute?
https://github.com/electricityMaps/electricitymaps-contrib`,
'color: green; font-weight: bold',
'color: #666; font-style: italic'
madsnedergaard marked this conversation as resolved.
Show resolved Hide resolved
);
}