Skip to content

Commit 74a34c4

Browse files
lbogdanCompuIves
authored andcommitted
Small refactoring, fixes codesandbox#178. (codesandbox#269)
1 parent 84ad6a0 commit 74a34c4

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

src/app/components/sandbox/PrivacyStatus.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,27 @@ const iconStyles = css`
1515

1616
const StyledUnlisted = styled(Unlisted)(iconStyles);
1717
const StyledPrivate = styled(Private)(iconStyles);
18-
19-
const PRIVACY_MESSAGES = {
20-
0: {
21-
title: 'Public',
22-
tooltip: 'Everyone can see the sandbox',
23-
icon: null,
24-
},
25-
1: {
26-
title: 'Unlisted',
27-
tooltip: 'Only users with the url can see the sandbox',
28-
icon: <StyledUnlisted />,
29-
},
30-
2: {
31-
title: 'Private',
32-
tooltip: 'Only you can see the sandbox',
33-
icon: <StyledPrivate />,
34-
},
35-
};
36-
3718
const Icon = styled(Question)(iconStyles);
3819

3920
export default ({ privacy, asIcon }: { privacy: number, asIcon: boolean }) => {
21+
const PRIVACY_MESSAGES = {
22+
0: {
23+
title: 'Public',
24+
tooltip: 'Everyone can see the sandbox',
25+
icon: null,
26+
},
27+
1: {
28+
title: 'Unlisted',
29+
tooltip: 'Only users with the url can see the sandbox',
30+
icon: <StyledUnlisted />,
31+
},
32+
2: {
33+
title: 'Private',
34+
tooltip: 'Only you can see the sandbox',
35+
icon: <StyledPrivate />,
36+
},
37+
};
38+
4039
if (asIcon) {
4140
return (
4241
<Tooltip title={PRIVACY_MESSAGES[privacy].tooltip}>

0 commit comments

Comments
 (0)