-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix profile page & add update profile request & other fixes
- Loading branch information
1 parent
839d1c3
commit 6eb65ee
Showing
37 changed files
with
378 additions
and
61 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
.loki/reference/chrome_iphone7_shared_Modal_Primary_Dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4 Bytes
(100%)
.loki/reference/chrome_laptop_shared_Modal_Primary_Dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
{ | ||
"cancel_button_text": "cancel_button_text", | ||
"edit_button_text": "", | ||
"profile_age_input_placeholder": "profile_age_input_placeholder", | ||
"profile_card_error_text": "profile_card_error_text", | ||
"profile_card_error_title": "profile_card_error_title", | ||
"profile_city_input_placeholder": "profile_city_input_placeholder", | ||
"profile_edit_button_text": "", | ||
"profile_firstname_input_placeholder": "profile_firstname_input_placeholder", | ||
"profile_lastname_input_placeholder": "profile_lastname_input_placeholder", | ||
"profile_title": "" | ||
"profile_title": "", | ||
"save_button_text": "save_button_text" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
{ | ||
"profile_title": "Profile", | ||
"profile_edit_button_text": "Edit", | ||
"profile_firstname_input_placeholder": "Your name", | ||
"profile_lastname_input_placeholder": "Your lastname" | ||
"profile_lastname_input_placeholder": "Your lastname", | ||
"profile_card_error_title": "There was an error loading your profile", | ||
"profile_card_error_text": "Try refreshing your profile page", | ||
"profile_age_input_placeholder": "Your age", | ||
"profile_city_input_placeholder": "Your city" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
{ | ||
"profile_title": "Профиль", | ||
"profile_edit_button_text": "Редактировать", | ||
"profile_firstname_input_placeholder": "Ваше имя", | ||
"profile_lastname_input_placeholder": "Ваша фамилия" | ||
"profile_lastname_input_placeholder": "Ваша фамилия", | ||
"profile_card_error_title": "Произошла ошибка при загрузке профиля", | ||
"profile_card_error_text": "Попробуйте обновить страницу", | ||
"profile_age_input_placeholder": "Ваш возраст", | ||
"profile_city_input_placeholder": "Ваш город" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,9 +26,9 @@ body { | |
|
||
.content-page { | ||
display: flex; | ||
gap: 30px; | ||
} | ||
|
||
.page-wrapper { | ||
flex-grow: 1; | ||
padding: 30px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/entities/Profile/model/selectors/getProfileForm/getProfileForm.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { IStateSchema } from 'shared/config/storeConfig/StateSchema'; | ||
|
||
export const getProfileForm = (state: IStateSchema) => state.profile?.form || undefined; |
3 changes: 3 additions & 0 deletions
3
src/entities/Profile/model/selectors/getProfileReadonly/getProfileReadonly.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { IStateSchema } from 'shared/config/storeConfig/StateSchema'; | ||
|
||
export const getProfileReadonly = (state: IStateSchema) => state.profile?.readonly || false; |
22 changes: 22 additions & 0 deletions
22
src/entities/Profile/model/services/updateProfileData/updateProfileData.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { createAsyncThunk } from '@reduxjs/toolkit'; | ||
import { IThunkConfig } from 'shared/config/storeConfig/StateSchema'; | ||
import { IProfile } from '../../types/profile'; | ||
import { getProfileForm } from '../../selectors/getProfileForm/getProfileForm'; | ||
|
||
export const updateProfileData= createAsyncThunk<IProfile, undefined, IThunkConfig<string>>( | ||
'profile/updateProfileData', | ||
async (_, thunkAPI) => { | ||
const { extra, getState } = thunkAPI; | ||
const formData = getProfileForm( getState() ); | ||
|
||
try { | ||
const response = await extra.api.put<IProfile>( '/profile', formData ); | ||
|
||
thunkAPI.fulfillWithValue( response.data ); | ||
|
||
return response.data; | ||
} catch (err) { | ||
return thunkAPI.rejectWithValue( 'error' ); | ||
} | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.