File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
packages/flat-pages/src/HomePage/MainRoomMenu Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 1+ /* eslint-disable eslint-comments/disable-enable-pair */
2+ /* eslint-disable react-hooks/exhaustive-deps */
13import "./MainRoomMenu.less" ;
24
3- import React , { FC , useContext } from "react" ;
5+ import React , { FC , useContext , useMemo } from "react" ;
46import { Col , Row } from "antd" ;
57import { Region } from "flat-components" ;
68import { AILanguage , AIRole , AIScene , RoomType } from "@netless/flat-server-api" ;
@@ -25,6 +27,14 @@ export const MainRoomMenu: FC = () => {
2527 }
2628 } ;
2729
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 ] ) ;
37+
2838 return (
2939 < div className = "main-room-menu-container" >
3040 < Row gutter = { 24 } >
@@ -37,9 +47,7 @@ export const MainRoomMenu: FC = () => {
3747 < Col span = { 6 } >
3848 < ScheduleRoomBox />
3949 </ Col >
40- < Col span = { 6 } >
41- < CreateAIRoomBox onCreateRoom = { createAIRoom } />
42- </ Col >
50+ < Col span = { 6 } > { AIRoomBox } </ Col >
4351 </ Row >
4452 </ div >
4553 ) ;
You can’t perform that action at this time.
0 commit comments