Skip to content

Commit 07ef0dd

Browse files
committed
react-native-custom-text is upgraded and TextWrapper is updated
1 parent 897b159 commit 07ef0dd

File tree

8 files changed

+61
-62
lines changed

8 files changed

+61
-62
lines changed

package-lock.json

Lines changed: 17 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"clean-up": "rm -rf .git README.md && rm -rf ./assets/RN-Typescript-Boilerplate.gif ./assets/logo.png && git init"
1212
},
1313
"dependencies": {
14-
"@freakycoder/react-native-custom-text": "0.0.12",
14+
"@freakycoder/react-native-custom-text": "0.1.2",
1515
"@freakycoder/react-native-helpers": "^1.0.1",
1616
"@react-native-community/async-storage": "^1.12.1",
1717
"@react-native-community/masked-view": "^0.1.10",

src/screens/detail/DetailScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as NavigationService from "react-navigation-helpers";
66
*/
77
import colors from "@colors";
88
import styles from "./DetailScreen.style";
9-
import Text from "@shared-components/TextWrapper/Text";
9+
import Text from "@shared-components/TextWrapper/TextWrapper";
1010

1111
export default class DetailScreen extends Component {
1212
render() {

src/screens/home/HomeScreen.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as NavigationService from "react-navigation-helpers";
77
import colors from "@colors";
88
import styles from "./HomeScreen.style";
99
import { SCREENS } from "@shared-constants";
10-
import Text from "@shared-components/TextWrapper/Text";
10+
import Text from "@shared-components/TextWrapper/TextWrapper";
1111

1212
interface IProps {}
1313

@@ -24,6 +24,7 @@ export default class HomeScreen extends Component<IProps, IState> {
2424
>
2525
<Text color={colors.light.white}>Go To Detail Screen</Text>
2626
</TouchableOpacity>
27+
<Text h5></Text>
2728
</View>
2829
);
2930
}

src/screens/search/SearchScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { View } from "react-native";
44
* ? Local Imports
55
*/
66
import styles from "./SearchScreen.style";
7-
import Text from "@shared-components/TextWrapper/Text";
7+
import Text from "@shared-components/TextWrapper/TextWrapper";
88

99
export default class SearchScreen extends Component {
1010
render() {

src/shared/components/TextWrapper/Text.tsx

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from "react";
2+
import RNText, { IRNTextProps } from "@freakycoder/react-native-custom-text";
3+
4+
interface ITextWrapperProps extends IRNTextProps {
5+
color?: string;
6+
fontFamily?: string;
7+
children?: React.ReactNode;
8+
}
9+
10+
const TextWrapper: React.FC<ITextWrapperProps> = ({
11+
fontFamily = "Helvetica",
12+
color = "#fff",
13+
children,
14+
...rest
15+
}) => {
16+
return (
17+
<RNText fontFamily={fontFamily} color={color} {...rest}>
18+
{children}
19+
</RNText>
20+
);
21+
};
22+
23+
export default TextWrapper;

tsconfig.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@
2424
"noUnusedParameters": true,
2525
"noImplicitReturns": true,
2626
"noFallthroughCasesInSwitch": true,
27-
"forceConsistentCasingInFileNames": true
27+
"forceConsistentCasingInFileNames": true,
2828
// ? Babel Plugin Module Resolver
29-
// "baseUrl": "./src",
30-
// "paths": {
31-
// "@shared-components": ["./shared/components"],
32-
// "@shared-constants": ["./shared/constants"],
33-
// "@shared-theme": ["./shared/theme"],
34-
// "@font-size": ["./shared/theme/font-size"],
35-
// "@api": ["./services/api/index"],
36-
// "@fonts": ["./shared/theme/fonts/index"],
37-
// "@colors": ["./shared/theme/colors"],
38-
// "@theme": ["./shared/theme/index"],
39-
// "@services": ["./services"],
40-
// "@screens": ["./screens"],
41-
// "@utils": ["./utils/"],
42-
// "@assets": ["./assets/"]
43-
// }
29+
"baseUrl": "./src",
30+
"paths": {
31+
"@shared-components/*": ["./shared/components/*"],
32+
"@shared-constants": ["./shared/constants"],
33+
"@shared-theme": ["./shared/theme"],
34+
"@font-size": ["./shared/theme/font-size"],
35+
"@api": ["./services/api/index"],
36+
"@fonts": ["./shared/theme/fonts/index"],
37+
"@colors": ["./shared/theme/colors"],
38+
"@theme": ["./shared/theme/index"],
39+
"@services": ["./services"],
40+
"@screens": ["./screens"],
41+
"@utils": ["./utils/"],
42+
"@assets": ["./assets/"]
43+
}
4444
},
4545
"exclude": [
4646
"node_modules",

0 commit comments

Comments
 (0)