Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 85c9fbe

Browse files
committed
feat: integrate onboarding app
* output of challenge #30215971
1 parent 904c4df commit 85c9fbe

File tree

6 files changed

+16
-1
lines changed

6 files changed

+16
-1
lines changed

src/actions/auth.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ export default {
55
type: ACTIONS.AUTH.LOAD_PROFILE,
66
payload: profile,
77
}),
8+
setProfilePhoto: (photoURL) => ({
9+
type: ACTIONS.AUTH.SET_PROFILE_PHOTO,
10+
payload: photoURL,
11+
}),
812
setTcTokenV3: (tokenV3) => ({
913
type: ACTIONS.AUTH.SET_TOKEN_V3,
1014
payload: tokenV3,

src/constants/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export { APP_CATEGORIES };
77
export const ACTIONS = {
88
AUTH: {
99
LOAD_PROFILE: "LOAD_PROFILE",
10+
SET_PROFILE_PHOTO: "SET_PROFILE_PHOTO",
1011
SET_TOKEN_V3: "SET_TOKEN_V3",
1112
SET_TOKEN_V2: "SET_TOKEN_V2",
1213
SET_INITIALIZED: "SET_INITIALIZED",

src/reducers/auth.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ const authReducer = (state = initialState, action) => {
2929
profile: action.payload,
3030
isProfileLoaded: true,
3131
};
32+
case ACTIONS.AUTH.SET_PROFILE_PHOTO:
33+
return state.profile ? ({
34+
...state,
35+
profile: {...state.profile, photoURL: action.payload},
36+
}) : state;
3237
case ACTIONS.AUTH.SET_INITIALIZED:
3338
return {
3439
...state,

src/topcoder-micro-frontends-navbar-app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
enableSidebarForRoute,
1717
getAuthUserTokens,
1818
getAuthUserProfile,
19+
setUserProfilePhoto,
1920
setNotificationPlatform,
2021
} from "./utils/exports";
2122

@@ -42,6 +43,7 @@ export {
4243
setAppMenu,
4344
getAuthUserTokens,
4445
getAuthUserProfile,
46+
setUserProfilePhoto,
4547
disableSidebarForRoute,
4648
enableSidebarForRoute,
4749
setNotificationPlatform,

src/utils/exports.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import _ from "lodash";
77
import { bindActionCreators } from "redux";
88
import store from "../store";
99
import menuActions from "../actions/menu";
10+
import authActions from "../actions/auth";
1011
import notificationActions from "../actions/notifications";
1112

1213
// bind all the actions for exporting here
@@ -15,12 +16,14 @@ export const {
1516
disableSidebarForRoute,
1617
enableSidebarForRoute,
1718
setNotificationPlatform,
19+
setUserProfilePhoto
1820
} = bindActionCreators(
1921
{
2022
setAppMenu: menuActions.setAppMenu,
2123
disableSidebarForRoute: menuActions.disableSidebarForRoute,
2224
enableSidebarForRoute: menuActions.enableSidebarForRoute,
2325
setNotificationPlatform: notificationActions.setNotificationPlatform,
26+
setUserProfilePhoto: authActions.setProfilePhoto,
2427
},
2528
store.dispatch
2629
);

webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = (webpackConfigEnv, options) => {
3434
rules: [
3535
{
3636
/* Loads svg images. */
37-
test: /[/\\]assets[/\\]images[/\\].+\.svg$/,
37+
test: /[/\/\\]assets[/\/\\]images[/\/\\].+\.svg$/,
3838
exclude: /node_modules/,
3939
loader: "file-loader",
4040
options: {

0 commit comments

Comments
 (0)