parent
0aa21b2a6a
commit
59d8478906
@ -0,0 +1,12 @@ |
||||
{ |
||||
"presets": [ |
||||
[ |
||||
"@nrwl/react/babel", |
||||
{ |
||||
"runtime": "automatic", |
||||
"useBuiltIns": "usage" |
||||
} |
||||
] |
||||
], |
||||
"plugins": [] |
||||
} |
@ -0,0 +1,18 @@ |
||||
{ |
||||
"extends": ["plugin:@nrwl/nx/react", "../../../.eslintrc.json"], |
||||
"ignorePatterns": ["!**/*"], |
||||
"overrides": [ |
||||
{ |
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], |
||||
"rules": {} |
||||
}, |
||||
{ |
||||
"files": ["*.ts", "*.tsx"], |
||||
"rules": {} |
||||
}, |
||||
{ |
||||
"files": ["*.js", "*.jsx"], |
||||
"rules": {} |
||||
} |
||||
] |
||||
} |
@ -0,0 +1,7 @@ |
||||
# remix-ui-tooltip-popup |
||||
|
||||
This library was generated with [Nx](https://nx.dev). |
||||
|
||||
## Running unit tests |
||||
|
||||
Run `nx test remix-ui-tooltip-popup` to execute the unit tests via [Jest](https://jestjs.io). |
@ -0,0 +1 @@ |
||||
export * from './lib/tooltip-popup' |
@ -0,0 +1,23 @@ |
||||
import React from 'react' |
||||
import { OverlayTrigger, Popover } from 'react-bootstrap' |
||||
import { TooltipPopupProps } from '../types' |
||||
import './tooltip-popup.module.css' |
||||
|
||||
const popover = (title?: string, content?: string | React.ReactNode) => ( |
||||
<Popover id="popover-basic" className='bg-light border-secondary'> |
||||
<Popover.Title as="h3" className='bg-dark border-0'>{ title || 'Tooltip' }</Popover.Title> |
||||
<Popover.Content> |
||||
{ content } |
||||
</Popover.Content> |
||||
</Popover> |
||||
) |
||||
|
||||
export function TooltipPopup(props: TooltipPopupProps) { |
||||
return ( |
||||
<OverlayTrigger trigger="click" placement={"bottom"} overlay={popover(props.title, props.children || props.content)}> |
||||
<i className={`${props.icon} remixui_menuicon pr-0 mr-2`}></i> |
||||
</OverlayTrigger> |
||||
) |
||||
} |
||||
|
||||
export default TooltipPopup |
@ -0,0 +1,6 @@ |
||||
export interface TooltipPopupProps { |
||||
children?: React.ReactNode, |
||||
title?: string, |
||||
content?: string, |
||||
icon: string |
||||
} |
@ -0,0 +1,20 @@ |
||||
{ |
||||
"extends": "../../../tsconfig.base.json", |
||||
"compilerOptions": { |
||||
"jsx": "react-jsx", |
||||
"allowJs": true, |
||||
"esModuleInterop": true, |
||||
"allowSyntheticDefaultImports": true, |
||||
"forceConsistentCasingInFileNames": true, |
||||
"strict": true, |
||||
"noImplicitReturns": true, |
||||
"noFallthroughCasesInSwitch": true |
||||
}, |
||||
"files": [], |
||||
"include": [], |
||||
"references": [ |
||||
{ |
||||
"path": "./tsconfig.lib.json" |
||||
} |
||||
] |
||||
} |
@ -0,0 +1,13 @@ |
||||
{ |
||||
"extends": "./tsconfig.json", |
||||
"compilerOptions": { |
||||
"outDir": "../../../dist/out-tsc", |
||||
"types": ["node"] |
||||
}, |
||||
"files": [ |
||||
"../../../node_modules/@nrwl/react/typings/cssmodule.d.ts", |
||||
"../../../node_modules/@nrwl/react/typings/image.d.ts" |
||||
], |
||||
"exclude": ["**/*.spec.ts", "**/*.spec.tsx"], |
||||
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] |
||||
} |
@ -1,23 +0,0 @@ |
||||
import React from 'react' |
||||
import { OverlayTrigger, Popover } from 'react-bootstrap'; |
||||
|
||||
const popover = ( |
||||
<Popover id="popover-basic" className='bg-light border-secondary'> |
||||
<Popover.Title as="h3" className='bg-dark border-0'>Clone Repository</Popover.Title> |
||||
<Popover.Content> |
||||
<div className="remixui_cloneContainer"> |
||||
<input |
||||
className="form-control" |
||||
placeholder="Enter github repository url" |
||||
title="Enter github repository url" |
||||
/> |
||||
</div> |
||||
</Popover.Content> |
||||
</Popover> |
||||
) |
||||
|
||||
export const CloneRepository = () => ( |
||||
<OverlayTrigger trigger="click" placement={"bottom"} overlay={popover}> |
||||
<i className="fas fa-cloud-download remixui_menuicon pr-0 mr-2"></i> |
||||
</OverlayTrigger> |
||||
) |
Loading…
Reference in new issue