more fixes and changes, crash, design …
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import React, { useCallback } from "react";
|
||||
import { BlurView } from "expo-blur";
|
||||
import { Pressable } from "react-native";
|
||||
import { Pressable, Text } from "react-native";
|
||||
import { Entypo } from "@expo/vector-icons";
|
||||
import { FONT_FAMILY } from "../../styles/Fonts";
|
||||
import { openShareSheet } from "../../utils/shareSheet";
|
||||
|
||||
export default function ShareBtn({ style, onPress = null }) {
|
||||
export default function ShareBtn({
|
||||
style,
|
||||
onPress = null,
|
||||
label = null,
|
||||
iconOnly = false,
|
||||
}) {
|
||||
const handlePress = useCallback(() => {
|
||||
if (typeof onPress === "function") {
|
||||
onPress();
|
||||
@@ -25,14 +31,33 @@ export default function ShareBtn({ style, onPress = null }) {
|
||||
intensity={20}
|
||||
tint="dark"
|
||||
style={{
|
||||
padding: 12,
|
||||
padding: iconOnly ? 10 : label ? 10 : 12,
|
||||
paddingHorizontal: iconOnly ? 10 : label ? 16 : 12,
|
||||
borderRadius: 15,
|
||||
overflow: "hidden",
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
borderWidth: iconOnly ? 1 : 0,
|
||||
borderColor: iconOnly ? "rgba(255, 255, 255, 0.1)" : "transparent",
|
||||
backgroundColor: iconOnly
|
||||
? "rgba(12, 14, 18, 0.72)"
|
||||
: "transparent",
|
||||
}}
|
||||
>
|
||||
{label && !iconOnly ? (
|
||||
<Text
|
||||
style={{
|
||||
fontSize: 14,
|
||||
color: "#ffffff",
|
||||
fontFamily: FONT_FAMILY.InterMedium,
|
||||
marginRight: 8,
|
||||
}}
|
||||
numberOfLines={1}
|
||||
>
|
||||
{label}
|
||||
</Text>
|
||||
) : null}
|
||||
<Entypo name="share-alternative" size={18} color="white" />
|
||||
</BlurView>
|
||||
</Pressable>
|
||||
|
||||
Reference in New Issue
Block a user