Skip to content

Commit 80a1b52

Browse files
committed
🔨 Switch SignOutNoticeModal to use useOvermind
1 parent ce2da4f commit 80a1b52

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import styled from 'styled-components';
1+
import { Button as ButtonBase } from '@codesandbox/common/lib/components/Button';
2+
import styled, { css } from 'styled-components';
23

34
export const Container = styled.div`
4-
background-color: ${props => props.theme.background};
5-
padding: 1rem;
6-
margin: 0;
7-
color: ${props =>
8-
props.theme.light ? 'rgba(0, 0, 0, 0.8)' : 'rgba(255, 255, 255, 0.8)'};
5+
${({ theme }) => css`
6+
background-color: ${theme.background};
7+
padding: 1rem;
8+
margin: 0;
9+
color: ${theme.light ? 'rgba(0, 0, 0, 0.8)' : 'rgba(255, 255, 255, 0.8)'};
10+
`};
911
`;
1012

1113
export const Heading = styled.h2`
@@ -16,3 +18,7 @@ export const Explanation = styled.p`
1618
line-height: 1.3;
1719
margin-bottom: 2rem;
1820
`;
21+
22+
export const Button = styled(ButtonBase)`
23+
margin-right: 0.5rem;
24+
`;

‎packages/app/src/app/pages/Sandbox/SignOutNoticeModal/index.tsx‎

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
import React from 'react';
2-
import { useOvermind } from 'app/overmind';
3-
4-
import { Button } from '@codesandbox/common/lib/components/Button';
51
import Row from '@codesandbox/common/lib/components/flex/Row';
2+
import React, { FunctionComponent } from 'react';
3+
4+
import { useOvermind } from 'app/overmind';
65

7-
import { Container, Heading, Explanation } from './elements';
6+
import { Button, Container, Explanation, Heading } from './elements';
87

9-
export const SignOutNotice = () => {
8+
export const SignOutNoticeModal: FunctionComponent = () => {
109
const {
1110
actions: { modalClosed, signInClicked },
1211
} = useOvermind();
12+
1313
return (
1414
<Container>
1515
<Heading>You have been signed out</Heading>
16+
1617
<Explanation>
1718
CodeSandbox has migrated to a system where authorization tokens can be
1819
managed and revoked, and we had to sign everyone out for this.
@@ -23,21 +24,11 @@ export const SignOutNotice = () => {
2324
</Explanation>
2425

2526
<Row justifyContent="space-around">
26-
<Button
27-
block
28-
style={{ marginRight: '.5rem' }}
29-
red
30-
onClick={() => {
31-
modalClosed();
32-
}}
33-
>
27+
<Button block onClick={() => modalClosed()} red>
3428
Close
3529
</Button>
36-
<Button
37-
block
38-
style={{ marginLeft: '.5rem' }}
39-
onClick={() => signInClicked({ useExtraScopes: false })}
40-
>
30+
31+
<Button block onClick={() => signInClicked({ useExtraScopes: false })}>
4132
Sign in
4233
</Button>
4334
</Row>

0 commit comments

Comments
 (0)