Skip to content

Commit 3769ec8

Browse files
authored
refactor(flat-pages): update styles in room (#1766)
1 parent ada1a75 commit 3769ec8

File tree

20 files changed

+80
-49
lines changed

20 files changed

+80
-49
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ dist/
44
public/
55
storybook-static/
66
.eslintrc.js
7+
*.json

cspell.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ module.exports = {
9595
"pickone", // chance
9696
"viewports", // storybook
9797
"videojs", // @videojs/vhs-utils
98-
"telebox", // @netless/widnow-manager
98+
"tele", // @netless/widnow-manager
99+
"telebox",
99100
"Buildin", // @netless/widnow-manager
100101
"zindex", // antd
101102
"geogebra", // @netless/app-geogebra

desktop/renderer-app/src/tasks/init-ui.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ import { StoreProvider } from "@netless/flat-pages/src/components/StoreProvider"
1111
import { FlatServicesContextProvider } from "@netless/flat-pages/src/components/FlatServicesContext";
1212
import { ipcStore } from "../stores/ipc-store";
1313
import { IPCContext } from "../components/IPCContext";
14+
import { windowsBtnContext } from "../components/WindowsBtnContext";
15+
import { runtime } from "../utils/runtime";
1416

1517
/** configure right after import */
1618
import { configure } from "mobx";
17-
import { windowsBtnContext } from "../components/WindowsBtnContext";
1819
configure({
1920
isolateGlobalState: true,
2021
});
@@ -24,7 +25,7 @@ const App: React.FC = () => {
2425

2526
return (
2627
<AntdProvider lang={language}>
27-
<StoreProvider WindowsBtnContext={windowsBtnContext}>
28+
<StoreProvider WindowsBtnContext={windowsBtnContext} runtime={runtime}>
2829
<IPCContext.Provider value={ipcStore}>
2930
<FlatServicesContextProvider>
3031
<AppRoutes />

packages/flat-components/src/components/ChatPanel/style.less

+2-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616

1717
.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
18-
color: var(--primary);
18+
color: var(--primary-strong);
1919
}
2020

2121
.ant-tabs-top > .ant-tabs-nav::before {
@@ -45,20 +45,11 @@
4545

4646
.flat-color-scheme-dark {
4747
.chat-panel {
48-
.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
49-
color: var(--grey-0);
50-
}
5148
.ant-tabs-ink-bar {
52-
background: var(--grey-0);
49+
background: var(--primary-strong);
5350
}
5451
.ant-tabs-top > .ant-tabs-nav::before {
5552
border-bottom-color: var(--grey-8);
5653
}
57-
.ant-tabs-tab:hover {
58-
color: var(--grey-4);
59-
}
60-
.ant-tabs-tab-btn:focus {
61-
color: var(--grey-0);
62-
}
6354
}
6455
}

packages/flat-components/src/components/ClassroomPage/TopBar/TopBarRightBtn/style.less

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131

3232
.flat-color-scheme-dark {
3333
.topbar-right-btn {
34-
background-color: var(--grey-10);
34+
background-color: transparent;
3535

3636
&:hover {
37-
background-color: var(--grey-11);
37+
background-color: var(--grey-7);
3838
}
3939

4040
&:active {

packages/flat-components/src/components/ClassroomPage/TopBar/style.less

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
padding: 0 8px;
2020
font-size: 16px;
2121
user-select: none;
22+
2223
&.isMac {
2324
border-top: none;
2425
}
@@ -48,6 +49,7 @@
4849
.flat-color-scheme-dark {
4950
.topbar-box {
5051
border-color: var(--grey-8);
52+
background: linear-gradient(270deg, #383B42 0%, #2B2F38 100%);
5153
}
5254

5355
.topbar-divider,

packages/flat-pages/src/BigClassPage/BigClassPage.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
.big-class-realtime-container,
5959
.big-class-realtime-box {
6060
color: var(--text);
61-
background-color: var(--grey-10);
61+
background-color: var(--grey-9);
6262
}
6363

6464
.big-class-realtime-box .topbar-box {

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

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { useLoginCheck } from "../utils/use-login-check";
3535
import { withClassroomStore, WithClassroomStoreProps } from "../utils/with-classroom-store";
3636
import { WindowsSystemBtnContext } from "../components/StoreProvider";
3737
import { ShareScreenPicker } from "../components/ShareScreen/ShareScreenPicker";
38+
import { ExtraPadding } from "../components/ExtraPadding";
3839

3940
export type BigClassPageProps = {};
4041

@@ -103,6 +104,7 @@ export const BigClassPage = withClassroomStore<BigClassPageProps>(
103104
function renderTopBarLeft(): React.ReactNode {
104105
return (
105106
<>
107+
<ExtraPadding />
106108
<NetworkStatus networkQuality={classroomStore.networkQuality} />
107109
{classroomStore.isCreator ? (
108110
classroomStore.roomInfo?.beginTime && (

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

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { useLoginCheck } from "../utils/use-login-check";
3535
import { withClassroomStore, WithClassroomStoreProps } from "../utils/with-classroom-store";
3636
import { WindowsSystemBtnContext } from "../components/StoreProvider";
3737
import { ShareScreenPicker } from "../components/ShareScreen/ShareScreenPicker";
38+
import { ExtraPadding } from "../components/ExtraPadding";
3839

3940
export type OneToOnePageProps = {};
4041

@@ -97,6 +98,7 @@ export const OneToOnePage = withClassroomStore<OneToOnePageProps>(
9798
function renderTopBarLeft(): React.ReactNode {
9899
return (
99100
<>
101+
<ExtraPadding />
100102
<NetworkStatus networkQuality={classroomStore.networkQuality} />
101103
{classroomStore.isCreator ? (
102104
classroomStore.roomInfo?.beginTime && (

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

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { useLoginCheck } from "../utils/use-login-check";
3737
import { withClassroomStore, WithClassroomStoreProps } from "../utils/with-classroom-store";
3838
import { WindowsSystemBtnContext } from "../components/StoreProvider";
3939
import { ShareScreenPicker } from "../components/ShareScreen/ShareScreenPicker";
40+
import { ExtraPadding } from "../components/ExtraPadding";
4041

4142
export type SmallClassPageProps = {};
4243

@@ -134,6 +135,7 @@ export const SmallClassPage = withClassroomStore<SmallClassPageProps>(
134135
function renderTopBarLeft(): React.ReactNode {
135136
return (
136137
<>
138+
<ExtraPadding />
137139
<NetworkStatus networkQuality={classroomStore.networkQuality} />
138140
{classroomStore.isCreator ? (
139141
classroomStore.roomInfo?.beginTime && (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.extra-padding {
2+
display: inline-block;
3+
width: 64px;
4+
height: 1px;
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import "./ExtraPadding.less";
2+
3+
import React, { useContext } from "react";
4+
import { RuntimeContext } from "./StoreProvider";
5+
6+
export const ExtraPadding: React.FC = React.memo(function ExtraPadding() {
7+
const runtime = useContext(RuntimeContext);
8+
return runtime?.isMac ? <div className="extra-padding" /> : null;
9+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export interface IRuntimeContext {
2+
isMac?: boolean;
3+
}

packages/flat-pages/src/components/StoreProvider.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { createContext, FC } from "react";
22
import { preferencesStore, globalStore, roomStore } from "@netless/flat-stores";
33
import { pageStore } from "../stores/page-store";
44
import { WindowsBtnContextInterface } from "./WindowsBtnContext";
5+
import { IRuntimeContext } from "./RuntimeContext";
56

67
export const GlobalStoreContext = createContext(globalStore);
78

@@ -15,18 +16,23 @@ export const WindowsSystemBtnContext = createContext<WindowsBtnContextInterface
1516
undefined,
1617
);
1718

19+
export const RuntimeContext = createContext<IRuntimeContext | undefined>(undefined);
20+
1821
interface StoreProviderProps {
1922
children: React.ReactNode;
2023
WindowsBtnContext?: WindowsBtnContextInterface;
24+
runtime?: IRuntimeContext;
2125
}
2226

23-
export const StoreProvider: FC<StoreProviderProps> = ({ children, WindowsBtnContext }) => (
27+
export const StoreProvider: FC<StoreProviderProps> = ({ children, WindowsBtnContext, runtime }) => (
2428
<GlobalStoreContext.Provider value={globalStore}>
2529
<PreferencesStoreContext.Provider value={preferencesStore}>
2630
<RoomStoreContext.Provider value={roomStore}>
2731
<PageStoreContext.Provider value={pageStore}>
2832
<WindowsSystemBtnContext.Provider value={WindowsBtnContext}>
29-
{children}
33+
<RuntimeContext.Provider value={runtime}>
34+
{children}
35+
</RuntimeContext.Provider>
3036
</WindowsSystemBtnContext.Provider>
3137
</PageStoreContext.Provider>
3238
</RoomStoreContext.Provider>

packages/flat-pages/src/components/Whiteboard.less

+19
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@
107107
opacity: 0;
108108
}
109109

110+
.telebox-manager-container {
111+
--tele-managerStageShadow: none;
112+
}
113+
114+
.fastboard-root {
115+
--fastboard-bg-color: #fff;
116+
--fastboard-border-color: var(--grey-1);
117+
}
118+
110119
.flat-color-scheme-dark {
111120
.whiteboard-container {
112121
background: #15181d;
@@ -120,4 +129,14 @@
120129
.whiteboard-scroll-page {
121130
background: #15181d;
122131
}
132+
133+
.fastboard-root {
134+
--fastboard-bg-color: var(--grey-9);
135+
--fastboard-border-color: var(--grey-8);
136+
}
137+
}
138+
139+
.telebox-color-scheme-dark.telebox-manager-container {
140+
--tele-managerStageShadow: none;
141+
--tele-managerContainerBackground: #222429;
123142
}

packages/flat-pages/src/utils/runtime.ts

-14
This file was deleted.

packages/flat-stores/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"white-web-sdk": ">=2.16"
1515
},
1616
"devDependencies": {
17-
"@netless/fastboard": "1.0.0-canary.7",
17+
"@netless/fastboard": "1.0.0-canary.8",
1818
"@netless/window-manager": "1.0.0-canary.69",
1919
"mobx": "^6.6.1",
2020
"prettier": "^2.7.1",

pnpm-lock.yaml

+14-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

service-providers/agora-rtc/agora-rtc-web/src/rtc-share-screen.ts

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ export class AgoraRTCWebShareScreen extends IServiceShareScreen {
113113

114114
public override async destroy(): Promise<void> {
115115
this._sideEffect.flushAll();
116+
await this.disableShareScreen();
116117
}
117118

118119
private _pTogglingShareScreen?: Promise<unknown>;

service-providers/fastboard/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@lukeed/uuid": "^2.0.0",
13-
"@netless/fastboard": "1.0.0-canary.7",
13+
"@netless/fastboard": "1.0.0-canary.8",
1414
"@netless/flat-i18n": "workspace:*",
1515
"@netless/flat-server-api": "workspace:*",
1616
"@netless/flat-service-provider-file-convert-netless": "workspace:*",

0 commit comments

Comments
 (0)