Skip to content

Commit 4e03236

Browse files
authored
fix(style): fix SensitivePage css and take down aiTeacher (#2199)
1 parent 08002e9 commit 4e03236

2 files changed

Lines changed: 21 additions & 40 deletions

File tree

packages/flat-pages/src/HomePage/MainRoomMenu/index.tsx

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
/* eslint-disable react-hooks/exhaustive-deps */
33
import "./MainRoomMenu.less";
44

5-
import React, { FC, useContext, useMemo } from "react";
5+
import React, { FC, useContext } from "react";
66
import { Col, Row } from "antd";
77
import { Region } from "flat-components";
8-
import { AILanguage, AIRole, AIScene, RoomType } from "@netless/flat-server-api";
8+
import { RoomType } from "@netless/flat-server-api";
99
import { GlobalStoreContext, RoomStoreContext } from "../../components/StoreProvider";
1010
import { RouteNameType, usePushHistory } from "../../utils/routes";
1111
import { CreateRoomBox } from "./CreateRoomBox";
1212
import { JoinRoomBox } from "./JoinRoomBox";
1313
import { ScheduleRoomBox } from "./ScheduleRoomBox";
1414
import { joinRoomHandler } from "../../utils/join-room-handler";
1515
import { errorTips } from "flat-components";
16-
import CreateAIRoomBox from "./CreateAIRoomBox";
16+
// import CreateAIRoomBox from "./CreateAIRoomBox";
1717
export const MainRoomMenu: FC = () => {
1818
const roomStore = useContext(RoomStoreContext);
1919
const globalStore = useContext(GlobalStoreContext);
@@ -27,27 +27,27 @@ export const MainRoomMenu: FC = () => {
2727
}
2828
};
2929

30-
const AIRoomBox = useMemo(() => {
31-
const isCnWeb = window.location.host.includes(".apprtc.cn");
32-
if (!isCnWeb) {
33-
return <CreateAIRoomBox onCreateRoom={createAIRoom} />;
34-
}
35-
return null;
36-
}, [window.location.host]);
30+
// const AIRoomBox = useMemo(() => {
31+
// const isCnWeb = window.location.host.includes(".apprtc.cn");
32+
// if (!isCnWeb) {
33+
// return <CreateAIRoomBox onCreateRoom={createAIRoom} />;
34+
// }
35+
// return null;
36+
// }, [window.location.host]);
3737

3838
return (
3939
<div className="main-room-menu-container">
4040
<Row gutter={24}>
41-
<Col span={6}>
41+
<Col span={8}>
4242
<JoinRoomBox onJoinRoom={onJoinRoom} />
4343
</Col>
44-
<Col span={6}>
44+
<Col span={8}>
4545
<CreateRoomBox onCreateRoom={createOrdinaryRoom} />
4646
</Col>
47-
<Col span={6}>
47+
<Col span={8}>
4848
<ScheduleRoomBox />
4949
</Col>
50-
<Col span={6}>{AIRoomBox}</Col>
50+
{/* <Col span={6}>{AIRoomBox}</Col> */}
5151
</Row>
5252
</div>
5353
);
@@ -67,32 +67,6 @@ export const MainRoomMenu: FC = () => {
6767
pmi: !!pmi,
6868
});
6969

70-
await onJoinRoom(roomUUID);
71-
} catch (e) {
72-
errorTips(e);
73-
}
74-
}
75-
async function createAIRoom(
76-
title: string,
77-
type: RoomType,
78-
region: Region,
79-
role: AIRole,
80-
scene: AIScene,
81-
language: AILanguage,
82-
): Promise<void> {
83-
try {
84-
const roomUUID = await roomStore.createAIRoom({
85-
title,
86-
type,
87-
beginTime: Date.now(),
88-
region,
89-
pmi: false,
90-
isAI: true,
91-
role,
92-
scene,
93-
language,
94-
});
95-
9670
await onJoinRoom(roomUUID);
9771
} catch (e) {
9872
errorTips(e);

packages/flat-pages/src/SensitivePage/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@ export const SensitivePage = observer(function SensitivePage() {
142142
[t],
143143
);
144144

145+
useEffect(() => {
146+
document.getElementById("app")?.style.setProperty("overflow-y", "scroll");
147+
return () => {
148+
document.getElementById("app")?.style.removeProperty("overflow-y");
149+
};
150+
}, []);
151+
145152
if (!token) {
146153
return <Redirect to="/login" />;
147154
}

0 commit comments

Comments
 (0)