diff --git a/en/react-native-appearance.md b/en/react-native-appearance.md index 6b388984ba0d87cfb5612294c9d85ad24c3dd192..fe91c722bcd13a53f97bea7aa1db24f910684308 100644 --- a/en/react-native-appearance.md +++ b/en/react-native-appearance.md @@ -12,7 +12,7 @@

-> [!Tip] [Github Address](https://github.com/expo/react-native-appearance) +> [!Tip] [Github Address](https://github.com/react-native-oh-library/react-native-appearance) ## Installation and Usage @@ -23,13 +23,13 @@ Navigate to your project directory and enter the following command: #### **npm** ```bash -npm install react-native-appearance@0.3.5 +npm install @react-native-oh-tpl/react-native-appearance ``` #### **yarn** ```bash -yarn add react-native-appearance@0.3.5 +yarn add @react-native-oh-tpl/react-native-appearance ``` @@ -43,28 +43,24 @@ The following code demonstrates how to use this color picker component in a page ```tsx import React, { useState } from "react"; import { Button, View, Text, StyleSheet, useColorScheme } from 'react-native'; +import { Tester, TestSuite, TestCase } from '@rnoh/testerino'; import { AppearanceHarmony } from 'react-native-appearance'; -export default class App extends React.Component { - - // The user's preferred color scheme (e.g. Dark Mode). +const AppearanceExample = () => { const scheme = useColorScheme(); const currentScheme = scheme ?? scheme!.toString(); - // Add an event handler that is fired when appearance preferences change. const [listenedScheme, setListenedScheme] = useState(''); AppearanceHarmony.addChangeListener(({ colorScheme }) => { setListenedScheme(colorScheme ?? colorScheme!.toString()); }); - // Get the color scheme. const [gotScheme, setGotScheme] = useState(''); const getAppearance = ()=> { const result = AppearanceHarmony.getColorScheme(); setGotScheme(result ?? result!.toString()); } - // Set the color scheme preference. const changeAppearance = ()=> { const result = AppearanceHarmony.getColorScheme(); if (result == 'dark') { @@ -86,18 +82,21 @@ export default class App extends React.Component { } }); - render() { - return ( - - Current color scheme:{currentScheme} - Listening color scheme:{listenedScheme} - Get color scheme result:{gotScheme} -