Skip to content

Commit 9e984ee

Browse files
authored
Set default width for linear progress component (#967)
* set width 100% for linear progress component * update script for run example * update example of linear progress
1 parent 94f5d54 commit 9e984ee

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

example/src/LinearProgressExample.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import Section, { Container } from "./Section";
33
import { LinearProgress, Button } from "@draftbit/ui";
4-
import { Text } from "react-native";
4+
import { Text, View } from "react-native";
55

66
const ProgressExample: React.FC = () => {
77
const [value, setValue] = React.useState(50);
@@ -49,6 +49,11 @@ const ProgressExample: React.FC = () => {
4949
title="Randomize Progress"
5050
onPress={() => setValue(Math.random() * 101)}
5151
/>
52+
<Section title="Centerize content" style={{}}>
53+
<View style={{ justifyContent: "center", alignItems: "center" }}>
54+
<LinearProgress value={value} />
55+
</View>
56+
</Section>
5257
</Container>
5358
);
5459
};

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"scripts": {
1313
"postinstall": "yarn-deduplicate && patch-package",
1414
"example": "yarn --cwd example",
15+
"example:web": "yarn example start -c --web",
16+
"example:ios": "yarn example start -c --ios",
17+
"example:android": "yarn example start -c --android",
1518
"bootstrap": "lerna bootstrap",
1619
"crosslink": "lerna link",
1720
"format": "prettier --write .",

packages/core/src/components/Progress/LinearProgress/LinearProgress.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export const LinearProgress: React.FC<ValueProgressProps> = ({
9696
style={[
9797
{
9898
height: maxThickness,
99+
width: "100%",
99100
},
100101
style,
101102
]}

0 commit comments

Comments
 (0)