Skip to content

Commit

Permalink
Set default width for linear progress component (#967)
Browse files Browse the repository at this point in the history
* set width 100% for linear progress component

* update script for run example

* update example of linear progress
  • Loading branch information
sieu-db authored Nov 15, 2024
1 parent 94f5d54 commit 9e984ee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion example/src/LinearProgressExample.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import Section, { Container } from "./Section";
import { LinearProgress, Button } from "@draftbit/ui";
import { Text } from "react-native";
import { Text, View } from "react-native";

const ProgressExample: React.FC = () => {
const [value, setValue] = React.useState(50);
Expand Down Expand Up @@ -49,6 +49,11 @@ const ProgressExample: React.FC = () => {
title="Randomize Progress"
onPress={() => setValue(Math.random() * 101)}
/>
<Section title="Centerize content" style={{}}>
<View style={{ justifyContent: "center", alignItems: "center" }}>
<LinearProgress value={value} />
</View>
</Section>
</Container>
);
};
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"scripts": {
"postinstall": "yarn-deduplicate && patch-package",
"example": "yarn --cwd example",
"example:web": "yarn example start -c --web",
"example:ios": "yarn example start -c --ios",
"example:android": "yarn example start -c --android",
"bootstrap": "lerna bootstrap",
"crosslink": "lerna link",
"format": "prettier --write .",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export const LinearProgress: React.FC<ValueProgressProps> = ({
style={[
{
height: maxThickness,
width: "100%",
},
style,
]}
Expand Down

0 comments on commit 9e984ee

Please sign in to comment.