react-native-boxes 1.4.65 → 1.4.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Bar.tsx +31 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-boxes",
3
- "version": "1.4.65",
3
+ "version": "1.4.66",
4
4
  "description": "A react native library for rapid development of UI using boxes",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/Bar.tsx CHANGED
@@ -261,4 +261,35 @@ export function DividerView(props: DividerProps) {
261
261
  }} />
262
262
  </Center>
263
263
  )
264
+ }
265
+
266
+
267
+ export type ProgressBarViewProps = ViewProps & {
268
+ progress: number
269
+ progressColor?: String
270
+ pendingColor?: String
271
+ }
272
+ export function ProgressBarView(props: ProgressBarViewProps) {
273
+ const { progress } = props
274
+ const theme = useContext(ThemeContext)
275
+ return (
276
+ <View style={[{
277
+ marginTop: theme.dimens.space.md,
278
+ flexDirection: 'row',
279
+ height: theme.dimens.icon.sm / 3,
280
+ width: '100%',
281
+ backgroundColor: '#d3d3d3',
282
+ borderRadius: 5,
283
+ overflow: 'hidden',
284
+ }, props.style]}>
285
+ <View style={{
286
+ width: `${progress}%`,
287
+ backgroundColor: `${props.progressColor || theme.colors.accentLight}`,
288
+ }} />
289
+ <View style={{
290
+ width: `${100 - progress}%`,
291
+ backgroundColor: `${props.pendingColor || theme.colors.background}`,
292
+ }} />
293
+ </View>
294
+ );
264
295
  }