-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docz-theme-default): add tooltip on props
- Loading branch information
1 parent
f0f79b6
commit dc3c4cd
Showing
3 changed files
with
82 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import * as React from 'react' | ||
import { SFC, ReactNode } from 'react' | ||
import { Tooltip as BaseTooltip } from 'react-lightweight-tooltip' | ||
|
||
import * as colors from '../styles/colors' | ||
|
||
interface TooltipProps { | ||
text: ReactNode | ||
children: ReactNode | ||
} | ||
|
||
const styles = { | ||
content: { | ||
backgroundColor: colors.steel, | ||
color: colors.snow, | ||
}, | ||
tooltip: { | ||
display: 'flex', | ||
alignItems: 'center', | ||
width: 220, | ||
maxWidth: 220, | ||
padding: 5, | ||
backgroundColor: colors.steel, | ||
borderRadius: '3px', | ||
}, | ||
arrow: { | ||
borderTop: `solid ${colors.steel} 5px`, | ||
}, | ||
} | ||
|
||
export const Tooltip: SFC<TooltipProps> = ({ text, children }) => ( | ||
<BaseTooltip styles={styles} content={text}> | ||
{children} | ||
</BaseTooltip> | ||
) |
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