Skip to content

Commit

Permalink
refactor(flat-components): update styles and fix trivial issues (#1831)
Browse files Browse the repository at this point in the history
* refactor(flat-components): update windows system button background

* refactor(flat-components): show left users staging state at beginning

* refactor(desktop): remove splash page

* refactor(flat-pages): update app upgrade modal colors

* refactor(flat-components): update self message color

* fix(flat-pages): dragging avatars null error

* chore: upgrade @netless/app-slide, fix keyboard shortcut

* fix(service-providers): disable scrolling whiteboard when necessary

* chore(desktop): update installer icon
  • Loading branch information
hyrious committed Feb 8, 2023
1 parent e58da46 commit bbe58ab
Show file tree
Hide file tree
Showing 18 changed files with 73 additions and 65 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
"i18n-ally.displayLanguage": "zh-CN",
"eslint.enable": true,
"eslint.format.enable": true,
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"[less]": {
"editor.defaultFormatter": "vscode.css-language-features"
}
}
1 change: 1 addition & 0 deletions desktop/main-app/electron-builder/CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ nsis:
createStartMenuShortcut: true
allowToChangeInstallationDirectory: true
installerIcon: resources/install.ico
installerHeaderIcon: resources/header.ico
shortcutName: Flat
artifactName: Flat-${version}.${ext}

Expand Down
1 change: 1 addition & 0 deletions desktop/main-app/electron-builder/US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ nsis:
createStartMenuShortcut: true
allowToChangeInstallationDirectory: true
installerIcon: resources/install.ico
installerHeaderIcon: resources/header.ico
shortcutName: Flint
artifactName: Flint-${version}.${ext}

Expand Down
Binary file added desktop/main-app/resources/header.ico
Binary file not shown.
Binary file modified desktop/main-app/resources/install.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion desktop/renderer-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@netless/app-monaco": "0.2.0-canary.1",
"@netless/app-quill": "^0.1.1",
"@netless/app-selector": "^0.0.3",
"@netless/app-slide": "0.3.0-canary.17",
"@netless/app-slide": "0.3.0-canary.18",
"@netless/combine-player": "^1.1.6",
"@netless/flat-i18n": "workspace:*",
"@netless/flat-pages": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions desktop/renderer-app/src/route-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export type ClassRouteName =
export const routeConfig = {
[RouteNameType.SplashPage]: {
title: "SplashPage",
path: "/",
path: "/splash",
component: SplashPage,
},
[RouteNameType.LoginPage]: {
Expand All @@ -68,7 +68,7 @@ export const routeConfig = {
},
[RouteNameType.HomePage]: {
title: "HomePage",
path: "/home/",
path: "/",
component: HomePage,
},
[RouteNameType.SmallClassPage]: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
background: #fff;
font-size: 0;

& > img {
&>img {
width: 100%;
height: 100%;
object-fit: cover;
Expand Down Expand Up @@ -63,13 +63,13 @@
position: relative;

&.is-self {
color: var(--primary-weaker);
color: var(--blue-0);
background: var(--primary);
border-color: transparent;
border-radius: 4px;
}

& > pre {
&>pre {
margin: 0;
padding: 0;
overflow: visible;
Expand Down Expand Up @@ -119,7 +119,7 @@
flex: 1;
text-align: center;

& > span {
&>span {
display: inline-block;
padding: 2px 12px;
font-size: 12px;
Expand All @@ -137,7 +137,7 @@
background: var(--grey-0);
color: var(--text);

& > pre {
&>pre {
margin: 0;
padding: 0;
overflow: visible;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,23 @@ export const WindowsSystemBtn: React.FC<WindowsSystemBtnProps> = ({
}) => {
return (
<div className="windows-system-btn">
{
<>
<a
className="windows-system-btn-item"
onClick={() => onClickWindowsSystemBtn("minimize")}
>
<SVGMinimize />
</a>
{hiddenMaximizeBtn ? null : (
<a
className="windows-system-btn-item"
onClick={() => onClickWindowsSystemBtn("maximize")}
>
<SVGMaximize />
</a>
)}
<a
className="windows-system-btn-item"
onClick={() => onClickWindowsSystemBtn("close")}
>
<SVGClose />
</a>
</>
}
<a
className="windows-system-btn-item"
onClick={() => onClickWindowsSystemBtn("minimize")}
>
<SVGMinimize />
</a>
{hiddenMaximizeBtn ? null : (
<a
className="windows-system-btn-item"
onClick={() => onClickWindowsSystemBtn("maximize")}
>
<SVGMaximize />
</a>
)}
<a className="windows-system-btn-item" onClick={() => onClickWindowsSystemBtn("close")}>
<SVGClose />
</a>
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@
}

.flat-color-scheme-dark {
.windows-system-btn {
background-color: var(--grey-10);
}

.windows-system-btn-item:hover {
.windows-system-btn-item:hover {
background-color: var(--grey-11);
}
}
}

4 changes: 2 additions & 2 deletions packages/flat-components/src/components/UsersPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ const Row = /* @__PURE__ */ observer(function Row({
</td>
<td>
<Switch
checked={user.isSpeak}
disabled={!(isCreator || (isSelf && user.isSpeak))}
checked={user.hasLeft || user.isSpeak}
disabled={!user.hasLeft || !(isCreator || (isSelf && user.isSpeak))}
onChange={checked => onStaging?.(user.userUUID, checked)}
/>
</td>
Expand Down
2 changes: 1 addition & 1 deletion packages/flat-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@netless/app-geogebra": "^0.0.6",
"@netless/app-iframe-bridge": "^0.0.2",
"@netless/app-monaco": "0.2.0-canary.1",
"@netless/app-slide": "0.3.0-canary.17",
"@netless/app-slide": "0.3.0-canary.18",
"@netless/combine-player": "^1.1.6",
"@netless/flat-i18n": "workspace:*",
"@netless/flat-server-api": "workspace:*",
Expand Down
5 changes: 4 additions & 1 deletion packages/flat-pages/src/SmallClassPage/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ export function useDraggable(): Draggable {
let stopListenMove = noop;

const stopListenDown = listen(div, "pointerdown", ev => {
const classList = (ev.target as HTMLElement | null)?.classList;
const isAvatar =
classList?.contains("video-avatar") ||
classList?.contains("video-avatar-absent");
// is dragging avatar, not the buttons on it
const isAvatar = (ev.target as HTMLElement).className?.includes("video-avatar");
if (isAvatar && ev.pointerType === "mouse" && ev.isPrimary && ev.button === 0) {
div.setPointerCapture(ev.pointerId);
start.current = [ev.clientX, div.scrollLeft];
Expand Down
19 changes: 15 additions & 4 deletions packages/flat-pages/src/components/AppUpgradeModal/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,38 @@
}

.app-upgrade-modal-title {
color: #444e60;
color: var(--blue-12);
}

.app-upgrade-modal-font {
color: #7a7b7c;
color: var(--text);
}

.app-upgrade-modal-progress {
height: 5px;
border-radius: 3px;
background: #dbe1ea;
background: var(--grey-1);
}

.app-upgrade-active-progress {
position: relative;
height: 5px;
top: -5px;
border-radius: 3px;
background: #3381ff;
background: var(--primary);
}

.app-upgrade-modal-btn {
text-align: right;
margin-top: 30px;
}

.flat-color-scheme-dark {
.app-upgrade-modal-title {
color: var(--grey-0);
}

.app-upgrade-modal-progress {
background: var(--grey-8);
}
}
28 changes: 14 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion service-providers/fastboard/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export class Fastboard extends IServiceWhiteboard {
return;
}
room.disableDeviceInputs = !allowDrawing;
room.disableCameraTransform = !allowDrawing;
}),
combine([this._app$, isWritable$]).subscribe(([app, isWritable]) => {
const room = app?.room;
Expand Down Expand Up @@ -374,7 +375,7 @@ export class Fastboard extends IServiceWhiteboard {
actions[i] = async () => {
try {
const scenePath = contextPath + scene.name;
// @ts-ignore TODO: should fixe the typings in white-web-sdk
// @ts-ignore TODO: should fix the typings in white-web-sdk
const rect = room.getBoundingRect(scenePath);
const canvas = document.createElement("canvas");
canvas.width = rect.width * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion service-providers/file-preview-netless-slide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"typescript": "^4.8.3"
},
"dependencies": {
"@netless/app-slide": "0.3.0-canary.17",
"@netless/app-slide": "0.3.0-canary.18",
"@netless/flat-service-provider-file-convert-netless": "workspace:*",
"@netless/flat-services": "workspace:*"
}
Expand Down
2 changes: 1 addition & 1 deletion web/flat-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@netless/app-monaco": "0.2.0-canary.1",
"@netless/app-quill": "^0.1.1",
"@netless/app-selector": "^0.0.3",
"@netless/app-slide": "0.3.0-canary.17",
"@netless/app-slide": "0.3.0-canary.18",
"@netless/combine-player": "^1.1.6",
"@netless/flat-i18n": "workspace:*",
"@netless/flat-pages": "workspace:*",
Expand Down

0 comments on commit bbe58ab

Please sign in to comment.