This commit is contained in:
oneao committed 2026-01-23 17:26:10 +08:00
1 parent ac724bbdaa
commit 500fab7a80
98 files changed
+24706 -109

No files matched your search

@@ -19,9 +19,10 @@ interface DrawerMenuProps {
visible: boolean
duration?: number
menuPosition?: 'left' | 'right' | 'top' | 'bottom'
Height?: DimensionValue
height?: DimensionValue
hideModal: () => void
children?: ReactNode
header?: ReactNode
isCircle?: boolean
CircleNum?: number
isShadowHideModal?: boolean
@@ -30,7 +31,7 @@ interface DrawerMenuProps {
export default function Drawer({
visible,
Height,
height,
hideModal,
duration = 300,
isCircle,
@@ -38,6 +39,7 @@ export default function Drawer({
children,
CircleNum,
isShadowHideModal = true,
header,
title,
}: DrawerMenuProps) {
const [menuPositionStyle, setMenuPositionStyle] = useState<ViewStyle>()
@@ -68,7 +70,7 @@ export default function Drawer({
borderBottomRightRadius: isCircle ? CircleNum : 0,
})
setDrawerMenuBox({
width: Height,
width: height,
height: WINDOW.height,
position: 'absolute',
left: 0,
@@ -84,7 +86,7 @@ export default function Drawer({
borderBottomLeftRadius: isCircle ? CircleNum : 0,
})
setDrawerMenuBox({
width: Height,
width: height,
height: WINDOW.height,
position: 'absolute',
right: 0,
@@ -101,7 +103,7 @@ export default function Drawer({
})
setDrawerMenuBox({
width: WINDOW.width,
height: Height,
height,
position: 'absolute',
top: 0,
right: 0,
@@ -118,14 +120,14 @@ export default function Drawer({
})
setDrawerMenuBox({
width: WINDOW.width,
height: Height,
height,
position: 'absolute',
bottom: 0,
right: 0,
})
break
}
}, [menuPosition, Height, isCircle, CircleNum])
}, [menuPosition, height, isCircle, CircleNum])
/* ================== 动画 ================== */
const open = () => {
@@ -219,17 +221,20 @@ export default function Drawer({
<View style={{ paddingTop: Platform.OS === 'ios' ? 50 : 0 }} />
)}
<View style={styles.headTitle}>
<Text style={styles.title}>{title}</Text>
<LucideIcon
icon="X"
size={24}
color="black"
style={{ position: 'absolute', right: 15, top: 11 }}
onPress={close}
/>
</View>
{
header || (
<View style={styles.headTitle}>
<Text style={styles.title}>{title}</Text>
<LucideIcon
icon="X"
size={22}
color="black"
style={{ position: 'absolute', right: 15, top: 11 }}
onPress={close}
/>
</View>
)
}
{children}
</View>
</Animated.View>
@@ -249,7 +254,6 @@ const styles = StyleSheet.create({
position: 'absolute',
},
headTitle: {
height: 40,
width: '100%',
padding: 10,
justifyContent: 'center',