Skip to content

Commit

Permalink
Merge branch 'patch' of github.com:gluestack/gluestack-ui into patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Suraj authored and Suraj committed Jul 16, 2024
2 parents 9737729 + ede5a3e commit 5c70f37
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 47 deletions.
39 changes: 23 additions & 16 deletions example/storybook-nativewind/src/components/Text/Text.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,37 @@ const TextMeta: ComponentMeta<typeof Text> = {
'6xl',
],
},
fontWeight: {
control: 'select',
options: [
'hairline',
'thin',
'light',
'normal',
'medium',
'semibold',
'bold',
'extrabold',
'black',
'extrablack',
],
bold: {
control: 'boolean',
},
italic: {
control: 'boolean',
},
underline: {
control: 'boolean',
},
strikeThrough: {
control: 'boolean',
},
highlight: {
control: 'boolean',
},
sub: {
control: 'boolean',
},
},
args: {
text: 'Hello world',
size: 'md',
fontWeight: 'medium',
bold: false,
italic: false,
underline: false,
strikeThrough: false,
highlight: false,
sub: false,
},
};

export default TextMeta;

export { Text };
// export { TextSizes };
26 changes: 2 additions & 24 deletions example/storybook-nativewind/src/components/Text/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,9 @@
import React from 'react';
import { Text } from '@/components/ui/text';

const TextBasic = ({
size = 'md',
text = 'Hello world',
fontWeight = 'bold',
...props
}: any) => {
const fontWeights = {
hairline: 'font-hairline',
thin: 'font-thin',
light: 'font-light',
normal: 'font-normal',
medium: 'font-medium',
semibold: 'font-semibold',
bold: 'font-bold',
extrabold: 'font-extrabold',
black: 'font-black',
extrablack: 'font-extrablack',
};

const TextBasic = ({ size = 'md', text = 'Hello world', ...props }: any) => {
return (
<Text
size={size}
{...props}
className={`${fontWeights[fontWeight as keyof typeof fontWeights]}`}
>
<Text size={size} {...props}>
{text}
</Text>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,19 @@ const Menu = React.forwardRef(
ref={ref}
initial={{
opacity: 0,
scale: 0.8,
}}
animate={{
opacity: 1,
scale: 1,
}}
exit={{
opacity: 0,
scale: 0.8,
}}
transition={{
type: 'spring',
damping: 18,
stiffness: 250,
opacity: {
type: 'timing',
duration: 200,
},
type: 'timing',
duration: 100,
}}
className={menuStyle({
class: className,
Expand Down

0 comments on commit 5c70f37

Please sign in to comment.