Skip to content

Commit a2a7132

Browse files
committed
rename var __styles in buildStyles
1 parent bd2abf7 commit a2a7132

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

src/Button.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const COLOR = Platform.OS === "ios" ? "#007ff9" : "#169689";
1414
const DialogButton = (props) => {
1515
const { label, color, disabled, bold, onPress, style, ...nodeProps } = props;
1616
const fontWeight = bold ? "600" : "normal";
17-
const { styles } = useTheme(__styles);
17+
const { styles } = useTheme(buildStyles);
1818

1919
return (
2020
<TouchableOpacity
@@ -48,7 +48,7 @@ DialogButton.defaultProps = {
4848

4949
DialogButton.displayName = "DialogButton";
5050

51-
const __styles = (isDark) =>
51+
const buildStyles = (isDark) =>
5252
StyleSheet.create({
5353
button: Platform.select({
5454
ios: {

src/Container.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const DialogContainer = (props) => {
2929
const descriptionChildrens = [];
3030
const buttonChildrens = [];
3131
const otherChildrens = [];
32-
const { styles } = useTheme(__styles);
32+
const { styles } = useTheme(buildStyles);
3333
React.Children.forEach(children, (child) => {
3434
if (!child) {
3535
return;
@@ -111,7 +111,7 @@ DialogContainer.defaultProps = {
111111
visible: false,
112112
};
113113

114-
const __styles = (isDark) =>
114+
const buildStyles = (isDark) =>
115115
StyleSheet.create({
116116
centeredView: {
117117
marginTop: 22,

src/Description.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useTheme } from "./components/hooks";
55

66
const DialogDescription = (props) => {
77
const { style, children, ...nodeProps } = props;
8-
const { styles } = useTheme(__styles);
8+
const { styles } = useTheme(buildStyles);
99

1010
return (
1111
<Text style={[styles.text, style]} {...nodeProps}>
@@ -22,7 +22,7 @@ DialogDescription.propTypes = {
2222

2323
DialogDescription.displayName = "DialogDescription";
2424

25-
const __styles = (isDark) =>
25+
const buildStyles = (isDark) =>
2626
StyleSheet.create({
2727
text: Platform.select({
2828
ios: {

src/Input.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const DialogInput = (props) => {
2222
} = props;
2323
const lines = (multiline && numberOfLines) || 1;
2424
const height = 18 + Platform.select({ ios: 14, android: 22 }) * lines;
25-
const { styles, isDark } = useTheme(__styles);
25+
const { styles, isDark } = useTheme(buildStyles);
2626
return (
2727
<View style={[styles.textInputWrapper, wrapperStyle]}>
2828
{label && <Text style={styles.label}>{label}</Text>}
@@ -63,7 +63,7 @@ DialogInput.propTypes = {
6363

6464
DialogInput.displayName = "DialogInput";
6565

66-
const __styles = (isDark) =>
66+
const buildStyles = (isDark) =>
6767
StyleSheet.create({
6868
textInputWrapper: Platform.select({
6969
ios: {

src/Switch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { useTheme } from "./components/hooks";
1212

1313
const DialogSwitch = (props) => {
1414
const { label, ...nodeProps } = props;
15-
const { styles } = useTheme(__styles);
15+
const { styles } = useTheme(buildStyles);
1616
return (
1717
<View style={styles.switchWrapper}>
1818
<Text style={styles.label}>{label}</Text>
@@ -28,7 +28,7 @@ DialogSwitch.propTypes = {
2828

2929
DialogSwitch.displayName = "DialogSwitch";
3030

31-
const __styles = (isDark) =>
31+
const buildStyles = (isDark) =>
3232
StyleSheet.create({
3333
switchWrapper: Platform.select({
3434
ios: {

src/Title.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useTheme } from "./components/hooks";
55

66
const DialogTitle = (props) => {
77
const { style, children, ...nodeProps } = props;
8-
const { styles } = useTheme(__styles);
8+
const { styles } = useTheme(buildStyles);
99

1010
return (
1111
<Text style={[styles.text, style]} {...nodeProps}>
@@ -22,7 +22,7 @@ DialogTitle.propTypes = {
2222

2323
DialogTitle.displayName = "DialogTitle";
2424

25-
const __styles = (isDark) =>
25+
const buildStyles = (isDark) =>
2626
StyleSheet.create({
2727
text: Platform.select({
2828
ios: {

src/components/hooks/useTheme.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React, { useMemo } from "react";
22
import { useColorScheme } from "react-native";
33

4-
const useTheme = (__styles) => {
4+
const useTheme = (buildStyles) => {
55
const colorScheme = useColorScheme();
66
const isDark = colorScheme === "dark";
77

88
const styles = useMemo(() => {
9-
return __styles(isDark);
10-
}, [__styles, isDark]);
9+
return buildStyles(isDark);
10+
}, [buildStyles, isDark]);
1111

1212
return { theme: colorScheme, isDark, styles };
1313
};

0 commit comments

Comments
 (0)