Skip to content

Commit e83bd39

Browse files
committed
Extract PrivacyNotice
1 parent 60c9a8e commit e83bd39

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import styled from 'styled-components';
2+
3+
import { Explanation as ExplanationBase } from '../elements';
4+
5+
export const Explanation = styled(ExplanationBase)`
6+
margin-top: -1rem;
7+
`;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { patronUrl } from '@codesandbox/common/lib/utils/url-generator';
2+
import React, { FunctionComponent } from 'react';
3+
4+
import { Explanation } from './elements';
5+
6+
export const PrivacyNotice: FunctionComponent = () => (
7+
<Explanation>
8+
You can change privacy of a sandbox as a{' '}
9+
<a href={patronUrl()} rel="noopener noreferrer" target="_blank">
10+
patron
11+
</a>
12+
.
13+
</Explanation>
14+
);

packages/app/src/app/pages/Sandbox/Editor/Workspace/Project/index.tsx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import Tooltip from '@codesandbox/common/lib/components/Tooltip';
22
import getTemplateDefinition from '@codesandbox/common/lib/templates';
33
import { getSandboxName } from '@codesandbox/common/lib/utils/get-sandbox-name';
4-
import {
5-
patronUrl,
6-
sandboxUrl,
7-
} from '@codesandbox/common/lib/utils/url-generator';
4+
import { sandboxUrl } from '@codesandbox/common/lib/utils/url-generator';
85
import React, { FunctionComponent } from 'react';
96

107
import { useOvermind } from 'app/overmind';
@@ -17,7 +14,6 @@ import {
1714
BasicInfo,
1815
BundlerLink,
1916
Container,
20-
Explanation,
2117
Group,
2218
Icon,
2319
Item,
@@ -30,6 +26,7 @@ import { Frozen } from './Frozen';
3026
import { Git } from './Git';
3127
import { Keywords } from './Keywords';
3228
import { Privacy } from './Privacy';
29+
import { PrivacyNotice } from './PrivacyNotice';
3330
import { SandboxConfig } from './SandboxConfig';
3431
import { Team } from './Team';
3532
import { Title } from './Title';
@@ -75,15 +72,7 @@ export const Project: FunctionComponent<Props> = ({ editable = false }) => {
7572
<Group>
7673
<Privacy editable={editable} />
7774

78-
{!isPatron && (
79-
<Explanation style={{ marginTop: '-1rem' }}>
80-
You can change privacy of a sandbox as a{' '}
81-
<a href={patronUrl()} rel="noopener noreferrer" target="_blank">
82-
patron
83-
</a>
84-
.
85-
</Explanation>
86-
)}
75+
{!isPatron && <PrivacyNotice />}
8776

8877
{editable && <Frozen />}
8978

0 commit comments

Comments
 (0)