generated from openedx/frontend-template-application
-
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.
- Loading branch information
1 parent
3b2ff1d
commit 386cddb
Showing
5 changed files
with
69 additions
and
37 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
30 changes: 30 additions & 0 deletions
30
src/features/Dashboard/InstructorAssignSection/ToolTip.jsx
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,30 @@ | ||
import PropTypes from 'prop-types'; | ||
import { Tooltip, OverlayTrigger } from '@edx/paragon'; | ||
|
||
const ToolTip = ({ title, type }) => ( | ||
<OverlayTrigger | ||
placement={type === 'className' ? 'top' : 'bottom'} | ||
overlay={ | ||
( | ||
<Tooltip> | ||
{title} | ||
</Tooltip> | ||
) | ||
} | ||
trigger={['hover', 'focus']} | ||
show={undefined} | ||
> | ||
{type === 'className' ? ( | ||
<h4>{title.substring(0, 20)}...</h4> | ||
) : ( | ||
<p className="course-name">{title.substring(0, 20)}...</p> | ||
)} | ||
</OverlayTrigger> | ||
); | ||
|
||
ToolTip.propTypes = { | ||
title: PropTypes.string.isRequired, | ||
type: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default ToolTip; |
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