Skip to content

Commit dfe08a7

Browse files
authored
Merge pull request #6 from loijwdev/feat/add-default-value
feat: set default values for `overlayColor` and `overlayStrokeWidth` in `LiveDetectEdgesView`
2 parents de40a79 + d1e8425 commit dfe08a7

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

example/src/screens/HomeScreen.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,7 @@ export default function HomeScreen() {
9999

100100
{openCamera ? (
101101
<>
102-
<LiveDetectEdgesView
103-
overlayColor="red"
104-
overlayStrokeWidth={4}
105-
style={styles.scanner}
106-
/>
102+
<LiveDetectEdgesView style={styles.scanner} />
107103
{isProcessing && (
108104
<View style={styles.overlayIndicator}>
109105
<ActivityIndicator size="large" color="white" />

src/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ export type LiveDetectEdgesViewProps = ViewProps & {
77
overlayStrokeWidth?: number;
88
};
99

10-
export const LiveDetectEdgesView = (props: LiveDetectEdgesViewProps) => {
10+
export const LiveDetectEdgesView = ({
11+
overlayColor = 'rgba(0, 255, 0, 0.5)',
12+
overlayStrokeWidth = 4,
13+
...props
14+
}: LiveDetectEdgesViewProps) => {
1115
return (
1216
<LiveDetectEdgesViewNativeComponent
17+
overlayColor={overlayColor}
18+
overlayStrokeWidth={overlayStrokeWidth}
1319
{...props}
1420
style={[styles.defaultStyle, props.style]}
1521
/>

0 commit comments

Comments
 (0)