-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
411 additions
and
32 deletions.
There are no files selected for viewing
37 changes: 5 additions & 32 deletions
37
example/storybook/src/unstyled/ui-components/Button/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,14 @@ | ||
import React from 'react'; | ||
import { createButton } from '@gluestack-ui/button'; | ||
import { Root, Text, Group, Spinner, Icon } from './styled-components'; | ||
|
||
export const AccessibleButton = createButton({ | ||
export const Button = createButton({ | ||
Root, | ||
Text, | ||
Group, | ||
Spinner, | ||
Icon, | ||
}); | ||
|
||
//@ts-ignore | ||
export const Button = ({ children, ...props }) => { | ||
// console.log(children, typeof children === 'string', 'Chlired button'); | ||
return ( | ||
<AccessibleButton {...props}> | ||
{typeof children === 'string' ? ( | ||
<AccessibleButton.Text>{children}</AccessibleButton.Text> | ||
) : ( | ||
<>{children}</> | ||
)} | ||
</AccessibleButton> | ||
); | ||
}; | ||
|
||
//@ts-ignore | ||
export const ButtonText = ({ children, ...props }) => { | ||
return <AccessibleButton.Text {...props}>{children}</AccessibleButton.Text>; | ||
}; | ||
// export const ButtonGroup = Button.Group; | ||
// export const ButtonSpinner = Button.Spinner; | ||
// export const ButtonIcon = Button.Icon; | ||
|
||
// const ButtonTemp = ({ children, ...props }) => { | ||
// return <AccessibleButton>{children}</AccessibleButton>; | ||
// }; | ||
|
||
// const Button = ButtonTemp; | ||
// Button.Text = AccessibleButton.Text; | ||
// export const Button = ButtonTemp; | ||
export const ButtonText = Button.Text; | ||
export const ButtonGroup = Button.Group; | ||
export const ButtonSpinner = Button.Spinner; | ||
export const ButtonIcon = Button.Icon; |
Oops, something went wrong.