Skip to content

Commit a78d46d

Browse files
author
ci-bot
committed
add tooltip
1 parent b7a2108 commit a78d46d

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

apps/learneth/src/pages/Home/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { useState, useEffect, useMemo } from 'react'
2+
import { CustomTooltip } from "@remix-ui/helper"
23
import { Link } from 'react-router-dom'
34
import { useAppSelector } from '../../redux/hooks'
45
import RepoImporter from '../../components/RepoImporter'
@@ -184,7 +185,12 @@ function HomePage(): JSX.Element {
184185
<Antenna level={r.levelNum} />
185186
<span className="small fw-medium text-body-emphasis">{r.levelText}</span>
186187
{completedTutorials[r.id] && (
187-
<i className="text-success ms-2 fas fa-check"></i>
188+
<CustomTooltip
189+
placement={"auto"}
190+
tooltipId="tutorialCompletedTooltip"
191+
tooltipClasses="text-nowrap"
192+
tooltipText={<span>{'Completed'}</span>}
193+
><i className="text-success ms-2 fas fa-check"></i></CustomTooltip>
188194
)}
189195
</div>
190196
<MetaRight stepsLen={r.stepsLen} duration={r.duration} />

apps/learneth/src/pages/StepList/index.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { useMemo, useState, useEffect } from 'react'
2+
import { CustomTooltip } from "@remix-ui/helper"
23
import { Link, useLocation, useNavigate } from 'react-router-dom'
34
import ReactMarkdown from 'react-markdown'
45
import remarkGfm from 'remark-gfm'
@@ -104,9 +105,14 @@ export default function StepListPage(): JSX.Element {
104105
<div className="container-fluid">
105106
<article className="card course-hero mb-3 border border-secondary">
106107
<div className="card-body">
107-
{entity?.id &&completedTutorials[entity?.id] && (
108-
<span className="badge bg-success float-end">Finished</span>
109-
)}
108+
{entity?.id && completedTutorials[entity?.id] && (
109+
<CustomTooltip
110+
placement={"auto"}
111+
tooltipId="tutorialCompletedTooltip"
112+
tooltipClasses="text-nowrap"
113+
tooltipText={<span>{'Completed'}</span>}
114+
><span className="badge bg-success float-end">Completed</span></CustomTooltip>
115+
)}
110116
<h2 className="h4 mb-2">{entity?.name}</h2>
111117
<div className={`description-wrapper ${!isExpanded && needsExpansionButton ? 'truncated' : ''}`}>
112118
<ReactMarkdown

0 commit comments

Comments
 (0)