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

feat(flat-web): add one to one class page to flat-web #725

Merged
merged 1 commit into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions web/flat-web/src/AppRoutes/route-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ export const routePages: RoutePages = {
title: "Flat",
component: () => import("../pages/HomePage"),
},
[RouteNameType.BigClassPage]: {
title: "BigClassPage",
component: () => import("../pages/BigClassPage"),
},
[RouteNameType.SmallClassPage]: {
title: "SmallClassPage",
component: () => import("../pages/SmallClassPage"),
},
[RouteNameType.OneToOnePage]: {
title: "OneToOnePage",
component: () => Promise.resolve({ default: () => null }),
},
[RouteNameType.BigClassPage]: {
title: "BigClassPage",
component: () => import("../pages/BigClassPage"),
component: () => import("../pages/OneToOnePage"),
},
[RouteNameType.RoomDetailPage]: {
title: "RoomDetailPage",
Expand Down
22 changes: 22 additions & 0 deletions web/flat-web/src/pages/OneToOnePage/OneToOneAvatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";
import { OneToOneVideoAvatar, OneToOneVideoAvatarProps } from "flat-components";
import { AvatarCanvas } from "../../components/AvatarCanvas";
import { User } from "../../stores/UserStore";
import { RtcRoom } from "../../apiMiddleware/rtc/room";

export interface OneToOneAvatarProps extends Omit<OneToOneVideoAvatarProps, "avatarUser"> {
rtc: RtcRoom;
avatarUser?: User | null;
}

export const OneToOneAvatar: React.FC<OneToOneAvatarProps> = ({
avatarUser,
rtc,
...restProps
}) => (
<OneToOneVideoAvatar {...restProps} avatarUser={avatarUser}>
{avatarUser && <AvatarCanvas {...restProps} avatarUser={avatarUser} rtcRoom={rtc} />}
</OneToOneVideoAvatar>
);

export default OneToOneAvatar;
19 changes: 19 additions & 0 deletions web/flat-web/src/pages/OneToOnePage/OneToOnePage.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.one-to-one-realtime-box {
width: 100%;
height: 100vh;
overflow: hidden;
display: flex;
flex-direction: column;
}

.one-to-one-realtime-content {
flex: 1;
display: flex;
}

.one-to-one-rtc-avatar-container {
width: 288px;
height: 216px;
overflow: hidden;
display: flex;
}
Loading