-
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 #36 from Student-Labs-2023/develop
Develop
- Loading branch information
Showing
18 changed files
with
454 additions
and
178 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,111 @@ | ||
import React from 'react' | ||
import { useAuth0 } from "@auth0/auth0-react"; | ||
import React, { useState } from "react"; | ||
import { styled } from "styled-components"; | ||
import avatar from "../../../../public/icons/avatar.svg"; | ||
import CardButton from "../../../shared/ui/cardButton/CardButton"; | ||
|
||
const Container = styled.div` | ||
font-family: var(--font); | ||
color: #000; | ||
display: flex; | ||
width: 100%; | ||
padding: 20px; | ||
justify-content: space-between; | ||
align-items: center; | ||
border-radius: 10px; | ||
background: var(--white, #fff); | ||
box-shadow: 0px 0px 4px 0px #e5eaf8; | ||
`; | ||
|
||
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 = () => { | ||
const [isEmailConfirmed, setIsEmailConfirmed] = useState(false); | ||
const { user } = useAuth0(); | ||
|
||
const sendAccess = () => { | ||
setIsEmailConfirmed(true); | ||
}; | ||
|
||
const UserCard: React.FC= () => { | ||
return ( | ||
<div>UserCard</div> | ||
) | ||
} | ||
<Container> | ||
<User> | ||
<Avatar src={avatar && user?.picture} /> | ||
<Info> | ||
<Name>{user?.name}</Name> | ||
<Email> | ||
<EmailText>{user?.email}</EmailText> | ||
{!user?.email_verified ? ( | ||
<AccessEmail> | ||
{isEmailConfirmed ? ( | ||
<div style={{ color: "var(--green, #5bc259)" }}> | ||
На вашу почту выслано письмо с подтверждением | ||
</div> | ||
) : ( | ||
<AccessText onClick={sendAccess}> | ||
Подтвердите почту | ||
</AccessText> | ||
)} | ||
</AccessEmail> | ||
) : ( | ||
"" | ||
)} | ||
</Email> | ||
</Info> | ||
</User> | ||
<CardButton>Изменить</CardButton> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default UserCard | ||
export default UserCard; |
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 @@ | ||
export { EnterProfileButton } from "./ui/EnterProfileButton"; |
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,26 @@ | ||
import React from "react"; | ||
import { styled } from "styled-components"; | ||
import settingsIcon from "../../../../public/icons/setting-mini.svg"; | ||
import Paragraph from "../../../shared/ui/Paragraph"; | ||
|
||
const Container = styled.div` | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
gap: 8px; | ||
align-items: center; | ||
color: inherit; | ||
`; | ||
|
||
export const EnterProfileButton: React.FC = () => { | ||
function enterProfile() { | ||
window.location.href = "/profile"; | ||
} | ||
|
||
return ( | ||
<Container onClick={enterProfile}> | ||
<img src={settingsIcon} alt="Настройки" /> | ||
<Paragraph>Настройки профиля</Paragraph> | ||
</Container> | ||
); | ||
}; |
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,20 +1,32 @@ | ||
import React from 'react'; | ||
import React from "react"; | ||
import { useAuth0 } from "@auth0/auth0-react"; | ||
import Paragraph from '../../../shared/ui/Paragraph'; | ||
import Paragraph from "../../../shared/ui/Paragraph"; | ||
import logoutIcon from "../../../../public/icons/logout.svg"; | ||
import { styled } from "styled-components"; | ||
|
||
const Container = styled.div` | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
gap: 8px; | ||
align-items: center; | ||
color: inherit; | ||
`; | ||
|
||
export const LogoutButton: React.FC = () => { | ||
const { logout } = useAuth0(); | ||
const { logout } = useAuth0(); | ||
|
||
function logoutFunc(event : any) { | ||
event.preventDefault(); | ||
logout({ logoutParams: { returnTo: window.location.origin } }); | ||
} | ||
function logoutFunc(event: any) { | ||
event.preventDefault(); | ||
logout({ logoutParams: { returnTo: window.location.origin } }); | ||
} | ||
|
||
return ( | ||
<button onClick={logoutFunc}> | ||
<Paragraph> | ||
Выйти | ||
</Paragraph> | ||
</button> | ||
) | ||
} | ||
<Container onClick={logoutFunc}> | ||
<img src={logoutIcon} alt="Выйти" /> | ||
<button> | ||
<Paragraph>Выйти</Paragraph> | ||
</button> | ||
</Container> | ||
); | ||
}; |
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,21 +1,26 @@ | ||
import React from 'react'; | ||
import { observer } from 'mobx-react-lite'; | ||
import navbarState from './store/navbarState'; | ||
import roomsFormState from './store/roomsFormState'; | ||
import { useRoomsList } from '../../entities/room/api/useRoomsList'; | ||
import Header from '../../widgets/layout/Header'; | ||
import Navbar from '../../widgets/layout/Navbar'; | ||
import { CreateRoomForm } from '../../features/createRoom'; | ||
import RoomsList from '../../widgets/RoomsList'; | ||
import user from './store/userState'; | ||
|
||
const Lobby: React.FC = () => { | ||
const Lobby: React.FC = observer(() => { | ||
const { rooms, loading, error } = useRoomsList(); | ||
console.log(user.state); | ||
|
||
const roomsFormStateLS = localStorage.getItem("trigger"); | ||
|
||
return ( | ||
<> | ||
<Header/> | ||
<Navbar activeLink='all' allLength={121}/> | ||
<Navbar/> | ||
{roomsFormState.state || roomsFormStateLS === 'create' && navbarState.state === 'my' ? <CreateRoomForm/> : null} | ||
<RoomsList rooms={rooms} loading={loading} error={error}/> | ||
</> | ||
) | ||
} | ||
}) | ||
|
||
export default Lobby; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.