This commit is contained in:
Nouman Tahir 2022-04-16 02:34:03 +05:00
parent 3dbba426f7
commit bd1d124d9a
3 changed files with 10 additions and 12 deletions

View File

@ -33,6 +33,7 @@ public class MainActivity extends ReactActivity {
setIntent(intent);
}
//native side reference: https://github.com/facebook/react-native/issues/28823#issuecomment-642032481
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);

View File

@ -92,11 +92,11 @@ class SettingsContainer extends Component {
}),
);
getTheme().then((themeSetting)=>{
getTheme().then((themeSetting) => {
this.setState({
themeSetting
})
})
themeSetting,
});
});
}
// Component Functions
@ -126,15 +126,12 @@ class SettingsContainer extends Component {
let setting = THEME_OPTIONS[action].value;
const systemTheme = Appearance.getColorScheme();
dispatch(isDarkTheme(setting === null
? systemTheme === 'dark'
: setting
));
dispatch(isDarkTheme(setting === null ? systemTheme === 'dark' : setting));
setTheme(setting);
this.setState({
themeSetting:setting
})
themeSetting: setting,
});
break;
default:

View File

@ -129,7 +129,7 @@ const SettingsScreen = ({
id: item.key,
}),
)}
selectedOptionIndex={THEME_OPTIONS.findIndex(item=>item.value===themeSetting)}
selectedOptionIndex={THEME_OPTIONS.findIndex((item) => item.value === themeSetting)}
handleOnChange={handleOnChange}
/>