feat: team draft

This commit is contained in:
2024-11-12 19:15:13 +07:00
parent 8159b65605
commit f5250d5361
23 changed files with 313 additions and 48 deletions
+4
View File
@@ -1,8 +1,12 @@
import MaterialCommunityIcons from "@expo/vector-icons/MaterialCommunityIcons";
import IoniconsIcon from "@expo/vector-icons/Ionicons";
import { styled } from "tamagui";
export const Icons = styled(MaterialCommunityIcons, {
color: "$color",
});
export const Ionicons = styled(IoniconsIcon, {
color: "$color",
});
export default Icons;
+50
View File
@@ -0,0 +1,50 @@
import React from "react";
import {
GetProps,
ListItem,
Popover,
styled,
withStaticProperties,
} from "tamagui";
type MenuButtonProps = GetProps<typeof Popover> & {
asChild?: boolean;
trigger?: React.ReactNode;
width?: string | number | null;
};
const MenuButtonFrame = ({
asChild,
trigger,
children,
width,
...props
}: MenuButtonProps) => {
return (
<Popover {...props}>
<Popover.Trigger asChild={asChild}>{trigger}</Popover.Trigger>
<Popover.Content
bordered
enterStyle={{ y: -10, opacity: 0 }}
exitStyle={{ y: -10, opacity: 0 }}
animation={["quick", { opacity: { overshootClamping: true } }]}
width={width}
>
{children}
</Popover.Content>
</Popover>
);
};
const MenuButtonItem = (props: GetProps<typeof ListItem>) => (
<Popover.Close asChild>
<ListItem hoverTheme pressTheme {...props} />
</Popover.Close>
);
const MenuButton = withStaticProperties(MenuButtonFrame, {
Item: MenuButtonItem,
});
export default MenuButton;