forked from premieroctet/openchakra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request premieroctet#46 from premieroctet/feature/duplicate
Add component duplication
- Loading branch information
Showing
13 changed files
with
323 additions
and
78 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react' | ||
import { | ||
TooltipProps, | ||
IconButtonProps, | ||
Tooltip, | ||
IconButton, | ||
} from '@chakra-ui/core' | ||
|
||
interface Props | ||
extends Omit<TooltipProps, 'label' | 'aria-label' | 'children'> { | ||
icon: IconButtonProps['icon'] | ||
as?: IconButtonProps['as'] | ||
label: string | ||
onClick?: () => void | ||
} | ||
|
||
const ActionButton: React.FC<Props> = ({ | ||
icon, | ||
as, | ||
label, | ||
onClick, | ||
...props | ||
}) => { | ||
return ( | ||
<Tooltip hasArrow aria-label={label} label={label} zIndex={11} {...props}> | ||
<IconButton | ||
size="xs" | ||
variant="ghost" | ||
as={as} | ||
onClick={onClick} | ||
icon={icon} | ||
aria-label={label} | ||
/> | ||
</Tooltip> | ||
) | ||
} | ||
|
||
export default ActionButton |
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
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const generateId = () => { | ||
return `comp-${( | ||
Date.now().toString(36) + | ||
Math.random() | ||
.toString(36) | ||
.substr(2, 5) | ||
).toUpperCase()}` | ||
} |
Oops, something went wrong.