@imonk777/react-native-slide-charts
Version:
React Native Slide Charts uses react-native-svg, d3, and react-native-gesture-handler to create interactive charts.
18 lines (14 loc) • 396 B
text/typescript
import { Platform, Dimensions } from 'react-native'
export const isAndroid = () => {
return Platform.OS === 'android'
}
export const isIOS = () => {
return Platform.OS === 'ios'
}
export const vw = (
percentageWidth: number,
rounded: boolean = false
): number => {
const value = Dimensions.get('window').width * (percentageWidth / 100)
return rounded ? Math.round(value) : value
}