Skip to content

Commit 41edbf3

Browse files
Chethan2k1bestinbthomas
authored andcommitted
Change the Route for profile user stats
1 parent a8d702e commit 41edbf3

File tree

5 files changed

+10
-14
lines changed

5 files changed

+10
-14
lines changed

src/app/components/Leaderboard/LeaderboardElement.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ const colors = ['#FFB900', '#69797E', '#847545', '#038387'];
1616
export class LeaderboardElement extends React.Component<LeaderboardInterfaces.ElementProps, {}> {
1717
public render() {
1818
const { player, index, isPlayAgainstDisabled, runMatch, currentUsername } = this.props;
19+
let urlToProfile;
1920
if (player.username === currentUsername) {
20-
const urlToProfile = `/profile`;
21+
urlToProfile = `/profile`;
2122
} else {
22-
const urlToProfile = `/profile/${player.username}`;
23+
urlToProfile = `/profile/${player.username}`;
2324
}
2425
const playerTotalMatches = player.numWin + player.numLoss + player.numTie;
2526

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import * as ProfileUserInterface from 'app/types/ProfileUser';
22
import * as React from 'react';
33

4-
export class ProfileUserStats extends React.Component<ProfileUserInterface.Props, {}> {
4+
export default class ProfileUserStats extends React.Component<ProfileUserInterface.Props, {}> {
55
public render() {
6+
console.log(this.props.match.params.username);
67
return <p>This is the Page for Profile user stats</p>;
7-
}
8+
}
89
}

src/app/containers/ProfileUsersStats.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ProfileUserActions } from 'app/actions';
2-
import { ProfileUserStats } from 'app/components/ProfileUserStats';
2+
import ProfileUserStats from 'app/components/ProfileUserStats';
33
import { RootState } from 'app/reducers';
44
import * as ProfileUserInterfaces from 'app/types/ProfileUser';
55
import { connect } from 'react-redux';

src/app/index.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import Login from 'app/containers/Authentication/Login';
33
import Register from 'app/containers/Authentication/Register';
44
import Dashboard from 'app/containers/Dashboard';
55
import Leaderboard from 'app/containers/Leaderboard';
6+
import ProfileUsersStats from 'app/containers/ProfileUsersStats';
67
import UserProfileModal from 'app/containers/UserProfileModal';
7-
import profileUserContainer from 'app/containers/ProfileUsersStats'
88
import { Routes } from 'app/routes';
99
// @ts-ignore
1010
import { initializeRendererAssets } from 'codecharacter-renderer';
@@ -25,11 +25,8 @@ export const App = hot(module)(() => (
2525
<Route exact path={Routes.REGISTER} component={Register} />
2626
<Route exact path={Routes.LEADERBOARD} component={Leaderboard} />
2727
<Route exact path={Routes.USER_PROFILE_MODEL} component={UserProfileModal} />
28-
<<<<<<< HEAD
2928
<Route path={Routes.USER_ACTIVATION} component={ActivateUser} />
30-
=======
31-
<Route exact path={Routes.PROFILE_USER_STATS} component={profileUserContainer} />
32-
>>>>>>> Add route for /profile/:user and Add the required container
29+
<Route exact path={Routes.PROFILE_USER_STATS} component={ProfileUsersStats} />
3330
</Switch>
3431
<Sugar background="#484848" color="white" />
3532
</BrowserRouter>

src/app/routes.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ export enum Routes {
44
REGISTER = '/register',
55
LEADERBOARD = '/leaderboard',
66
USER_PROFILE_MODEL = '/profile',
7-
<<<<<<< HEAD
87
GITHUB_OAUTH = '/login/github',
98
GOOGLE_OAUTH = '/login/google',
109
USER_ACTIVATION = '/user-activate',
11-
=======
12-
PROFILE_USER_STATS = '/profile/:username',
13-
>>>>>>> Add route for /profile/:user and Add the required container
10+
PROFILE_USER_STATS = '/:username',
1411
}

0 commit comments

Comments
 (0)