Skip to content

Commit

Permalink
add tooltip for steps
Browse files Browse the repository at this point in the history
  • Loading branch information
eperedo committed Mar 19, 2024
1 parent dc5098b commit 2711028
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
17 changes: 10 additions & 7 deletions src/webapp/components/progress-status/ProgressStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ export type ContainerProps = {
$status: Props["status"];
};

export const ProgressStatus: React.FC<Props> = React.memo(({ status, position }) => {
return (
<Container $status={status}>
<StyledTypography>{position}</StyledTypography>
</Container>
);
});
export const ProgressStatus: React.FC<Props> = React.memo(
React.forwardRef<HTMLLIElement, Props>((props, ref) => {
const { status, position, ...rest } = props;
return (
<Container {...rest} ref={ref} $status={status}>
<StyledTypography>{position}</StyledTypography>
</Container>
);
})
);

const Container = styled.li<ContainerProps>`
border-radius: 50%;
Expand Down
12 changes: 7 additions & 5 deletions src/webapp/utils/analysis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ProgressContainer } from "../pages/dashboard/mock";
import { ProgressStatus } from "../components/progress-status/ProgressStatus";
import { QualityAnalysis } from "$/domain/entities/QualityAnalysis";
import { TableColumn } from "@eyeseetea/d2-ui-components";
import { Tooltip } from "@material-ui/core";

function mapAnalysisStatusToColor(sectionStatus: string) {
switch (sectionStatus) {
Expand Down Expand Up @@ -31,11 +32,12 @@ export const analysisColumns: TableColumn<QualityAnalysis>[] = [
return (
<ProgressContainer>
{row.sections.map((value, index) => (
<ProgressStatus
key={index}
position={index + 1}
status={mapAnalysisStatusToColor(value.status)}
/>
<Tooltip key={value.id} title={value.name}>
<ProgressStatus
position={index + 1}
status={mapAnalysisStatusToColor(value.status)}
/>
</Tooltip>
))}
</ProgressContainer>
);
Expand Down

0 comments on commit 2711028

Please sign in to comment.