-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ratmir Tsaregorodtsev
authored and
Ratmir Tsaregorodtsev
committed
Oct 6, 2023
1 parent
feabf1f
commit 385f9a1
Showing
27 changed files
with
166 additions
and
60 deletions.
There are no files selected for viewing
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
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 +1 @@ | ||
export { ProfilePage } from "./profilePage.component"; | ||
export { ProfilePageWithStore as ProfilePage } from "./profilePage.component"; |
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,40 +1,45 @@ | ||
import { Component } from "@/shared/model"; | ||
import styles from "./profilePage.module.css"; | ||
import { ProfilePageProps } from "./profilePage.types"; | ||
import { AuthController } from "@/widgets/auth/api"; | ||
import { connect } from "@/shared/model/store/connect"; | ||
|
||
class ProfilePage extends Component { | ||
constructor(props: ProfilePageProps) { | ||
const authController = new AuthController(); | ||
const { user } = window.store.getState(); | ||
super({ | ||
...props, | ||
user, | ||
userInfoFields: [ | ||
{ | ||
title: "Почта", | ||
value: "[email protected]", | ||
value: user?.email, | ||
type: "info", | ||
}, | ||
{ | ||
title: "Логин", | ||
value: "ivanivanov", | ||
value: user?.login, | ||
type: "info", | ||
}, | ||
{ | ||
title: "Имя", | ||
value: "Иван", | ||
value: user?.first_name, | ||
type: "info", | ||
}, | ||
{ | ||
title: "Фамилия", | ||
value: "Иванов", | ||
value: user?.second_name, | ||
type: "info", | ||
}, | ||
{ | ||
title: "Имя в чате", | ||
value: "Иван", | ||
value: user?.display_name, | ||
type: "info", | ||
}, | ||
{ | ||
title: "Телефон", | ||
value: "+7 (909) 967 30 30", | ||
value: user?.phone, | ||
type: "info", | ||
}, | ||
], | ||
|
@@ -54,27 +59,31 @@ class ProfilePage extends Component { | |
type: "info", | ||
}, | ||
], | ||
handleExitClick: () => { | ||
authController.logout(); | ||
}, | ||
}); | ||
} | ||
protected render() { | ||
return ` | ||
{{#> layout}} | ||
<div class="${styles.profilePage}"> | ||
<div> | ||
{{{ SideButton to="/chats" }}} | ||
{{{ SideButton to="/messenger" }}} | ||
</div> | ||
<div class="${styles.profile}"> | ||
{{{ UserImage }}} | ||
<div class="${styles.username}"> | ||
Иван | ||
</div> | ||
{{{ InfoList items=userInfoFields }}} | ||
{{{ InfoList items=userEditFields }}} | ||
{{{ Button label="Выйти" onClick=handleExitClick }}} | ||
</div> | ||
</div> | ||
{{/layout}} | ||
`; | ||
} | ||
} | ||
|
||
export { ProfilePage }; | ||
const ProfilePageWithStore = connect(({ user }) => ({ user }))(ProfilePage); | ||
export { ProfilePageWithStore }; |
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
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
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,8 +1,8 @@ | ||
interface MessageCardProps { | ||
id: string; | ||
time: string; | ||
userId: string; | ||
content: string; | ||
id?: string; | ||
time?: string; | ||
userId?: string; | ||
content?: string; | ||
} | ||
|
||
export type { MessageCardProps }; |
Oops, something went wrong.