mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: ## Changelog: [Internal][Changed] - removed usage of AsyncStorage inside rn-tester package Reviewed By: NickGerleman, JTYim Differential Revision: D40298838 fbshipit-source-id: fb08df690654f3b19e6f64f8893252092f0d8a27
44 lines
875 B
JavaScript
44 lines
875 B
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @flow strict-local
|
|
*/
|
|
|
|
import * as React from 'react';
|
|
import {StyleSheet, Switch, Text, View} from 'react-native';
|
|
|
|
type Props = {
|
|
label: string,
|
|
onEnable: () => void,
|
|
onDisable: () => void,
|
|
active: boolean,
|
|
};
|
|
|
|
const styles = StyleSheet.create({
|
|
row: {
|
|
padding: 10,
|
|
flexDirection: 'row',
|
|
justifyContent: 'space-between',
|
|
},
|
|
});
|
|
|
|
const RNTesterSettingSwitchRow = ({
|
|
label,
|
|
onEnable,
|
|
onDisable,
|
|
active,
|
|
}: Props): React.Node => {
|
|
return (
|
|
<View style={styles.row}>
|
|
<Text>{label}</Text>
|
|
<Switch value={active} onValueChange={active ? onDisable : onEnable} />
|
|
</View>
|
|
);
|
|
};
|
|
|
|
export default RNTesterSettingSwitchRow;
|