Skip to content

Commit 3260a8e

Browse files
committed
🔧 Fix Dashboard Crash
Cause was a version miss-match for React Router Additionally cleaned up some prop warning errors
1 parent 06373a3 commit 3260a8e

File tree

7 files changed

+60
-61
lines changed

7 files changed

+60
-61
lines changed

‎packages/app/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
"react-modal": "^3.6.1",
190190
"react-motion": "^0.5.0",
191191
"react-outside-click-handler": "^1.2.3",
192-
"react-router-dom": "^4.3.1",
192+
"react-router-dom": "^5.1.2",
193193
"react-show": "^3.0.4",
194194
"react-split-pane": "^0.1.87",
195195
"react-spring": "^8.0.25",

‎packages/app/src/app/pages/Dashboard/Sidebar/Item/elements.js‎

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import styled, { css } from 'styled-components';
2+
import { NavLink } from 'react-router-dom';
3+
import ChevronRight from 'react-icons/lib/md/chevron-right';
4+
import { withoutProps } from '@codesandbox/common/lib/utils';
5+
6+
export const AnimatedChevron = styled(ChevronRight)<{ open?: boolean }>`
7+
${({ open = false }) => css`
8+
width: 1rem;
9+
margin-right: 0.25rem;
10+
transform: rotate(${open ? 90 : 0}deg);
11+
transition: 0.25s ease transform;
12+
`}
13+
`;
14+
15+
export const Container = styled(
16+
withoutProps(`active`, `openByDefault`)(NavLink)
17+
)<{
18+
active?: boolean;
19+
}>`
20+
${({ active = false, theme }) => css`
21+
position: relative;
22+
display: flex;
23+
align-items: center;
24+
width: 100%;
25+
height: 2.5rem;
26+
padding: 0 0.5rem;
27+
box-sizing: border-box;
28+
background-color: transparent;
29+
color: ${theme.placeholder};
30+
text-decoration: none;
31+
cursor: pointer;
32+
user-select: none;
33+
transition: 0.3s ease all;
34+
35+
&:hover {
36+
color: white;
37+
}
38+
39+
${active &&
40+
css`
41+
background-color: ${theme.secondary};
42+
color: white;
43+
`};
44+
`}
45+
`;
46+
47+
export const IconContainer = styled.div`
48+
display: flex;
49+
align-items: center;
50+
width: 2rem;
51+
font-size: 1.25rem;
52+
`;
53+
54+
export const ItemName = styled.div`
55+
font-size: 0.875rem;
56+
`;
File renamed without changes.

‎packages/app/src/app/pages/Dashboard/Sidebar/index.js‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,7 @@ class Sidebar extends React.Component {
135135
</Route>
136136

137137
<div style={{ margin: '2rem', fontSize: '.875rem' }}>
138-
<Button
139-
style={{ display: 'block' }}
140-
to="/dashboard/teams/new"
141-
small
142-
block
143-
>
138+
<Button to="/dashboard/teams/new" small block>
144139
Create Team
145140
</Button>
146141
</div>

‎packages/common/src/components/Button/elements.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export const buttonStyles = ({
171171
`;
172172

173173
export const Base = styled(
174-
withoutProps(`block`, `secondary`, `danger`, `red`, `large`)(Button)
174+
withoutProps(`block`, `secondary`, `danger`, `red`, `small`)(Button)
175175
)<IBaseProps>`
176176
${buttonStyles}
177177
`;

‎packages/homepage/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"react-dom": "^16.9.0",
6666
"react-helmet": "^5.2.0",
6767
"react-media": "^1.6.1",
68-
"react-router-dom": "^4.2.2",
68+
"react-router-dom": "^5.1.2",
6969
"react-slick": "^0.23.2",
7070
"react-spring": "^8.0.25",
7171
"react-text-loop": "^2.0.2",

0 commit comments

Comments
 (0)