Skip to content

Commit

Permalink
app: Move global styles setup to app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Nov 23, 2020
1 parent 5e794ff commit 781aa20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 10 additions & 2 deletions src/renderer/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,25 @@ import * as Sentry from '@sentry/browser';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import {when} from 'mobx';
import {Global} from '@emotion/core';

import Application from 'app/views/Application';
import globalCss, {noSelect} from 'src/shared/globalCss';
import {registerRendererIpc, registerRendererConfigIpc} from 'src/shared/store/ipc';
import store from 'src/shared/store';

// Create main element
const mainElement = document.createElement('div');
document.body.appendChild(mainElement);

// Render components
ReactDOM.render(<Application />, mainElement);
const main = (
<React.Fragment>
<Global styles={[globalCss, noSelect]} />
<Application />
</React.Fragment>
);

ReactDOM.render(main, mainElement);

registerRendererIpc();

Expand Down
3 changes: 0 additions & 3 deletions src/renderer/views/Application.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import * as React from 'react';
import {Global} from '@emotion/core';
import styled from '@emotion/styled';
import {MemoryRouter, Switch, Route, Redirect} from 'react-router-dom';

import globalCss, {noSelect} from 'src/shared/globalCss';
import Titlebar from 'app/components/Titlebar';
import Footer from 'app/components/Footer';
import Devices from 'app/views/devices';
Expand All @@ -12,7 +10,6 @@ import Settings from 'app/views/settings';

const Application = () => (
<MemoryRouter>
<Global styles={[globalCss, noSelect]} />
<Titlebar />
<Frame>
<Switch>
Expand Down

0 comments on commit 781aa20

Please sign in to comment.