-
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.
Merge pull request #39 from Student-Labs-2023/develop
Develop
- Loading branch information
Showing
58 changed files
with
1,422 additions
and
311 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
VITE_AUTH0_DOMAIN="dev-txpc5harm481cb6o.us.auth0.com" | ||
VITE_AUTH0_CLIENT_ID="BOU97TMrp85ftAnrXSLTiYYiuifp9jfz" | ||
VITE_API='https://network-class-server.ru' | ||
VITE_WS_API='wss://network-class-server.ru' | ||
VITE_WS_API='wss://network-class-server.ru' | ||
VITE_VIDEOSDK_APP='http://localhost:3000/react-rtc-demo' |
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,4 +1,5 @@ | ||
VITE_AUTH0_DOMAIN="dev-txpc5harm481cb6o.us.auth0.com" | ||
VITE_AUTH0_CLIENT_ID="fOB3CWsgCnNLI5q7OMWe9DfWaAXOme2o" | ||
VITE_API='https://network-class-server.ru' | ||
VITE_WS_API='wss://network-class-server.ru' | ||
VITE_WS_API='wss://network-class-server.ru' | ||
VITE_VIDEOSDK_APP='https://network-class-videosdk-client.pages.dev' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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.
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 |
---|---|---|
|
@@ -7,4 +7,4 @@ export interface IRoom { | |
isActive: boolean, | ||
owner_email: string, | ||
owner_fullname: string | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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,5 +1,5 @@ | ||
export interface IUser { | ||
full_name: string, | ||
photo_url: string, | ||
enail: string | ||
email: string | ||
} |
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,34 @@ | ||
import { useState, useEffect } from 'react'; | ||
|
||
export const useAddUser = (fullname: any, photo_url: string, email: any) => { | ||
const API = String(import.meta.env.VITE_API); | ||
const [user, setUser] = useState({}); | ||
|
||
const newUser = { | ||
full_name: fullname, | ||
photo_url: photo_url, | ||
email: email | ||
} | ||
|
||
async function createUser() { | ||
await fetch(`${API}/users`, { | ||
method : 'POST', | ||
headers: { | ||
'Content-type': 'application/json', | ||
}, | ||
body : JSON.stringify(newUser), | ||
}) | ||
.then(response => response.text()) | ||
.then(response => { | ||
response = JSON.parse(response); | ||
console.log(response); | ||
setUser(response); | ||
}) | ||
} | ||
|
||
useEffect(() => { | ||
createUser(); | ||
}, []) | ||
|
||
return user; | ||
} |
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,9 +1,104 @@ | ||
import React from 'react' | ||
import { useAuth0 } from "@auth0/auth0-react"; | ||
import React from "react"; | ||
import { styled } from "styled-components"; | ||
import avatar from "../../../../public/icons/avatar.svg"; | ||
import CardButton from "../../../shared/ui/cardButton/CardButton"; | ||
import ProfileFormLayout from "../../../widgets/layout/ProfileFormLayout"; | ||
import profileFormState from "../../../pages/Profile/store/profileFormState"; | ||
import { observer } from "mobx-react-lite"; | ||
|
||
const User = styled.div` | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
gap: 20px; | ||
`; | ||
|
||
const Avatar = styled.img` | ||
width: 86px; | ||
height: 86px; | ||
border-radius: 10px; | ||
`; | ||
|
||
const Info = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 8px; | ||
`; | ||
|
||
const Name = styled.div` | ||
font-size: 22px; | ||
font-weight: 500; | ||
`; | ||
|
||
const Email = styled.div` | ||
display: flex; | ||
align-items: center; | ||
gap: 12px; | ||
`; | ||
|
||
const EmailText = styled.div` | ||
font-size: 20px; | ||
font-weight: 300; | ||
line-height: normal; | ||
`; | ||
|
||
const AccessEmail = styled.a` | ||
font-size: 20px; | ||
font-weight: 300; | ||
line-height: normal; | ||
`; | ||
|
||
const AccessText = styled.a` | ||
color: var(--red, #f95a39); | ||
&:hover { | ||
text-decoration: underline; | ||
cursor: pointer; | ||
} | ||
`; | ||
|
||
const UserCard: React.FC = observer(() => { | ||
const { user } = useAuth0(); | ||
|
||
const sendAccess = () => { | ||
profileFormState.confirmEmail(); | ||
}; | ||
|
||
const openForm = () => { | ||
profileFormState.openEditForm(); | ||
}; | ||
|
||
const UserCard: React.FC= () => { | ||
return ( | ||
<div>UserCard</div> | ||
) | ||
} | ||
<ProfileFormLayout> | ||
<User> | ||
<Avatar src={avatar && user?.picture} /> | ||
<Info> | ||
<Name>{user?.name}</Name> | ||
<Email> | ||
<EmailText>{user?.email}</EmailText> | ||
{!user?.email_verified ? ( | ||
<AccessEmail> | ||
{profileFormState.isEmailConfirmed ? ( | ||
<div style={{ color: "var(--green, #5bc259)" }}> | ||
На вашу почту выслано письмо с подтверждением | ||
</div> | ||
) : ( | ||
<AccessText onClick={sendAccess}> | ||
Подтвердите почту | ||
</AccessText> | ||
)} | ||
</AccessEmail> | ||
) : ( | ||
"" | ||
)} | ||
</Email> | ||
</Info> | ||
</User> | ||
<CardButton onClick={openForm}>Изменить</CardButton> | ||
</ProfileFormLayout> | ||
); | ||
}); | ||
|
||
export default UserCard | ||
export default UserCard; |
Oops, something went wrong.