diff --git a/packages/components/src/icon-button/icon-button.stories.tsx b/packages/components/src/icon-button/icon-button.stories.tsx new file mode 100644 index 00000000..cd5ee552 --- /dev/null +++ b/packages/components/src/icon-button/icon-button.stories.tsx @@ -0,0 +1,22 @@ +import { OptionsIcon } from '@status-im/icons' + +import { IconButton } from './icon-button' + +import type { Meta, StoryObj } from '@storybook/react' + +// More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction +const meta: Meta = { + component: IconButton, + argTypes: {}, +} + +type Story = StoryObj + +// More on writing stories with args: https://storybook.js.org/docs/7.0/react/writing-stories/args +export const Default: Story = { + args: { + icon: , + }, +} + +export default meta diff --git a/packages/components/src/icon-button/icon-button.tsx b/packages/components/src/icon-button/icon-button.tsx new file mode 100644 index 00000000..82e8531a --- /dev/null +++ b/packages/components/src/icon-button/icon-button.tsx @@ -0,0 +1,72 @@ +import { Stack, styled, Text } from '@tamagui/core' + +// import { Pressable } from 'react-native' +import type React from 'react' + +const Base = styled(Stack, { + name: 'IconButton', + accessibilityRole: 'button', + + cursor: 'pointer', + userSelect: 'none', + borderRadius: 10, + display: 'inline-flex', + alignItems: 'center', + justifyContent: 'center', + + width: 31, + height: 31, + borderWidth: 1, + backgroundColor: '$neutral-10', + borderColor: '$neutral-10', + + hoverStyle: { + backgroundColor: '$neutral-20', + }, + + variants: { + selected: { + true: { + backgroundColor: '$neutral-30', + borderColor: '$neutral-30', + }, + }, + } as const, +}) + +const Icon = styled(Text, { + color: '$neutral-50', + width: 20, + height: 20, + + hoverStyle: { + color: '$neutral-100', + }, + + variants: { + selected: { + true: { + color: '$neutral-100', + }, + }, + } as const, +}) + +interface Props { + icon: React.ReactElement + onPress?: () => void + selected?: boolean +} + +const IconButton = (props: Props) => { + const { icon, selected, onPress } = props + + return ( + + {icon} + + ) +} + +export { IconButton } +export type { Props as IconButtonProps } diff --git a/packages/components/src/icon-button/index.tsx b/packages/components/src/icon-button/index.tsx new file mode 100644 index 00000000..6f6c2f53 --- /dev/null +++ b/packages/components/src/icon-button/index.tsx @@ -0,0 +1 @@ +export { type IconButtonProps, IconButton } from './icon-button'