Skip to content

Commit b750ee6

Browse files
lbogdanCompuIves
authored andcommitted
Add "My Sandboxes" menu item (codesandbox#790)
* Added "My Sandboxes" menu item. * Updated icon. * Fixed eslint warnings.
1 parent 9783d96 commit b750ee6

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

packages/app/src/app/pages/common/HTML5BackendWithFolderSupport/html-dir-content/utils.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@ const getFileFromFileEntry = entry =>
2424

2525
const isItemFileEntry = item => item.kind === 'file';
2626

27-
const getAsEntry = item =>
28-
item.getAsEntry
29-
? item.getAsEntry()
30-
: item.webkitGetAsEntry ? item.webkitGetAsEntry() : null;
27+
const getAsEntry = item => {
28+
if (item.getAsEntry) {
29+
return item.getAsEntry();
30+
} else if (item.webkitGetAsEntry) {
31+
return item.webkitGetAsEntry();
32+
}
33+
return null;
34+
};
3135

3236
const getListAsArray = (
3337
list // returns a flat array

packages/app/src/app/pages/common/UserMenu/Menu/elements.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const Container = styled.div`
77
box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.75);
88
99
${delayEffect(0)};
10-
top: 40px;
10+
top: 35px;
1111
1212
right: 0;
1313

packages/app/src/app/pages/common/UserMenu/Menu/index.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ import UserIcon from 'react-icons/lib/ti/user';
55
import ExitIcon from 'react-icons/lib/md/exit-to-app';
66
import FolderIcon from 'react-icons/lib/md/folder';
77
import SettingsIcon from 'react-icons/lib/md/settings';
8-
9-
import { profileUrl, patronUrl } from 'common/utils/url-generator';
8+
import {
9+
profileUrl,
10+
profileSandboxesUrl,
11+
patronUrl,
12+
} from 'common/utils/url-generator';
1013
import PatronBadge from 'common/utils/badges/PatronBadge';
14+
import InfoIcon from '../../../../pages/Sandbox/Editor/Navigation/InfoIcon';
1115

1216
import { Container, Item, Icon } from './elements';
1317

@@ -21,6 +25,16 @@ function Menu({ username, openPreferences, openStorageManagement, signOut }) {
2125
</Icon>My Profile
2226
</Item>
2327
</Link>
28+
<Link
29+
style={{ textDecoration: 'none' }}
30+
to={profileSandboxesUrl(username)}
31+
>
32+
<Item>
33+
<Icon>
34+
<InfoIcon />
35+
</Icon>My Sandboxes
36+
</Item>
37+
</Link>
2438
<Item onClick={openStorageManagement}>
2539
<Icon>
2640
<FolderIcon />

0 commit comments

Comments
 (0)