diff --git a/src-ts/config/constants.ts b/src-ts/config/constants.ts index f52749e6c..3d35f3335 100644 --- a/src-ts/config/constants.ts +++ b/src-ts/config/constants.ts @@ -1,4 +1,5 @@ export enum ToolTitle { + learn = 'Learn', settings = 'Account Settings', work = 'Work', } diff --git a/src-ts/header/tool-selectors/tool-selectors-wide/tool-selector-wide/ToolSelectorWide.tsx b/src-ts/header/tool-selectors/tool-selectors-wide/tool-selector-wide/ToolSelectorWide.tsx index 4ede33554..e30a3c5ba 100644 --- a/src-ts/header/tool-selectors/tool-selectors-wide/tool-selector-wide/ToolSelectorWide.tsx +++ b/src-ts/header/tool-selectors/tool-selectors-wide/tool-selector-wide/ToolSelectorWide.tsx @@ -6,6 +6,7 @@ import { PlatformRoute, routeContext, RouteContextData, + routeIsActiveTool, } from '../../../../lib' import '../../../../lib/styles/index.scss' @@ -19,7 +20,6 @@ const ToolSelectorWide: FC = (props: ToolSelectorWideProp const { getPathFromRoute, - isActiveTool, isRootRoute, }: RouteContextData = useContext(routeContext) @@ -27,7 +27,7 @@ const ToolSelectorWide: FC = (props: ToolSelectorWideProp const toolRoute: PlatformRoute = props.route const toolPath: string = getPathFromRoute(toolRoute) const baseClass: string = 'tool-selector-wide' - const isActive: boolean = isActiveTool(activePath, toolRoute) + const isActive: boolean = routeIsActiveTool(activePath, toolRoute) const activeIndicatorClass: string = `${baseClass}-${isActive ? '' : 'in'}active` // the tool link should be usable for all active routes except the home page diff --git a/src-ts/header/utility-selectors/UtilitySelector/ProfileSelector/profile-not-logged-in/ProfileNotLoggedIn.tsx b/src-ts/header/utility-selectors/UtilitySelector/ProfileSelector/profile-not-logged-in/ProfileNotLoggedIn.tsx index 85b2b1248..d8418087c 100644 --- a/src-ts/header/utility-selectors/UtilitySelector/ProfileSelector/profile-not-logged-in/ProfileNotLoggedIn.tsx +++ b/src-ts/header/utility-selectors/UtilitySelector/ProfileSelector/profile-not-logged-in/ProfileNotLoggedIn.tsx @@ -1,12 +1,26 @@ -import { FC } from 'react' +import { FC, useContext } from 'react' +import { Location, useLocation } from 'react-router-dom' -import { authUrlLogin, authUrlSignup, Button } from '../../../../../lib' +import { + authUrlLogin, + Button, + routeContext, + RouteContextData, +} from '../../../../../lib' import '../../../../../lib/styles/index.scss' import styles from './ProfileNotLoggedIn.module.scss' const ProfileNotLoggedIn: FC<{}> = () => { + const routeData: RouteContextData = useContext(routeContext) + const location: Location = useLocation() + + function signUp(): void { + const signupUrl: string = routeData.getSignupUrl(location.pathname, routeData.toolsRoutes) + window.location.href = signupUrl + } + return ( <>