Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ The responsive header reuses community-app's Wipro, Topcoder, and Topgear logos.
Home links to `https://topgear-app.wipro.com`; Challenges links to
`/opportunities/challenge` on the current Topgear origin. It retains account
controls, without the tool selector, Leaderboard, or the community hero banner.
For signed-in members, the avatar menu links My Profile to
`https://topgear-app.wipro.com/user-details` and Payments to
`https://topgear-app.wipro.com/my_payments` (a new tab), matching community-app.
Account Settings and Log Out remain available. The Wipro destinations apply only
to the two Topgear hosts; other hosts retain their Topcoder profile link.
Deploy the navigation bundle before the Platform UI migration. Its CloudFront
CORS policy must allow the matching Topgear origin (included in the IAC template).
This change does not redirect production community-app URLs.
Expand Down
10 changes: 9 additions & 1 deletion src/lib/components/user-area/UserMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
import type { AuthUser } from "lib/app-context";
import { ACCOUNT_SETTINGS_HOST, CUSTOMER_LOGIN, PROFILE_HOST, APP_AUTH_CONNECTOR } from "lib/config";
import { routeMatchesUrl } from "lib/utils/routes";
import { resolveNavigationType } from "lib/utils/navigation-type";
import styles from "./UserMenu.module.scss";

export let user: AuthUser;
export let onSignOut: () => void;
export let profileCompletionPerc: number | undefined;

const MY_PROFILE_URL = `${PROFILE_HOST}/${user.handle}`;
const topgear = resolveNavigationType('tool', window.location.hostname) === 'topgear';
$: MY_PROFILE_URL = topgear ? 'https://topgear-app.wipro.com/user-details' : `${PROFILE_HOST}/${user.handle}`;
const PAYMENTS_URL = 'https://topgear-app.wipro.com/my_payments';
const ACC_SETTINGS_URL = `${ACCOUNT_SETTINGS_HOST}`;

function isActive(url: string): boolean {
Expand All @@ -29,6 +32,11 @@
class:active={isActive(MY_PROFILE_URL)}
>My Profile</a>
</li>
{#if topgear}
<li>
<a href={PAYMENTS_URL} target="_blank" rel="noopener noreferrer">Payments</a>
</li>
{/if}
<li>
<a
href={ACC_SETTINGS_URL}
Expand Down
Loading