Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #39

Merged
merged 26 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cb83705
fix edit delete rooms add link for videosdk
Emil307 Aug 15, 2023
5d80ae9
Merge branch 'develop' of https://github.com/Student-Labs-2023/networ…
Emil307 Aug 15, 2023
a7e1a50
fix errors
Emil307 Aug 15, 2023
450b1be
change videosdk url
Emil307 Aug 15, 2023
2f9d23d
fix query params
Emil307 Aug 15, 2023
3942167
add page with UserProfile, change layout of ProfilePanel in the Header
BodySites Aug 15, 2023
232a45a
Merge branch 'develop' of https://github.com/Student-Labs-2023/networ…
BodySites Aug 15, 2023
bda1c85
Merge pull request #35 from Student-Labs-2023/feature/profile
BodySites Aug 15, 2023
b88329f
fix bugs in lobby
Emil307 Aug 15, 2023
93ee863
Merge branch 'develop' of https://github.com/Student-Labs-2023/networ…
Emil307 Aug 15, 2023
3f90d80
fix roomcard layout
Emil307 Aug 15, 2023
e79d019
change loader
Emil307 Aug 16, 2023
11f4f42
add editForm for UserProfile
BodySites Aug 17, 2023
92d719d
Merge pull request #38 from Student-Labs-2023/feature/profile
BodySites Aug 17, 2023
88a5e6a
fix header layout
Emil307 Aug 17, 2023
1404d6e
Merge branch 'develop' of https://github.com/Student-Labs-2023/networ…
Emil307 Aug 17, 2023
8eb248d
fix opening create form
Emil307 Aug 17, 2023
06e6f7a
put styles for ProfilePage in a separate file
BodySites Aug 17, 2023
e197089
fix error
BodySites Aug 17, 2023
980d3ea
add layout of SettingsCallPopup
BodySites Aug 19, 2023
a906506
fix creating classes
Emil307 Aug 19, 2023
ccd98f6
Merge branch 'develop' of https://github.com/Student-Labs-2023/networ…
Emil307 Aug 19, 2023
b9beaee
add SettingsLayout
BodySites Aug 20, 2023
ede2223
completely made popup of settings
BodySites Aug 20, 2023
40dca08
Co-authored-by: Emil <[email protected]>
BodySites Aug 20, 2023
7500ca3
Merge pull request #42 from Student-Labs-2023/feature/settingsPopup
BodySites Aug 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env.development
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'
3 changes: 2 additions & 1 deletion .env.production
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'
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@types/lodash": "^4.14.196",
"@types/react-webcam": "^3.0.0",
"axios": "^1.4.0",
"classnames": "^2.3.2",
"dotenv": "^16.3.1",
"jest": "^29.5.0",
"lib-jitsi-meet": "^1.0.6",
Expand Down
3 changes: 3 additions & 0 deletions public/icons/check_small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/loader.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 4 additions & 6 deletions src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@ import "./index.css";

import Join from "../pages/Join/Join";
import Lobby from "../pages/Lobby/Lobby";
import LobbyAccess from "../pages/Lobby/LobbyAccess";
import LobbyMy from "../pages/Lobby/LobbyMy";
import JoinCall from "../pages/JoinCall/JoinCall";
import CallPage from "../pages/CallPage/CallPage";
import CallPageUI from "../pages/CallPageCustomUI/CallPage";
import Loader from "../shared/ui/loader/Loader";
import { useAuth0 } from "@auth0/auth0-react";
import Profile from "../pages/Profile/Profile";

const App: React.FC = () => {
const { loginWithRedirect, isAuthenticated, isLoading } = useAuth0();

useEffect(() => {
if (!isAuthenticated && !isLoading) {
loginWithRedirect();
loginWithRedirect();
}
}, [isLoading]);

Expand All @@ -29,11 +28,10 @@ const App: React.FC = () => {
<Routes>
<Route path="/" element={<Join />} />
<Route path="/lobby" element={<Lobby />} />
<Route path="/lobby/access" element={<LobbyAccess />} />
<Route path="/lobby/my" element={<LobbyMy />} />
<Route path="/joinlesson/:id" element={<JoinCall />} />
<Route path="/lesson/:id" element={<CallPage />} />
<Route path="/lesson-ui" element={<CallPageUI/>} />
<Route path="/lesson-ui" element={<CallPageUI />} />
<Route path="/profile" element={<Profile />} />
</Routes>
)}
</>
Expand Down
5 changes: 5 additions & 0 deletions src/app/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ input::-ms-clear {
display: none;
}

input[type="checkbox"] {
-webkit-appearance: none;
appearance: none;
}

button {
cursor: pointer;
}
Expand Down
2 changes: 1 addition & 1 deletion src/entities/room/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export interface IRoom {
isActive: boolean,
owner_email: string,
owner_fullname: string
}
}
8 changes: 3 additions & 5 deletions src/entities/room/ui/JoinButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from "styled-components";

const Path = styled.path``;

const Button = styled.button`
const Button = styled.a`
font-family: var(--font);
font-size: 18px;
font-style: normal;
Expand All @@ -30,15 +30,13 @@ const Button = styled.button`
`;

interface Props {
href: number,
href: string,
}

const JoinButton: React.FC<Props> = ({ href }) => {
return (
<Button
onClick={() => {
location.href = `/joinlesson/${href}`;
}}
href={`${href}`}
>
<p>Подключиться</p>
<svg
Expand Down
16 changes: 8 additions & 8 deletions src/entities/room/ui/RoomCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const Container = styled.div`
display: flex;
width: calc(100% - 20px);
padding: 24px;
justify-content: space-between;
align-items: center;

border-radius: 10px;
Expand All @@ -24,13 +23,13 @@ const Container = styled.div`

const Info = styled.div`
display: flex;
width: 329px;
justify-content: space-between;
width: 392px;
gap: 24px;
align-items: center;
`;

const Title = styled.h3`
width: 259px;
width: 100%;
font-family: var(--font);
font-size: 20px;
font-style: normal;
Expand All @@ -41,7 +40,7 @@ const Title = styled.h3`
`;

const Teacher = styled.h4`
min-width: 251px;
min-width: 360px;
font-family: var(--font);
font-size: 18px;
font-style: normal;
Expand All @@ -56,6 +55,7 @@ const Access = styled.div`
width: 229px;
justify-content: space-between;
align-items: center;
margin-left: 129px;
`;

let Path = styled.path``;
Expand Down Expand Up @@ -100,9 +100,9 @@ const RoomCard: React.FC<Props> = ({ room }) => {
) : (
<img src={callDisabled} alt="недоступен" />
)}
<Access style={room.owner_fullname === user?.name ? {width: "249px"} : {}} >
<JoinButton href={room.id} />
<Tooltip active={tooltipActive}>
<Access>
<JoinButton href={`${import.meta.env.VITE_VIDEOSDK_APP}/?roomId=${room.id}&email=${user?.email}`} />
<Tooltip active={tooltipActive} message="Ссылка скопирована!">
<Button onClick={copyLink}>
<svg
width="18"
Expand Down
25 changes: 0 additions & 25 deletions src/entities/user/api/addUser.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/entities/user/api/models.ts
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
}
34 changes: 34 additions & 0 deletions src/entities/user/api/useAddUser.ts
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;
}
107 changes: 101 additions & 6 deletions src/entities/user/ui/UserCard.tsx
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;
Loading