This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree 7 files changed +54
-5
lines changed
MyTeamsList/components/TeamCard
7 files changed +54
-5
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ module.exports = {
4
4
*/
5
5
TOPCODER_COMMUNITY_WEBSITE_URL : "https://topcoder-dev.com" ,
6
6
7
+ /**
8
+ * URL of Topcoder Connect Website
9
+ */
10
+ CONNECT_WEBSITE_URL : "https://connect.topcoder-dev.com" ,
11
+
7
12
/**
8
13
* Email to report issues to
9
14
*/
Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ module.exports = {
4
4
*/
5
5
TOPCODER_COMMUNITY_WEBSITE_URL : "https://topcoder.com" ,
6
6
7
+ /**
8
+ * URL of Topcoder Connect Website
9
+ */
10
+ CONNECT_WEBSITE_URL : "https://connect.topcoder.com" ,
11
+
7
12
/**
8
13
* Email to report issues to
9
14
*/
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import React from "react";
7
7
import PT from "prop-types" ;
8
8
import DataItem from "components/DataItem" ;
9
9
import {
10
+ formatConnectProjectUrl ,
10
11
formatMoney ,
11
12
formatRemainingTimeForTeam ,
12
13
formatReportIssueUrl ,
@@ -39,6 +40,14 @@ const TeamSummary = ({ team }) => {
39
40
</ div >
40
41
41
42
< div styleName = "actions" >
43
+ < Button
44
+ href = { formatConnectProjectUrl ( team . id ) }
45
+ target = "_blank"
46
+ type = "secondary"
47
+ size = "medium"
48
+ >
49
+ Open in Connect
50
+ </ Button >
42
51
< Button
43
52
type = "warning"
44
53
size = "medium"
Original file line number Diff line number Diff line change 19
19
}
20
20
21
21
.actions {
22
- margin-top : 20px ;
22
+ display : flex ;
23
+ flex-wrap : wrap ;
24
+
25
+ > * {
26
+ margin-top : 20px ;
27
+ }
28
+
29
+ > * :not (:last-child ) {
30
+ margin-right : 10px ;
31
+ }
23
32
}
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import TeamSummary from "./components/TeamSummary";
15
15
import TeamMembers from "./components/TeamMembers" ;
16
16
import TeamPositions from "./components/TeamPositions" ;
17
17
import withAuthentication from "../../hoc/withAuthentication" ;
18
- import { useAsync } from "react-use" ;
19
18
20
19
const MyTeamsDetails = ( { teamId } ) => {
21
20
const [ team , loadingError ] = useData ( getTeamById , teamId ) ;
Original file line number Diff line number Diff line change @@ -7,8 +7,6 @@ import "./styles.module.scss";
7
7
import _ from "lodash" ;
8
8
import { Link } from "@reach/router" ;
9
9
import DataItem from "components/DataItem" ;
10
- import moment from "moment" ;
11
- import { DAY_FORMAT } from "constants" ;
12
10
import IconCalendar from "../../../../assets/images/icon-calendar.svg" ;
13
11
import IconClock from "../../../../assets/images/icon-clock.svg" ;
14
12
import IconMoney from "../../../../assets/images/icon-money.svg" ;
@@ -18,6 +16,7 @@ import {
18
16
formatMoney ,
19
17
formatRemainingTimeForTeam ,
20
18
formatReportIssueUrl ,
19
+ formatConnectProjectUrl ,
21
20
} from "utils/format" ;
22
21
import AvatarGroup from "components/AvatarGroup" ;
23
22
import ThreeDotsMenu from "components/ThreeDotsMenu" ;
@@ -28,6 +27,15 @@ const TeamCard = ({ team }) => {
28
27
< div styleName = "three-dots-menu" >
29
28
< ThreeDotsMenu
30
29
options = { [
30
+ {
31
+ label : "Open in Connect" ,
32
+ action : ( ) => {
33
+ window . open ( formatConnectProjectUrl ( team . id ) ) ;
34
+ } ,
35
+ } ,
36
+ {
37
+ separator : true ,
38
+ } ,
31
39
{
32
40
label : "Report an Issue" ,
33
41
action : ( ) => {
Original file line number Diff line number Diff line change 3
3
*/
4
4
import _ from "lodash" ;
5
5
import { RATE_TYPE } from "constants" ;
6
- import { EMAIL_REPORT_ISSUE , EMAIL_REQUEST_EXTENSION } from "../../config" ;
6
+ import {
7
+ EMAIL_REPORT_ISSUE ,
8
+ EMAIL_REQUEST_EXTENSION ,
9
+ CONNECT_WEBSITE_URL ,
10
+ } from "../../config" ;
7
11
import moment from "moment" ;
8
12
import { DAY_FORMAT } from "constants/" ;
9
13
14
+ /**
15
+ * Format URL to the project (team) in Connect App.
16
+ *
17
+ * @param {string|number } teamId team (project) id
18
+ *
19
+ * @returns {string } URL to Connect project
20
+ */
21
+ export const formatConnectProjectUrl = ( teamId ) =>
22
+ `${ CONNECT_WEBSITE_URL } /projects/${ teamId } ` ;
23
+
10
24
/**
11
25
* Formats number with base word in singular or plural form depend on the number.
12
26
*
You can’t perform that action at this time.
0 commit comments