forked from leanhtuan1994/react-native-template-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
201 additions
and
9 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Colors } from 'app/styles'; | ||
import React from 'react'; | ||
import { View, ViewProps } from 'react-native'; | ||
|
||
type Props = { | ||
size?: number; | ||
vertical?: boolean; | ||
color?: string; | ||
}; | ||
|
||
const Separator: React.FC<ViewProps & Props> = ({ | ||
style, | ||
size = 1, | ||
vertical, | ||
color = Colors.SeparatorColor, | ||
...rest | ||
}) => { | ||
return ( | ||
<View | ||
{...rest} | ||
style={[ | ||
{ backgroundColor: color }, | ||
vertical | ||
? { width: size, height: '100%' } | ||
: { height: size, width: '100%' }, | ||
style, | ||
]} | ||
/> | ||
); | ||
}; | ||
|
||
export default Separator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { | ||
GlobalStyles, | ||
Colors, | ||
FontWeight, | ||
getSuperScriptFontSize, | ||
getSuperScriptLineHeight, | ||
FontSize, | ||
} from 'app/styles'; | ||
import React from 'react'; | ||
import { | ||
StyleProp, | ||
StyleSheet, | ||
TextStyle, | ||
View, | ||
ViewStyle, | ||
} from 'react-native'; | ||
import { Text, TextProps } from 'react-native-elements'; | ||
|
||
type Props = { | ||
superscriptText?: string; | ||
superscriptColor?: string; | ||
containerStyle?: StyleProp<ViewStyle>; | ||
}; | ||
|
||
const SuperScript: React.FC<TextProps & Props> = ({ | ||
containerStyle, | ||
children, | ||
superscriptText = 'đ', | ||
style = GlobalStyles.font({ | ||
color: Colors.Black, | ||
fontWeight: FontWeight.SemiBold, | ||
}), | ||
superscriptColor, | ||
...props | ||
}) => ( | ||
<View style={StyleSheet.compose(containerStyle, { flexDirection: 'row' })}> | ||
<Text {...props} style={style}> | ||
{children} | ||
</Text> | ||
<Text | ||
style={StyleSheet.compose(style, { | ||
fontSize: getSuperScriptFontSize( | ||
(style as TextStyle)?.fontSize || FontSize.Regular, | ||
), | ||
lineHeight: getSuperScriptLineHeight( | ||
(style as TextStyle)?.fontSize || FontSize.Regular, | ||
), | ||
textDecorationLine: 'underline', | ||
color: superscriptColor || (style as TextStyle)?.color || Colors.Black, | ||
})}> | ||
{superscriptText} | ||
</Text> | ||
</View> | ||
); | ||
|
||
export default SuperScript; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
import { FontSize, FontWeight, AndroidFontFamily, FontFamily } from './Fonts'; | ||
import { | ||
FontSize, | ||
FontWeight, | ||
AndroidFontFamily, | ||
FontFamily, | ||
getSuperScriptFontSize, | ||
getSuperScriptLineHeight, | ||
} from './Fonts'; | ||
|
||
export { FontSize, FontWeight, AndroidFontFamily, FontFamily }; | ||
export { | ||
FontSize, | ||
FontWeight, | ||
AndroidFontFamily, | ||
FontFamily, | ||
getSuperScriptFontSize, | ||
getSuperScriptLineHeight, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,20 @@ | ||
import { AppTheme, GlobalStyles } from './theme'; | ||
import { Colors } from './colors'; | ||
import { FontFamily, FontSize, FontWeight } from './fonts'; | ||
import { | ||
FontFamily, | ||
FontSize, | ||
FontWeight, | ||
getSuperScriptFontSize, | ||
getSuperScriptLineHeight, | ||
} from './fonts'; | ||
|
||
export { GlobalStyles, Colors, FontFamily, FontSize, FontWeight }; | ||
export { | ||
GlobalStyles, | ||
Colors, | ||
FontFamily, | ||
FontSize, | ||
FontWeight, | ||
getSuperScriptFontSize, | ||
getSuperScriptLineHeight, | ||
}; | ||
export default AppTheme; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const formatCurrency = (value: number) => | ||
Math.round(value) | ||
.toString() | ||
.replace(/\B(?=(\d{3})+(?!\d))/g, '.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
project: { | ||
ios: {}, | ||
android: {}, | ||
}, | ||
assets: ['./assets/fonts/'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2150,6 +2150,13 @@ aws4@^1.8.0: | |
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" | ||
integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== | ||
|
||
axios@^0.21.1: | ||
version "0.21.1" | ||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" | ||
integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== | ||
dependencies: | ||
follow-redirects "^1.10.0" | ||
|
||
babel-core@^7.0.0-bridge.0: | ||
version "7.0.0-bridge.0" | ||
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" | ||
|
@@ -3749,6 +3756,11 @@ flow-parser@^0.121.0: | |
resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.121.0.tgz#9f9898eaec91a9f7c323e9e992d81ab5c58e618f" | ||
integrity sha512-1gIBiWJNR0tKUNv8gZuk7l9rVX06OuLzY9AoGio7y/JT4V1IZErEMEq2TJS+PFcw/y0RshZ1J/27VfK1UQzYVg== | ||
|
||
follow-redirects@^1.10.0: | ||
version "1.14.1" | ||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43" | ||
integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg== | ||
|
||
for-in@^0.1.3: | ||
version "0.1.8" | ||
resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.8.tgz#d8773908e31256109952b1fdb9b3fa867d2775e1" | ||
|
@@ -6473,7 +6485,7 @@ prompts@^2.0.1, prompts@^2.4.0: | |
kleur "^3.0.3" | ||
sisteransi "^1.0.5" | ||
|
||
prop-types@^15.7.2: | ||
prop-types@^15.6.2, prop-types@^15.7.2: | ||
version "15.7.2" | ||
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" | ||
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== | ||
|
@@ -6551,6 +6563,13 @@ react-is@^16.13.0, react-is@^16.7.0, react-is@^16.8.1: | |
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" | ||
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== | ||
|
||
[email protected]: | ||
version "1.3.3" | ||
resolved "https://registry.yarnpkg.com/react-native-animatable/-/react-native-animatable-1.3.3.tgz#a13a4af8258e3bb14d0a9d839917e9bb9274ec8a" | ||
integrity sha512-2ckIxZQAsvWn25Ho+DK3d1mXIgj7tITkrS4pYDvx96WyOttSvzzFeQnM2od0+FUMzILbdHDsDEqZvnz1DYNQ1w== | ||
dependencies: | ||
prop-types "^15.7.2" | ||
|
||
react-native-bootsplash@^3.2.3: | ||
version "3.2.3" | ||
resolved "https://registry.yarnpkg.com/react-native-bootsplash/-/react-native-bootsplash-3.2.3.tgz#5f985a492696e14c73dc3b8475be5385b7436593" | ||
|
@@ -6614,6 +6633,14 @@ react-native-localize@^2.0.2: | |
resolved "https://registry.yarnpkg.com/react-native-localize/-/react-native-localize-2.0.2.tgz#b0df6a88cf9947489deaa828c4c29246681fde16" | ||
integrity sha512-4Ii7lqiD9iL0LxTWifAiEsDcDPpvos/29fEVkHxgEDD7J5f+NROMkFSFomKgz1Cab1TmN5mau3o8yFmYrPFcnw== | ||
|
||
react-native-modal@^11.10.0: | ||
version "11.10.0" | ||
resolved "https://registry.yarnpkg.com/react-native-modal/-/react-native-modal-11.10.0.tgz#94a6d3a2428ba5228cfb4dc174cacea79c871591" | ||
integrity sha512-syRYDJYSh16bR37R5EKU9T/wC+5bEOfF17IUqf5URdhbEDd+hxyMInC++l45E8oI+MtdOaEp9yAws5xDqk8dnA== | ||
dependencies: | ||
prop-types "^15.6.2" | ||
react-native-animatable "1.3.3" | ||
|
||
react-native-ratings@^7.3.0: | ||
version "7.6.1" | ||
resolved "https://registry.yarnpkg.com/react-native-ratings/-/react-native-ratings-7.6.1.tgz#b3d8a99a0c12fd6874f7e3c0e492089543d837c8" | ||
|