Skip to content

Commit 7bf7ba1

Browse files
authored
refactor: make Switch component re-usable in example app (#1297)
## 📜 Description Make `Switch` component re-usable between screens. ## 💡 Motivation and Context I want to develop highly customizable components, similar to `KeyboardAwareScrollView`, so I want to have those checkboxes everywhere to toggle various props. ## 📢 Changelog <!-- High level overview of important changes --> <!-- For example: fixed status bar manipulation; added new types declarations; --> <!-- If your changes don't affect one of platform/language below - then remove this platform/language --> ### JS - make `Switch` component re-usable between different components/screens. ## 🤔 How Has This Been Tested? Tested in example app. ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
1 parent ebc5205 commit 7bf7ba1

4 files changed

Lines changed: 2 additions & 2 deletions

File tree

File renamed without changes.

FabricExample/src/screens/Examples/AwareScrollView/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import React, { useCallback, useEffect, useRef, useState } from "react";
33
import { Button, Platform, Text, View } from "react-native";
44
import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
55

6+
import Switch from "../../../components/Switch";
67
import TextInput from "../../../components/TextInput";
78

89
import { styles } from "./styles";
9-
import Switch from "./Switch";
1010

1111
import type { ExamplesStackParamList } from "../../../navigation/ExamplesStack";
1212
import type { StackScreenProps } from "@react-navigation/stack";
File renamed without changes.

example/src/screens/Examples/AwareScrollView/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import React, { useCallback, useEffect, useRef, useState } from "react";
33
import { Button, Platform, Text, View } from "react-native";
44
import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
55

6+
import Switch from "../../../components/Switch";
67
import TextInput from "../../../components/TextInput";
78

89
import { styles } from "./styles";
9-
import Switch from "./Switch";
1010

1111
import type { ExamplesStackParamList } from "../../../navigation/ExamplesStack";
1212
import type { StackScreenProps } from "@react-navigation/stack";

0 commit comments

Comments
 (0)