Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(rn,sdk) remove deprecated color scheme prop

Saúl Ibarra Corretgéf6f7406d24c7
diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetConferenceOptions.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetConferenceOptions.java
index 06548549e4..b849e94a6e 100644
--- a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetConferenceOptions.java
+++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetConferenceOptions.java
@@ -45,11 +45,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
*/
private String token;
- /**
- * Color scheme override, see: https://github.com/jitsi/jitsi-meet/blob/dbedee5e22e5dcf9c92db96ef5bb3c9982fc526d/react/features/base/color-scheme/defaultScheme.js
- */
- private Bundle colorScheme;
-
/**
* Config. See: https://github.com/jitsi/jitsi-meet/blob/master/config.js
*/
@@ -77,10 +72,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
return token;
}
- public Bundle getColorScheme() {
- return colorScheme;
- }
-
public Bundle getFeatureFlags() {
return featureFlags;
}
@@ -97,7 +88,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
private String room;
private String token;
- private Bundle colorScheme;
private Bundle config;
private Bundle featureFlags;
@@ -152,19 +142,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
return this;
}
- /**
- * Sets the color scheme override so the app is themed. See:
- * https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/color-scheme/defaultScheme.js
- * for the structure.
- * @param colorScheme - A color scheme to be applied to the app.
- * @return - The {@link Builder} object itself so the method calls can be chained.
- */
- public Builder setColorScheme(Bundle colorScheme) {
- this.colorScheme = colorScheme;
-
- return this;
- }
-
/**
* Indicates the conference will be joined with the microphone muted.
* @param audioMuted - Muted indication.
@@ -276,7 +253,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
options.serverURL = this.serverURL;
options.room = this.room;
options.token = this.token;
- options.colorScheme = this.colorScheme;
options.config = this.config;
options.featureFlags = this.featureFlags;
options.userInfo = this.userInfo;
@@ -292,7 +268,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
serverURL = (URL) in.readSerializable();
room = in.readString();
token = in.readString();
- colorScheme = in.readBundle();
config = in.readBundle();
featureFlags = in.readBundle();
userInfo = new JitsiMeetUserInfo(in.readBundle());
@@ -308,10 +283,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
props.putBundle("flags", featureFlags);
- if (colorScheme != null) {
- props.putBundle("colorScheme", colorScheme);
- }
-
Bundle urlProps = new Bundle();
// The room is fully qualified
@@ -360,7 +331,6 @@ public class JitsiMeetConferenceOptions implements Parcelable {
dest.writeSerializable(serverURL);
dest.writeString(room);
dest.writeString(token);
- dest.writeBundle(colorScheme);
dest.writeBundle(config);
dest.writeBundle(featureFlags);
dest.writeBundle(userInfo != null ? userInfo.asBundle() : new Bundle());
diff --git a/ios/sdk/src/JitsiMeetConferenceOptions.h b/ios/sdk/src/JitsiMeetConferenceOptions.h
index 1852be674f..adfb14e754 100644
--- a/ios/sdk/src/JitsiMeetConferenceOptions.h
+++ b/ios/sdk/src/JitsiMeetConferenceOptions.h
@@ -34,12 +34,6 @@
*/
@property (nonatomic, copy, nullable) NSString *token;
-/**
- * Color scheme override, see:
- * https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/color-scheme/defaultScheme.js
- */
-@property (nonatomic, copy, nullable) NSDictionary *colorScheme;
-
/**
* Feature flags. See: https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/flags/constants.js
*/
@@ -82,7 +76,6 @@
@property (nonatomic, copy, nullable, readonly) NSString *room;
@property (nonatomic, copy, nullable, readonly) NSString *token;
-@property (nonatomic, copy, nullable) NSDictionary *colorScheme;
@property (nonatomic, readonly, nonnull) NSDictionary *featureFlags;
@property (nonatomic, readonly) BOOL welcomePageEnabled;
diff --git a/ios/sdk/src/JitsiMeetConferenceOptions.m b/ios/sdk/src/JitsiMeetConferenceOptions.m
index a82b8925df..f01c82edd7 100644
--- a/ios/sdk/src/JitsiMeetConferenceOptions.m
+++ b/ios/sdk/src/JitsiMeetConferenceOptions.m
@@ -38,7 +38,6 @@ static NSString *const WelcomePageEnabledFeatureFlag = @"welcomepage.enabled";
_room = nil;
_token = nil;
- _colorScheme = nil;
_config = [[NSMutableDictionary alloc] init];
_featureFlags = [[NSMutableDictionary alloc] init];
@@ -134,8 +133,6 @@ static NSString *const WelcomePageEnabledFeatureFlag = @"welcomepage.enabled";
_room = builder.room;
_token = builder.token;
- _colorScheme = builder.colorScheme;
-
_config = builder.config;
_featureFlags = [NSDictionary dictionaryWithDictionary:builder.featureFlags];
@@ -161,10 +158,6 @@ static NSString *const WelcomePageEnabledFeatureFlag = @"welcomepage.enabled";
props[@"flags"] = [NSMutableDictionary dictionaryWithDictionary:_featureFlags];
- if (_colorScheme != nil) {
- props[@"colorScheme"] = self.colorScheme;
- }
-
NSMutableDictionary *urlProps = [[NSMutableDictionary alloc] init];
// The room is fully qualified.
diff --git a/react/features/app/components/App.native.js b/react/features/app/components/App.native.js
index 9272427dfd..aee972e767 100644
--- a/react/features/app/components/App.native.js
+++ b/react/features/app/components/App.native.js
@@ -3,7 +3,6 @@
import React from 'react';
import SplashScreen from 'react-native-splash-screen';
-import { setColorScheme } from '../../base/color-scheme';
import { DialogContainer } from '../../base/dialog';
import { updateFlags } from '../../base/flags/actions';
import { CALL_INTEGRATION_ENABLED, SERVER_URL_CHANGE_ENABLED } from '../../base/flags/constants';
@@ -91,7 +90,6 @@ export class App extends AbstractApp {
const { dispatch, getState } = this.state.store;
// We set these early enough so then we avoid any unnecessary re-renders.
- dispatch(setColorScheme(this.props.colorScheme));
dispatch(updateFlags(this.props.flags));
// Check if serverURL is configured externally and not allowed to change.
diff --git a/react/features/app/reducers.any.js b/react/features/app/reducers.any.js
index 81836fbb6e..3ff472498a 100644
--- a/react/features/app/reducers.any.js
+++ b/react/features/app/reducers.any.js
@@ -5,7 +5,6 @@ import '../authentication/reducer';
import '../av-moderation/reducer';
import '../base/app/reducer';
import '../base/audio-only/reducer';
-import '../base/color-scheme/reducer';
import '../base/conference/reducer';
import '../base/config/reducer';
import '../base/connection/reducer';
diff --git a/react/features/base/color-scheme/ColorSchemeRegistry.js b/react/features/base/color-scheme/ColorSchemeRegistry.js
index 09a77f9dd9..cc1bcd8b94 100644
--- a/react/features/base/color-scheme/ColorSchemeRegistry.js
+++ b/react/features/base/color-scheme/ColorSchemeRegistry.js
@@ -23,8 +23,7 @@ class ColorSchemeRegistry {
_styleTemplates = new Map();
/**
- * Clears the already scheme-ified style definitions. This is useful when
- * the {@code SET_COLOR_SCHEME} action is dispatched (again).
+ * Clears the already scheme-ified style definitions.
*
* @returns {void}
*/
@@ -150,7 +149,7 @@ class ColorSchemeRegistry {
stateful: Object | Function,
componentName: string,
colorDefinition: string): string {
- const colorScheme = toState(stateful)['features/base/color-scheme'];
+ const colorScheme = toState(stateful)['features/base/color-scheme'] || {};
return {
...defaultScheme._defaultTheme,
diff --git a/react/features/base/color-scheme/actionTypes.js b/react/features/base/color-scheme/actionTypes.js
deleted file mode 100644
index c624ca0476..0000000000
--- a/react/features/base/color-scheme/actionTypes.js
+++ /dev/null
@@ -1,11 +0,0 @@
-// @flow
-
-/**
- * Redux action to signal a color scheme change in the app/sdk.
- *
- * {
- * type: SET_COLOR_SCHEME
- * colorScheme: Object
- * }
- */
-export const SET_COLOR_SCHEME = 'SET_COLOR_SCHEME';
diff --git a/react/features/base/color-scheme/actions.js b/react/features/base/color-scheme/actions.js
deleted file mode 100644
index 7f96110ea8..0000000000
--- a/react/features/base/color-scheme/actions.js
+++ /dev/null
@@ -1,19 +0,0 @@
-// @flow
-
-import { SET_COLOR_SCHEME } from './actionTypes';
-
-/**
- * Dispatches a Redux action to set the color scheme of the app/sdk.
- *
- * @param {Object} colorScheme - The color scheme to set.
- * @returns {{
- * type: SET_COLOR_SCHEME,
- * colorScheme: Object
- * }}
- */
-export function setColorScheme(colorScheme: Object): Object {
- return {
- type: SET_COLOR_SCHEME,
- colorScheme
- };
-}
diff --git a/react/features/base/color-scheme/index.js b/react/features/base/color-scheme/index.js
index bdb92c87fe..92bb93f781 100644
--- a/react/features/base/color-scheme/index.js
+++ b/react/features/base/color-scheme/index.js
@@ -1,6 +1,4 @@
// @flow
-export * from './actions';
-export * from './actionTypes';
export * from './functions';
export { default as ColorSchemeRegistry } from './ColorSchemeRegistry';
diff --git a/react/features/base/color-scheme/middleware.js b/react/features/base/color-scheme/middleware.js
deleted file mode 100644
index 9a22ff94e6..0000000000
--- a/react/features/base/color-scheme/middleware.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// @flow
-
-import { MiddlewareRegistry } from '../redux';
-
-import ColorSchemeRegistry from './ColorSchemeRegistry';
-import { SET_COLOR_SCHEME } from './actionTypes';
-
-/**
- * The middleware of the feature {@code base/color-scheme}.
- *
- * @returns {Function}
- */
-MiddlewareRegistry.register((/* store */) => next => action => {
- switch (action.type) {
- case SET_COLOR_SCHEME:
- return ColorSchemeRegistry.clear();
- }
-
- return next(action);
-});
diff --git a/react/features/base/color-scheme/reducer.js b/react/features/base/color-scheme/reducer.js
deleted file mode 100644
index c61baf221c..0000000000
--- a/react/features/base/color-scheme/reducer.js
+++ /dev/null
@@ -1,21 +0,0 @@
-// @flow
-
-import _ from 'lodash';
-
-import { ReducerRegistry } from '../redux';
-
-import { SET_COLOR_SCHEME } from './actionTypes';
-
-/**
- * The reducer of the feature {@code base/color-scheme}.
- *
- * @returns {Function}
- */
-ReducerRegistry.register('features/base/color-scheme', (state = {}, action) => {
- switch (action.type) {
- case SET_COLOR_SCHEME:
- return _.cloneDeep(action.colorScheme) || state;
- }
-
- return state;
-});