Skip to content

Commit 5e68966

Browse files
committed
update demo for test
1 parent 3115bc3 commit 5e68966

File tree

8 files changed

+1598
-213
lines changed

8 files changed

+1598
-213
lines changed

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ PODS:
273273
- React-jsinspector (0.66.4)
274274
- React-logger (0.66.4):
275275
- glog
276-
- react-native-chat-sdk (0.1.3):
276+
- react-native-chat-sdk (0.1.4):
277277
- HyphenateChat (= 3.9.0)
278278
- React-Core
279279
- react-native-document-picker (8.1.0):
@@ -557,7 +557,7 @@ SPEC CHECKSUMS:
557557
React-jsiexecutor: 94ce921e1d8ce7023366873ec371f3441383b396
558558
React-jsinspector: d0374f7509d407d2264168b6d0fad0b54e300b85
559559
React-logger: 933f80c97c633ee8965d609876848148e3fef438
560-
react-native-chat-sdk: 6f491caffac5ea4639cfa1649b87f8bafeb4302e
560+
react-native-chat-sdk: 6ddb9a76fca347a3b9809de05c83745e33397f84
561561
react-native-document-picker: 5663fe4bcdb646200683a41790464d2793307ac8
562562
react-native-image-picker: 4e6008ad8c2321622affa2c85432a5ebd02d480c
563563
react-native-safe-area-context: f98b0b16d1546d208fc293b4661e3f81a895afd9

example/src/demo2/__internal__/Components.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { GetStateScreen } from '../Client/GetState';
77
import { KickScreen } from '../Client/Kick';
88
import { LoginAndLogoutScreen as LoginLogoutScreen } from '../Client/LoginAndLogout';
99
import { GroupManagerRoute, GroupManagerScreen } from '../GroupManager';
10+
// import { LeafScreenClient, LeafScreenTest } from '../__test__/Test1';
1011
import type { ScreenComponent } from './Utils';
1112

1213
export const screenComponents: ScreenComponent[] = [
@@ -49,4 +50,16 @@ export const screenComponents: ScreenComponent[] = [
4950
isNavigation: false,
5051
parentScreen: ClientRoute,
5152
},
53+
// {
54+
// route: LeafScreenTest.route,
55+
// screen: LeafScreenTest,
56+
// isNavigation: false,
57+
// parentScreen: ClientRoute,
58+
// },
59+
// {
60+
// route: LeafScreenClient.route,
61+
// screen: LeafScreenClient,
62+
// isNavigation: false,
63+
// parentScreen: ClientRoute,
64+
// },
5265
];

example/src/demo2/__internal__/Css.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const styleValues = StyleSheet.create({
4646
textAlign: 'left',
4747
color: '#3a4a35',
4848
backgroundColor: '#86dcfc',
49-
borderWidth: 1,
49+
// borderWidth: 1,
5050
maxHeight: 40,
5151
},
5252
viewStyle: {
@@ -63,5 +63,18 @@ export const styleValues = StyleSheet.create({
6363
backgroundColor: '#ecadff',
6464
height: 20,
6565
width: 200,
66+
margin: 5,
67+
},
68+
dividerContent: {
69+
height: 1,
70+
width: 10,
71+
borderStyle: 'dashed',
72+
},
73+
dividerContainer: {
74+
height: 1,
75+
alignItems: 'center',
76+
flexDirection: 'row',
77+
marginVertical: 10,
78+
backgroundColor: '#736287',
6679
},
6780
});

example/src/demo2/__internal__/LeafComponentBase.tsx

Lines changed: 0 additions & 210 deletions
Original file line numberDiff line numberDiff line change
@@ -72,213 +72,3 @@ export abstract class LeafComponentBaseScreen<
7272
throw new Error('Please sub class implement.');
7373
}
7474
}
75-
76-
// interface State extends StateBase {}
77-
78-
// export function LeafComponentScreenFactory(
79-
// params: any
80-
// ): LeafComponentBaseScreen<StateBase> {
81-
// return new (class s extends LeafComponentBaseScreen<State> {
82-
// public static route = 'SendMessageScreen';
83-
// protected static TAG = 'SendMessageScreen';
84-
// constructor(props: { navigation: any }) {
85-
// super(props);
86-
// }
87-
// componentDidMount(): void {
88-
// super.componentDidMount();
89-
// }
90-
// componentWillUnmount(): void {
91-
// super.componentWillUnmount();
92-
// }
93-
// render(): ReactNode {
94-
// const { sendResult } = this.state;
95-
// return (
96-
// <View style={styleValues.containerColumn}>
97-
// <View style={styleValues.containerColumn}>
98-
// <Text style={styleValues.textTipStyle}>result: {sendResult}</Text>
99-
// </View>
100-
// </View>
101-
// );
102-
// }
103-
// })({ navigation: params });
104-
// }
105-
106-
// type ssss<S extends StateBase> = LeafComponentBaseScreen<S>;
107-
108-
// export function LeafComponentScreenFactory2<S extends StateBase>(): Promise<
109-
// LeafComponentBaseScreen<S>
110-
// > {
111-
// const s = `class s extends LeafComponentBaseScreen<S> {
112-
// public static route = 'SendMessageScreen';
113-
// protected static TAG = 'SendMessageScreen';
114-
// constructor(props: { navigation: any }) {
115-
// super(props);
116-
// }
117-
// componentDidMount(): void {
118-
// super.componentDidMount();
119-
// }
120-
// componentWillUnmount(): void {
121-
// super.componentWillUnmount();
122-
// }
123-
// render(): ReactNode {
124-
// const { sendResult } = this.state;
125-
// return (
126-
// <View style={styleValues.containerColumn}>
127-
// <View style={styleValues.containerColumn}>
128-
// <Text style={styleValues.textTipStyle}>result: {sendResult}</Text>
129-
// </View>
130-
// </View>
131-
// );
132-
// }
133-
// };`;
134-
// // eslint-disable-next-line no-eval
135-
// return eval(s);
136-
// }
137-
138-
// class TestExportClass {
139-
// value: any;
140-
// constructor(props: { navigation: any }) {
141-
// this.value = props.navigation;
142-
// }
143-
// }
144-
145-
// export function LeafComponentScreenFactory3(): TestExportClass {
146-
// return new TestExportClass({ navigation: 's' });
147-
// }
148-
149-
// export function LeafComponentScreenFactory4<S extends StateBase>(props: {
150-
// navigation: any;
151-
// }): React.Component<{ navigation: any }, S> {
152-
// return new (class s extends React.Component<{ navigation: any }, S> {
153-
// public static route = 'SendMessageScreen';
154-
// protected static TAG = 'SendMessageScreen';
155-
// constructor(props: { navigation: any }) {
156-
// super(props);
157-
// }
158-
// componentDidMount(): void {}
159-
// componentWillUnmount(): void {}
160-
// render(): ReactNode {
161-
// const { sendResult } = this.state;
162-
// return (
163-
// <View style={styleValues.containerColumn}>
164-
// <View style={styleValues.containerColumn}>
165-
// <Text style={styleValues.textTipStyle}>result: {sendResult}</Text>
166-
// </View>
167-
// </View>
168-
// );
169-
// }
170-
// })(props);
171-
// }
172-
173-
// export function LeafComponentScreenFactory5<S extends StateBase>(props: {
174-
// navigation: any;
175-
// }): React.Component<{ navigation: any }, S> {
176-
// return new (class s extends React.Component<{ navigation: any }, S> {
177-
// public static route = 'SendMessageScreen';
178-
// protected static TAG = 'SendMessageScreen';
179-
// constructor(props: { navigation: any }) {
180-
// super(props);
181-
// }
182-
// componentDidMount(): void {}
183-
// componentWillUnmount(): void {}
184-
// render(): ReactNode {
185-
// const { sendResult } = this.state;
186-
// return (
187-
// <View style={styleValues.containerColumn}>
188-
// <View style={styleValues.containerColumn}>
189-
// <Text style={styleValues.textTipStyle}>result: {sendResult}</Text>
190-
// </View>
191-
// </View>
192-
// );
193-
// }
194-
// })(props);
195-
// }
196-
197-
// type ParamsType = {
198-
// props: {
199-
// navigation: any;
200-
// };
201-
// };
202-
203-
// export const LeafComponentScreenFactory6: LeafComponentType = (props: {
204-
// navigation: any;
205-
// }): any => {
206-
// class _s<P extends { navigation: any }, S> extends React.Component<P, S, any> {
207-
// public static route = 'LoginAndLogoutScreen';
208-
// private static TAG = 'LoginAndLogoutScreen';
209-
// navigation: any;
210-
211-
// constructor(_props: P) {
212-
// super(_props);
213-
// this.navigation = props.navigation;
214-
// }
215-
216-
// render(): ReactNode {
217-
// return (
218-
// <View style={styleValues.containerColumn}>
219-
// <View style={styleValues.containerRow}>
220-
// <Text style={styleValues.textStyle}>UseName: </Text>
221-
// </View>
222-
// </View>
223-
// );
224-
// }
225-
// }
226-
227-
// class _ss<P extends { navigation: any }, S = any>
228-
// implements React.ComponentClass<P, S>
229-
// {
230-
// component: _s<P, S>;
231-
// constructor(_props: P, _context?: any) {
232-
// this.component = new _s(_props);
233-
// }
234-
// // new (props: P, context?: any): React.Component<P, S>;
235-
// propTypes?: React.WeakValidationMap<P> | undefined;
236-
// contextType?: React.Context<any> | undefined;
237-
// contextTypes?: ValidationMap<any> | undefined;
238-
// childContextTypes?: ValidationMap<any> | undefined;
239-
// defaultProps?: Partial<P> | undefined;
240-
// displayName?: string | undefined;
241-
// getDerivedStateFromProps?: React.GetDerivedStateFromProps<P, S> | undefined;
242-
// getDerivedStateFromError?: React.GetDerivedStateFromError<P, S> | undefined;
243-
// }
244-
// return new _ss(props);
245-
// };
246-
247-
// const ReactComponent2: React.ComponentClass<{
248-
// navigation: any;
249-
// }> = class extends React.Component<{ navigation: any }, any> {
250-
// static displayName = 'ReactComponent2';
251-
// public static route = 'ReactComponent2';
252-
// render(): ReactNode {
253-
// return (
254-
// <View style={styleValues.containerColumn}>
255-
// <View style={styleValues.containerRow}>
256-
// <Text style={styleValues.textStyle}>UseName: </Text>
257-
// </View>
258-
// </View>
259-
// );
260-
// }
261-
// };
262-
263-
// export const LeafComponentScreenFactory7: LeafComponentType = ReactComponent2;
264-
265-
// export function LeafComponentScreenFactory8(): React.ComponentClass {
266-
// const ret: React.ComponentClass = class extends React.React.Component {
267-
// static displayName = 'ReactComponent2';
268-
// public static route = 'ReactComponent2';
269-
// // new (props: {}, context?: any): React.Component<{}, any, any>
270-
// render(): ReactNode {
271-
// return (
272-
// <View style={styleValues.containerColumn}>
273-
// <View style={styleValues.containerRow}>
274-
// <Text style={styleValues.textStyle}>UseName: </Text>
275-
// </View>
276-
// </View>
277-
// );
278-
// }
279-
// };
280-
// return ret;
281-
// }
282-
283-
// export const ReactComponent3: React.ComponentClass =
284-
// LeafComponentScreenFactory8();
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export type ImageType = 'Image';
2+
export type VideoType = 'Video';
3+
export type VoiceType = 'Voice';
4+
export type MediaType = ImageType | VideoType | VoiceType;
5+
6+
export type MediaType2 = {
7+
image: boolean;
8+
video: boolean;
9+
voice: boolean;
10+
};

example/src/demo2/__internal__/Utils.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,8 @@ export function unregisterComponents(): void {
7272
console.log(`unregisterComponents`);
7373
components.length = 0;
7474
}
75+
76+
let _seq = 0;
77+
export function seq(): number {
78+
return ++_seq;
79+
}

0 commit comments

Comments
 (0)