Skip to content

Commit 07bfe35

Browse files
feat: changed share screen bool from string to switch
1 parent dd56bfb commit 07bfe35

File tree

3 files changed

+46
-16
lines changed

3 files changed

+46
-16
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { CheckBox, controlItem, Switch, SwitchWrapper } from "lowcoder-design";
2+
import { ReactNode } from "react";
3+
import { ControlParams, SimpleComp } from "@lowcoder-ee/index.sdk";
4+
5+
export class BoolShareVideoControl extends SimpleComp<boolean> {
6+
readonly IGNORABLE_DEFAULT_VALUE = false;
7+
protected getDefaultValue(): boolean {
8+
return false;
9+
}
10+
11+
getPropertyView(): ReactNode {
12+
return (
13+
<Switch
14+
value={this.value}
15+
onChange={(x) => this.dispatchChangeValueAction(x)}
16+
/>
17+
);
18+
}
19+
20+
propertyView(params: ControlParams & { type?: "switch" | "checkbox" }) {
21+
return controlItem(
22+
{ filterText: params.label },
23+
<SwitchWrapper {...params}>
24+
{params.type === "checkbox" ? (
25+
<CheckBox
26+
style={{ marginRight: "8px" }}
27+
checked={this.value}
28+
onChange={(x) => this.dispatchChangeValueAction(x.target.checked)}
29+
/>
30+
) : (
31+
this.getPropertyView()
32+
)}
33+
</SwitchWrapper>
34+
);
35+
}
36+
}

client/packages/lowcoder/src/comps/comps/meetingComp/videoMeetingStreamComp.tsx

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ import { RefControl } from "comps/controls/refControl";
2828
import { useEffect, useRef, useState } from "react";
2929

3030
import { AutoHeightControl } from "comps/controls/autoHeightControl";
31-
import {
32-
VideoMeetingControllerComp,
33-
client,
34-
} from "./videoMeetingControllerComp";
31+
import { client } from "./videoMeetingControllerComp";
3532

3633
import { IAgoraRTCRemoteUser } from "agora-rtc-sdk-ng";
3734

3835
import {
36+
ControlParams,
3937
MeetingEventHandlerControl,
38+
SimpleComp,
4039
StringControl,
4140
StringStateControl,
4241
hiddenPropertyView,
4342
stringExposingStateControl,
4443
} from "@lowcoder-ee/index.sdk";
44+
import { BoolShareVideoControl } from "./meetingControlerUtils";
4545

4646
const FormLabel = styled(CommonBlueLabel)`
4747
font-size: 13px;
@@ -73,15 +73,7 @@ const TextContainer = styled.div<{ $style: any }>`
7373
justify-content: center;
7474
${(props) => props.$style && getStyle(props.$style)}
7575
`;
76-
const ProfileImageContainer = styled.div<{ $style: any }>`
77-
height: 100%;
78-
width: 100%;
79-
display: flex;
80-
align-items: center;
81-
position: absolute;
82-
justify-content: center;
83-
${(props) => props.$style && getStyle(props.$style)}
84-
`;
76+
8577
const VideoContainer = styled.video<{ $style: any }>`
8678
height: 100%;
8779
width: 100%;
@@ -102,6 +94,7 @@ const getStyle = (style: any) => {
10294
}
10395
`;
10496
};
97+
10598
function getForm(editorState: EditorState, formName: string) {
10699
const comp = editorState?.getUICompByName(formName);
107100
if (comp && comp.children.compType.getView() === "form") {
@@ -175,7 +168,7 @@ const typeOptions = [
175168

176169
export const meetingStreamChildren = {
177170
autoHeight: withDefault(AutoHeightControl, "fixed"),
178-
shareScreen: withDefault(BoolCodeControl, false),
171+
shareScreen: withDefault(BoolShareVideoControl, false),
179172
profileImageHeight: withDefault(StringControl, "300px"),
180173
profileImageWidth: withDefault(StringControl, "300px"),
181174
type: dropdownControl(typeOptions, ""),
@@ -304,7 +297,7 @@ let VideoCompBuilder = (function (props) {
304297
{(editorState) => (
305298
<ReactResizeDetector onResize={onResize}>
306299
<Container ref={conRef} $style={props.style}>
307-
{props.shareScreen || userId ? (
300+
{userId ? (
308301
<>
309302
<VideoContainer
310303
onClick={() => props.onEvent("videoClicked")}
@@ -360,6 +353,7 @@ let VideoCompBuilder = (function (props) {
360353
label: trans("meeting.shareScreen"),
361354
})}
362355
</Section>
356+
363357
<Section name={sectionNames.interaction}>
364358
{children.onEvent.getPropertyView()}
365359
</Section>

client/packages/lowcoder/src/comps/comps/tableComp/expansionControl.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ let ExpansionControlTmp = (function () {
5454
.setControlItemData({ filterText: label })
5555
.setPropertyViewFn((children, dispatch) => {
5656
return (
57-
<>
57+
<>
5858
{children.expandable.propertyView({ label })}
5959
{children.expandable.getView() &&
6060
children.slot

0 commit comments

Comments
 (0)