Skip to content

Commit

Permalink
feat: 🧬 + AlertView
Browse files Browse the repository at this point in the history
  • Loading branch information
zheleznov163 committed Sep 1, 2022
1 parent a5c2189 commit cf16d29
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
54 changes: 54 additions & 0 deletions components/moleculs/AlertView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { Icon2 } from "components/atoms"
import { StyleSheet, Text, View } from "react-native"
import { useSafeAreaInsets } from "react-native-safe-area-context"
import { COLOR } from "utils"

type AlertViewProps = {
message?: string | null
}

export default ({ message }: AlertViewProps) => {
const insets = useSafeAreaInsets()
return (
<View
style={[
styles.container,
{
height: 110 + insets.top,
paddingTop: insets.top,
},
]}
>
<View style={styles.content}>
<Icon2 name="alert_circle" size={24} stroke={COLOR.White} style={styles.icon} />
<Text style={styles.message}>{message || "Error"}</Text>
</View>
</View>
)
}

const styles = StyleSheet.create({
container: {
backgroundColor: COLOR.Pink,
position: "absolute",
top: 0,
width: "100%",
paddingHorizontal: 20,
borderBottomLeftRadius: 20,
borderBottomRightRadius: 20,
},
content: {
flexDirection: "row",
alignItems: "center",
paddingVertical: 10,
},
icon: { marginRight: 20 },
message: {
fontFamily: "CircularStd",
fontStyle: "normal",
fontWeight: "500",
fontSize: 14,
lineHeight: 18,
color: COLOR.White,
},
})
1 change: 1 addition & 0 deletions components/moleculs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export { default as Numpad } from "./Numpad"
export { default as InputWord } from "./InputWord"
export { default as CardWillSend } from "./CardWillSend"
export { default as BottomSheetHeader } from "./BottomSheetHeader"
export { default as AlertView } from "./AlertView"

0 comments on commit cf16d29

Please sign in to comment.