Skip to content

Commit

Permalink
test(widgets): hide price chart for e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pwltr committed Sep 4, 2023
1 parent 80e6409 commit 91a83e7
Showing 1 changed file with 43 additions and 43 deletions.
86 changes: 43 additions & 43 deletions src/components/PriceChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,42 +103,44 @@ export const Chart = ({

return (
<View style={[styles.chart, style]} onLayout={handleLayout}>
<Canvas style={styles.canvas}>
<Path
path={line}
color={positive ? green : red}
style="stroke"
strokeWidth={1.3}>
<CornerPathEffect r={10} />
</Path>

<Mask
mode="luminance"
mask={
<Path path={mask} color="white" style="fill">
<CornerPathEffect r={8} />
</Path>
}>
<Rect x={0} y={0} width={width} height={height}>
<LinearGradient
start={vec(0, 0)}
end={vec(0, height)}
positions={[0, 1]}
colors={positive ? greenGradient : redGradient}
{!__E2E__ && (
<Canvas style={styles.canvas}>
<Path
path={line}
color={positive ? green : red}
style="stroke"
strokeWidth={1.3}>
<CornerPathEffect r={10} />
</Path>

<Mask
mode="luminance"
mask={
<Path path={mask} color="white" style="fill">
<CornerPathEffect r={8} />
</Path>
}>
<Rect x={0} y={0} width={width} height={height}>
<LinearGradient
start={vec(0, 0)}
end={vec(0, height)}
positions={[0, 1]}
colors={positive ? greenGradient : redGradient}
/>
</Rect>
</Mask>

{period && font && (
<Text
x={7}
y={height - 7}
text={period}
font={font}
color="rgba(255, 255, 255, 0.2)"
/>
</Rect>
</Mask>

{period && font && (
<Text
x={7}
y={height - 7}
text={period}
font={font}
color="rgba(255, 255, 255, 0.2)"
/>
)}
</Canvas>
)}
</Canvas>
)}
</View>
);
};
Expand Down Expand Up @@ -192,14 +194,12 @@ const PriceChart = ({

return (
<View style={[styles.root, style]}>
{!__E2E__ && (
<Chart
style={styles.priceChart}
values={history.pastValues}
positive={history.change.color === 'green'}
period={period}
/>
)}
<Chart
style={styles.priceChart}
values={history.pastValues}
positive={history.change.color === 'green'}
period={period}
/>
</View>
);
};
Expand Down

0 comments on commit 91a83e7

Please sign in to comment.