File tree Expand file tree Collapse file tree 4 files changed +28
-5
lines changed
packages/app/src/app/pages/Dashboard/Components Expand file tree Collapse file tree 4 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,6 @@ export const Header = ({
141
141
alignItems : 'center' ,
142
142
textDecoration : 'none' ,
143
143
fontSize : 2 ,
144
- padding : 2 ,
145
144
color : 'mutedForeground' ,
146
145
width : 'auto' ,
147
146
transition : `color ease-in` ,
Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ import { BranchFragment as Branch } from 'app/graphql/types';
4
4
import {
5
5
githubRepoUrl ,
6
6
v2BranchUrl ,
7
+ dashboard ,
7
8
} from '@codesandbox/common/lib/utils/url-generator' ;
9
+ import { useHistory } from 'react-router-dom' ;
8
10
import { Context , MenuItem } from '../ContextMenu' ;
9
11
10
12
type BranchMenuProps = {
@@ -15,13 +17,20 @@ export const BranchMenu: React.FC<BranchMenuProps> = ({ branch }) => {
15
17
16
18
const { name, project, contribution } = branch ;
17
19
const branchUrl = v2BranchUrl ( { name, project } ) ;
20
+
21
+ const { name : repoName , owner } = project . repository ;
22
+
18
23
const githubUrl = githubRepoUrl ( {
19
24
branch : name ,
20
- repo : project . repository . name ,
21
- username : project . repository . owner ,
25
+ repo : repoName ,
26
+ username : owner ,
22
27
path : '' ,
23
28
} ) ;
24
29
30
+ const repoUrl = dashboard . repository ( { owner, name : repoName } ) ;
31
+
32
+ const history = useHistory ( ) ;
33
+
25
34
return (
26
35
< Menu . ContextMenu
27
36
visible = { visible }
@@ -44,6 +53,9 @@ export const BranchMenu: React.FC<BranchMenuProps> = ({ branch }) => {
44
53
Open on GitHub
45
54
</ MenuItem >
46
55
) }
56
+ < MenuItem onSelect = { ( ) => history . push ( repoUrl ) } >
57
+ Open repository
58
+ </ MenuItem >
47
59
{ /* TODO: Implement remove branch <Menu.Divider />
48
60
<Menu.Divider />
49
61
<MenuItem
Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ export const MultiMenu = ({ selectedItems, page }: IMultiMenuProps) => {
220
220
? [ { label : 'Export Items' , fn : exportItems } ]
221
221
: [ ] ;
222
222
223
- const DELETE = { label : 'Delete Items' , fn : deleteItems } ;
223
+ const DELETE = { label : 'Archive Items' , fn : deleteItems } ;
224
224
const RECOVER = {
225
225
label : 'Recover Sandboxes' ,
226
226
fn : ( ) => {
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { Menu } from '@codesandbox/components' ;
3
3
import { ProjectFragment as Repository } from 'app/graphql/types' ;
4
- import { dashboard } from '@codesandbox/common/lib/utils/url-generator' ;
4
+ import {
5
+ dashboard ,
6
+ v2DraftBranchUrl ,
7
+ } from '@codesandbox/common/lib/utils/url-generator' ;
5
8
import { useHistory } from 'react-router-dom' ;
6
9
import { Context , MenuItem } from '../ContextMenu' ;
7
10
@@ -19,6 +22,11 @@ export const RepositoryMenu: React.FC<RepositoryMenuProps> = ({
19
22
owner : providerRepository . owner ,
20
23
name : providerRepository . name ,
21
24
} ) ;
25
+ const branchFromDefaultUrl = v2DraftBranchUrl (
26
+ providerRepository . owner ,
27
+ providerRepository . name
28
+ ) ;
29
+
22
30
const githubUrl = `https://github.com/${ providerRepository . owner } /${ providerRepository . name } ` ;
23
31
24
32
return (
@@ -37,6 +45,10 @@ export const RepositoryMenu: React.FC<RepositoryMenuProps> = ({
37
45
< MenuItem onSelect = { ( ) => window . open ( githubUrl , '_blank' ) } >
38
46
Open on GitHub
39
47
</ MenuItem >
48
+ < Menu . Divider />
49
+ < MenuItem onSelect = { ( ) => window . open ( branchFromDefaultUrl , '_blank' ) } >
50
+ Create branch
51
+ </ MenuItem >
40
52
41
53
{ /* TODO: Implement remove repository
42
54
<Menu.Divider />
You can’t perform that action at this time.
0 commit comments