Skip to content

Commit

Permalink
fix opening create form
Browse files Browse the repository at this point in the history
  • Loading branch information
Emil307 committed Aug 17, 2023
1 parent 1404d6e commit 8eb248d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/entities/room/ui/RoomCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const RoomCard: React.FC<Props> = ({ room }) => {
)}
<Access>
<JoinButton href={`https://network-class-videosdk-client.pages.dev/?roomId=${room.id}&email=${user?.email}`} />
<Tooltip active={tooltipActive}>
<Tooltip active={tooltipActive} message="Ссылка скопирована!">
<Button onClick={copyLink}>
<svg
width="18"
Expand Down
6 changes: 4 additions & 2 deletions src/shared/ui/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const Content = styled.div`
box-shadow: 0px 2px 6px 0px #c5ccd5;
border-radius: 4px;
white-space: nowrap;
font-family: var(--font);
font-size: 14px;
font-style: normal;
Expand All @@ -38,9 +39,10 @@ const Content = styled.div`
interface Props {
active: boolean;
children: React.ReactNode;
message: string;
}

const Tooltip: React.FC<Props> = ({ active, children }) => {
const Tooltip: React.FC<Props> = ({ active, children, message }) => {
return (
<Container>
<Content
Expand All @@ -50,7 +52,7 @@ const Tooltip: React.FC<Props> = ({ active, children }) => {
: { opacity: 0, visibility: "hidden" }
}
>
Ссылка скопирована!
{message}
</Content>
{children}
</Container>
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/FunctionsList/functionsObject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const functions: IFunction[] = [
{
icon: createClass,
iconActive: createClassActive,
title: "Новый класс",
title: "Мои классы",
description: "Создать свой класс и провести занятие онлайн",
link: "/lobby",
onClick: () => {
Expand Down
2 changes: 0 additions & 2 deletions src/widgets/RoomsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ const RoomsList: React.FC<Props> = observer(({ rooms, loading, error }) => {
console.log(searchedRooms);
};

console.log(rooms);

return (
<Container>
<Header>
Expand Down
9 changes: 8 additions & 1 deletion src/widgets/layout/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@ const Navbar: React.FC = observer(() => {
}

function addRoom() {
roomsFormState.openCreateForm();
if (roomsFormState.state === '' && navbarState.state === 'my') {
roomsFormState.openCreateForm();
return 0;
}
if (roomsFormState.state === 'create') {
roomsFormState.closeCreateForm();
return 0;
}
}

function editRooms() {
Expand Down

0 comments on commit 8eb248d

Please sign in to comment.