Skip to content

Commit

Permalink
Merge pull request #115 from MetaCell/SCKAN-107
Browse files Browse the repository at this point in the history
SCKAN-107 add tooltip on sentence hover at list page
  • Loading branch information
ddelpiano authored May 2, 2023
2 parents f36da1a + 1da1354 commit 50317fa
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions frontend/src/components/DataGridWidgets/DataGridWidgets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,30 @@ import ChatBubbleOutlineOutlinedIcon from "@mui/icons-material/ChatBubbleOutline
import { vars } from "../../theme/variables"
import Tag from "../Widgets/Tag"
import {SentenceStateChip, StatementStateChip} from "../Widgets/StateChip"
import { Tooltip } from "@mui/material"

export const renderPMID = (params: GridRenderCellParams) => (
<Typography variant="subtitle1" color={vars.darkTextColor}>
{params.value}
</Typography>
);

export const renderTitle = (params: GridRenderCellParams) => (
<Typography
variant="body1"
sx={{
display: "-webkit-box",
WebkitLineClamp: 2,
WebkitBoxOrient: "vertical",
overflow: "hidden",
textOverflow: "ellipsis",
}}
>
{params.value}
</Typography>
);
export const renderTitle = (params: GridRenderCellParams) => (
<Tooltip title={params.field === 'text' && params.value}>
<Typography
variant="body1"
sx={{
display: "-webkit-box",
WebkitLineClamp: 2,
WebkitBoxOrient: "vertical",
overflow: "hidden",
textOverflow: "ellipsis",
}}
>
{params.value}
</Typography>
</Tooltip>
)

export const renderDate = (params: GridRenderCellParams) => {
const date = new Date(params.value).toLocaleString("en-UK", {
Expand Down

0 comments on commit 50317fa

Please sign in to comment.