Skip to content

Commit f7b91f0

Browse files
committed
fix(client): styled-components ts setup
1 parent 68c990e commit f7b91f0

File tree

17 files changed

+42
-36
lines changed

17 files changed

+42
-36
lines changed

client/jest.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ module.exports = {
1313
'^~common(.*)$': '<rootDir>/src/common$1',
1414
'^~ui(.*)$': '<rootDir>/src/common/ui$1',
1515
'^~theme(.*)$': '<rootDir>/src/common/theme$1',
16-
'^~styled(.*)$': '<rootDir>/src/common/styled$1',
1716
'^~utils(.*)$': '<rootDir>/src/common/utils$1',
1817
'^~services(.*)$': '<rootDir>/src/common/services$1',
1918
},

client/src/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import SideBar from './navigation/SideBar';
66
import Router from './Router';
77
import Providers from './Providers';
88

9+
// TODO: figure out how to fix typings when using styled + mui together
10+
// https://material-ui.com/guides/typescript/
11+
912
const App = () => (
1013
<Providers>
1114
<>

client/src/Providers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { Provider } from 'react-redux';
33
import { createBrowserHistory } from 'history';
44
import { ConnectedRouter } from 'connected-react-router';
55
import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider';
6+
import { ThemeProvider } from 'styled-components';
67

78
import theme from '~theme';
8-
import { ThemeProvider } from '~styled';
99
import { connectApiToStore } from '~common/services/api';
1010
import { I18nProvider } from '~ui';
1111
import configureStore from './store';

client/src/common/styled.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

client/src/common/ui/ErrorBoundary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import * as Sentry from '@sentry/browser';
3+
import styled from 'styled-components';
34

4-
import styled from '~styled';
55
import config from '../config';
66

77
interface Props {

client/src/common/ui/Page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import styled from '~styled';
1+
import styled from 'styled-components';
22

33
const Page = styled.main`
44
padding: ${props => props.theme.spacing.unit * 3}px;

client/src/common/utils/styled.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { css, keyframes } from '~styled';
1+
import { css, keyframes } from 'styled-components';
22
import { BREAKPOINTS } from '../constants';
33

44
export const appear = keyframes`

client/src/common/utils/test.utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { render } from 'react-testing-library';
33
import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider';
44
import { I18nProvider } from '@lingui/react';
55
import { Catalogs } from '@lingui/core';
6+
import { ThemeProvider } from 'styled-components';
67

78
import theme from '~theme';
8-
import { ThemeProvider } from '~styled';
99

1010
// NOTE: we only need to add theme related providers so that certain
1111
// UI components work properly when testing them

client/src/custom-typings.d.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
/* eslint-disable */
2+
3+
// NOTE: if some lib is missing type definitions you can add them here
4+
5+
// NOTE: however if your are extending existing types put the extensions in
6+
// a separate file like in `styled.d.ts`!
7+
28
declare module '*.png';
39
declare module '*.svg';
410
declare module '*.jpg';
511

612
declare module 'workbox-window' {
713
export const Workbox: any;
8-
}
14+
}

client/src/navigation/SideBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import SwipeableDrawer from '@material-ui/core/SwipeableDrawer';
55
import List from '@material-ui/core/List';
66
import ListItem from '@material-ui/core/ListItem';
77
import ListItemText from '@material-ui/core/ListItemText';
8+
import styled from 'styled-components';
89

9-
import styled from '~styled';
1010
import { navigation } from './navigation.model';
1111

1212
interface Props {

0 commit comments

Comments
 (0)