From 5e16bd1e8f721e3378cd2dd5fe3099f12bebca87 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 12 Oct 2020 10:16:38 +0300 Subject: [PATCH 1/7] #5032 removed dropdown --- .../components/tc-communities/Header/index.jsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/shared/components/tc-communities/Header/index.jsx b/src/shared/components/tc-communities/Header/index.jsx index c610f947e6..14ef6b98da 100644 --- a/src/shared/components/tc-communities/Header/index.jsx +++ b/src/shared/components/tc-communities/Header/index.jsx @@ -232,14 +232,16 @@ function Header(props) {
{renderedLogos}
- -
- -
- + { + !_.startsWith(communityId, 'tco') ? ( +
+ +
+ ) : null + }
{profile && ( From b8c4a594cd986c7f0303d0f25c303a3bac4960d0 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Mon, 12 Oct 2020 12:47:18 +0300 Subject: [PATCH 2/7] Add logo and profile --- src/assets/themes/tco/TCO20.svg | 36 ++++++++++ src/shared/app.jsx | 2 +- .../tc-communities/tco20/Header.jsx | 68 +++++++++++++++++++ .../tc-communities/tco20/header.scss | 33 +++++++++ .../routes/Communities/TCO20/Routes.jsx | 13 +--- 5 files changed, 140 insertions(+), 12 deletions(-) create mode 100644 src/assets/themes/tco/TCO20.svg create mode 100644 src/shared/containers/tc-communities/tco20/Header.jsx create mode 100644 src/shared/containers/tc-communities/tco20/header.scss diff --git a/src/assets/themes/tco/TCO20.svg b/src/assets/themes/tco/TCO20.svg new file mode 100644 index 0000000000..75ad154442 --- /dev/null +++ b/src/assets/themes/tco/TCO20.svg @@ -0,0 +1,36 @@ + + + TCO20 Logo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/shared/app.jsx b/src/shared/app.jsx index fa3d6bd2b6..7d80ade47d 100644 --- a/src/shared/app.jsx +++ b/src/shared/app.jsx @@ -49,7 +49,7 @@ export default function App() { transitionOut="fadeOut" progressBar={false} /> - { isomorphy.isDevBuild() ? : undefined } + {/* { isomorphy.isDevBuild() ? : undefined } */}
); } diff --git a/src/shared/containers/tc-communities/tco20/Header.jsx b/src/shared/containers/tc-communities/tco20/Header.jsx new file mode 100644 index 0000000000..a6f8d32e5f --- /dev/null +++ b/src/shared/containers/tc-communities/tco20/Header.jsx @@ -0,0 +1,68 @@ +/** TCO20 special header */ + +import PT from 'prop-types'; +import React from 'react'; +import ContentfulMenu from 'components/Contentful/Menu'; +import { Link } from 'topcoder-react-utils'; +import { connect } from 'react-redux'; +import { Avatar } from 'topcoder-react-ui-kit'; +import TCO20Logo from 'assets/themes/tco/TCO20.svg'; +import defaultStyle from './header.scss'; + +function TCO20Header(props) { + const { base, meta, auth } = props; + console.log('TCO20Header', props) + return ( +
+ + + + { + meta.menuItems ? ( + + ) : null + } +
+ { + auth && auth.profile ? ( + + + {auth.profile.handle} + + + + ) : ( + + LOGIN + SIGN UP + + ) + } +
+
+ ); +} + +TCO20Header.defaultProps = { + base: '', + auth: null, +}; + +TCO20Header.propTypes = { + base: PT.string, + meta: PT.shape().isRequired, + auth: PT.shape(), +}; + +function mapStateToProps(state) { + return { + auth: state.auth, + }; +} + +export default connect(mapStateToProps)(TCO20Header); diff --git a/src/shared/containers/tc-communities/tco20/header.scss b/src/shared/containers/tc-communities/tco20/header.scss new file mode 100644 index 0000000000..03fefdd913 --- /dev/null +++ b/src/shared/containers/tc-communities/tco20/header.scss @@ -0,0 +1,33 @@ +@import '~styles/mixins'; + +.topHeader { + display: flex; + align-items: center; + background-color: $tc-black; + + @include xs-to-sm { + flex-direction: column; + padding-top: 15px; + } + + .headerLogo { + svg { + max-height: 28px; + } + } + + .profile { + margin-right: 26px; + display: flex; + + .userMenuHandle { + color: #fff; + font-size: 14px; + font-weight: 700; + line-height: 30px; + white-space: nowrap; + font-family: Roboto, sans-serif; + margin-right: 12px; + } + } +} diff --git a/src/shared/routes/Communities/TCO20/Routes.jsx b/src/shared/routes/Communities/TCO20/Routes.jsx index 3f4ab6b468..bfb0a513bb 100644 --- a/src/shared/routes/Communities/TCO20/Routes.jsx +++ b/src/shared/routes/Communities/TCO20/Routes.jsx @@ -7,24 +7,15 @@ import PT from 'prop-types'; import React from 'react'; import { Route, Switch } from 'react-router-dom'; import ContentfulRoute from 'components/Contentful/Route'; -import ContentfulMenu from 'components/Contentful/Menu'; import Viewport from 'components/Contentful/Viewport'; import Profile from 'routes/Profile'; import ProfileStats from 'routes/ProfileStats'; +import TCO20Header from 'containers/tc-communities/tco20/Header'; export default function TCO20({ base, meta }) { return (
- { - meta.menuItems ? ( - - ) : null - } + } From 2b09f0e7ae9601fb6e3c661363372e7e8fa3dc46 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Thu, 15 Oct 2020 11:19:27 +0300 Subject: [PATCH 3/7] Fixes for #5032 --- src/shared/app.jsx | 2 +- src/shared/components/buttons/themed/tc.scss | 3 + .../tc-communities/tco20/Header.jsx | 55 ++++++++++++------- .../tc-communities/tco20/header.scss | 39 ++++++++++++- src/shared/utils/url.js | 9 +++ 5 files changed, 84 insertions(+), 24 deletions(-) diff --git a/src/shared/app.jsx b/src/shared/app.jsx index 7d80ade47d..fa3d6bd2b6 100644 --- a/src/shared/app.jsx +++ b/src/shared/app.jsx @@ -49,7 +49,7 @@ export default function App() { transitionOut="fadeOut" progressBar={false} /> - {/* { isomorphy.isDevBuild() ? : undefined } */} + { isomorphy.isDevBuild() ? : undefined }
); } diff --git a/src/shared/components/buttons/themed/tc.scss b/src/shared/components/buttons/themed/tc.scss index 952fd18d83..1c0e006caf 100644 --- a/src/shared/components/buttons/themed/tc.scss +++ b/src/shared/components/buttons/themed/tc.scss @@ -7,6 +7,7 @@ text-decoration: none !important; text-transform: uppercase !important; margin: 0 !important; + white-space: nowrap !important; } @mixin primary-green { @@ -107,6 +108,7 @@ text-decoration: none !important; text-transform: uppercase !important; margin: 0 !important; + white-space: nowrap !important; } @mixin secondary-gray { @@ -133,6 +135,7 @@ font-weight: 700 !important; text-transform: uppercase !important; margin: 0 !important; + white-space: nowrap !important; } @mixin warn-red { diff --git a/src/shared/containers/tc-communities/tco20/Header.jsx b/src/shared/containers/tc-communities/tco20/Header.jsx index a6f8d32e5f..f38752317a 100644 --- a/src/shared/containers/tc-communities/tco20/Header.jsx +++ b/src/shared/containers/tc-communities/tco20/Header.jsx @@ -3,20 +3,47 @@ import PT from 'prop-types'; import React from 'react'; import ContentfulMenu from 'components/Contentful/Menu'; -import { Link } from 'topcoder-react-utils'; +import { Link, config } from 'topcoder-react-utils'; import { connect } from 'react-redux'; import { Avatar } from 'topcoder-react-ui-kit'; +import MediaQuery from 'react-responsive'; +import { getCurrentUrl } from 'utils/url'; import TCO20Logo from 'assets/themes/tco/TCO20.svg'; import defaultStyle from './header.scss'; function TCO20Header(props) { const { base, meta, auth } = props; - console.log('TCO20Header', props) + const profileHTML = () => ( +
+ { + auth && auth.profile ? ( + + + {auth.profile.handle} + + + + ) : ( + + LOGIN + SIGN UP + + ) + } +
+ ); return (
- - - +
+ + + + + { + profileHTML() + } + +
{ meta.menuItems ? ( ) : null } -
+ { - auth && auth.profile ? ( - - - {auth.profile.handle} - - - - ) : ( - - LOGIN - SIGN UP - - ) + profileHTML() } -
+
); } diff --git a/src/shared/containers/tc-communities/tco20/header.scss b/src/shared/containers/tc-communities/tco20/header.scss index 03fefdd913..ebe422a655 100644 --- a/src/shared/containers/tc-communities/tco20/header.scss +++ b/src/shared/containers/tc-communities/tco20/header.scss @@ -1,4 +1,5 @@ @import '~styles/mixins'; +@import 'components/buttons/themed/tc.scss'; .topHeader { display: flex; @@ -10,9 +11,22 @@ padding-top: 15px; } - .headerLogo { - svg { - max-height: 28px; + .logoWrapp { + display: flex; + justify-content: space-between; + + @include xs-to-sm { + width: 100%; + } + + .headerLogo { + svg { + max-height: 28px; + + @include xs-to-sm { + margin-left: -35px; + } + } } } @@ -29,5 +43,24 @@ font-family: Roboto, sans-serif; margin-right: 12px; } + + .loginLink { + text-decoration: none; + color: #888894; + font-family: Roboto, sans-serif; + font-size: 13px; + font-weight: bold; + line-height: 30px; + margin-right: 30px; + } + + .signUpLink { + @include primary-borderless; + @include sm; + + &:hover { + @include primary-borderless; + } + } } } diff --git a/src/shared/utils/url.js b/src/shared/utils/url.js index f7c76b3da9..52ad5430a8 100644 --- a/src/shared/utils/url.js +++ b/src/shared/utils/url.js @@ -8,6 +8,15 @@ import _ from 'lodash'; import qs from 'qs'; import { isomorphy } from 'topcoder-react-utils'; import { BUCKETS } from 'utils/challenge-listing/buckets'; + +/** + * Get current URL + */ +export function getCurrentUrl() { + if (isomorphy.isServerSide()) return null; + return window.location.href; +} + /** * Get current URL hash parameters as object */ From 33e2226ef26e7dd6beaac47ac34f9302145ca977 Mon Sep 17 00:00:00 2001 From: Luiz Ricardo Rodrigues Date: Mon, 19 Oct 2020 02:56:44 -0300 Subject: [PATCH 4/7] ci: deploy tco-header-dropdown to Stag env Issue #5032 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1e58d6ae06..95062ab5be 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -260,7 +260,7 @@ workflows: branches: only: - develop - - listing-develop-sync + - tco-header-dropdown # Production builds are exectuted # when PR is merged to the master # Don't change anything in this configuration From 3451199bc1e43a19574254c0b1c4ea1e64a98e4c Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Tue, 20 Oct 2020 12:11:21 +0300 Subject: [PATCH 5/7] ci: on test --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 95062ab5be..4107303602 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -237,7 +237,7 @@ workflows: filters: branches: only: - - hot-fix + - tco-header-dropdown # This is alternate dev env for parallel testing - "build-qa": context : org-global From 6ffa4df622ea5afb8c4a8338aedea64058b56419 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Wed, 21 Oct 2020 09:53:04 +0300 Subject: [PATCH 6/7] ci: remove from staging --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4107303602..1fd5ef843b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -260,7 +260,6 @@ workflows: branches: only: - develop - - tco-header-dropdown # Production builds are exectuted # when PR is merged to the master # Don't change anything in this configuration From fd5a6d3d1c77613897004ee189d7c764d0d8a8b3 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Wed, 21 Oct 2020 10:03:48 +0300 Subject: [PATCH 7/7] Fixed return URL bug --- src/shared/containers/tc-communities/tco20/Header.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/containers/tc-communities/tco20/Header.jsx b/src/shared/containers/tc-communities/tco20/Header.jsx index f38752317a..57057f0e8d 100644 --- a/src/shared/containers/tc-communities/tco20/Header.jsx +++ b/src/shared/containers/tc-communities/tco20/Header.jsx @@ -25,7 +25,7 @@ function TCO20Header(props) { ) : ( - LOGIN + LOGIN SIGN UP )