-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(toolbar): convert to TypeScript and export types
- Loading branch information
Showing
9 changed files
with
34 additions
and
39 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
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 was deleted.
Oops, something went wrong.
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,27 @@ | ||
import React, { forwardRef } from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
type ToolbarProps = { | ||
children?: React.ReactNode; | ||
noPadding?: boolean; | ||
} & React.HTMLAttributes<HTMLDivElement>; | ||
|
||
const StyledToolbar = styled.div<ToolbarProps>` | ||
position: relative; | ||
display: flex; | ||
align-items: center; | ||
padding: ${props => (props.noPadding ? '0' : '4px')}; | ||
`; | ||
|
||
const Toolbar = forwardRef<HTMLDivElement, ToolbarProps>(function Toolbar( | ||
{ children, noPadding = false, ...otherProps }, | ||
ref | ||
) { | ||
return ( | ||
<StyledToolbar noPadding={noPadding} ref={ref} {...otherProps}> | ||
{children} | ||
</StyledToolbar> | ||
); | ||
}); | ||
|
||
export { Toolbar }; |
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