Created
July 10, 2025 10:01
-
-
Save obayit/2e2c92e6cab55a3d4a592a47133259f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { View, StyleSheet, Dimensions } from 'react-native'; | |
import Svg, { Path } from 'react-native-svg'; | |
const blueColor = '#1a3f9d' // this is best guess on what the color should be, making the curve transparent is very very hard to do | |
export default function({ style }) { | |
return ( | |
<View style={[styles.cutLineContainer, style]}> | |
{/* Left Curve */} | |
<View style={styles.svgWrapper}> | |
<Svg width={22} height={42} viewBox="0 0 22 42" fill="none" preserveAspectRatio="none"> | |
<Path | |
d="M22 0H0C0 2.89949 2.41157 5.16564 5.1607 6.08724C11.4651 8.20067 16 14.079 16 21C16 27.921 11.4651 33.7993 5.16071 35.9128C2.41157 36.8344 0 39.1005 0 42H22V0Z" | |
fill="white" | |
/> | |
</Svg> | |
</View> | |
{/* Dashes */} | |
<View style={styles.borderSplitterContainer}> | |
<View style={styles.borderSplitter} /> | |
</View> | |
{/* Right Curve */} | |
<View style={styles.svgWrapper}> | |
<Svg width={22} height={42} viewBox="0 0 22 42" fill="none" preserveAspectRatio="none"> | |
<Path | |
d="M0 0H22C22 2.89949 19.5884 5.16564 16.8393 6.08724C10.5349 8.20067 6 14.079 6 21C6 27.921 10.5349 33.7993 16.8393 35.9128C19.5884 36.8344 22 39.1005 22 42H0V0Z" | |
fill="white" | |
/> | |
</Svg> | |
</View> | |
</View> | |
); | |
}; | |
const styles = StyleSheet.create({ | |
cutLineContainer: { | |
height: 42, | |
flexDirection: 'row', | |
alignItems: 'center', | |
backgroundColor: 'transparent', | |
}, | |
svgWrapper: { | |
width: 22, | |
height: 42, | |
backgroundColor: 'transparent', | |
overflow: 'hidden', | |
}, | |
borderSplitterContainer: { | |
marginLeft: -2, // hacky way to hide some lines i couldn't remove from the svg | |
marginRight: -2, // hacky way to hide some lines i couldn't remove from the svg | |
flex: 1, | |
backgroundColor: 'white', | |
}, | |
borderSplitter: { | |
flex: 1, | |
borderTopWidth: 3, | |
marginTop: 42/2 - 2, | |
borderStyle: 'dashed', | |
borderTopColor: blueColor, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment