File tree Expand file tree Collapse file tree 2 files changed +33
-21
lines changed
Expand file tree Collapse file tree 2 files changed +33
-21
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import {
1515} from "shared/interface" ;
1616import LinkComponent from "components/Link" ;
1717import { scrollToElementIfInView } from "shared/utils" ;
18+ import { Tooltip } from "@mui/material" ;
1819
1920type StyledTreeItemProps = TreeItemProps & {
2021 bgColor ?: string ;
@@ -154,6 +155,7 @@ export default function ControlledTreeView(props: {
154155 const LabelEle = ( ) => {
155156 return (
156157 < Stack
158+ key = { `${ deepth } _${ item . id } ` }
157159 direction = "row"
158160 sx = { {
159161 minHeight : "1.75rem" ,
@@ -228,32 +230,42 @@ export default function ControlledTreeView(props: {
228230
229231const generateItemLabel = ( content : DocLeftNavItemContent ) => {
230232 return (
231- < Box sx = { { width : "100%" } } >
233+ < Box sx = { { width : "100%" , overflow : "hidden" , textOverflow : "ellipsis" } } >
232234 { content . map ( ( content , index ) =>
233235 typeof content === "string" ? (
234- < Typography
236+ < Tooltip
235237 key = { `${ content } -${ index } ` }
236- component = "div"
237- sx = { {
238- color : "inherit" ,
239- fontSize : "0.875rem" ,
240- lineHeight : "1.25rem" ,
241- } }
238+ title = { content }
239+ enterDelay = { 1000 }
242240 >
243- { content }
244- </ Typography >
241+ < Typography
242+ component = "div"
243+ sx = { {
244+ color : "inherit" ,
245+ fontSize : "0.875rem" ,
246+ lineHeight : "1.25rem" ,
247+ } }
248+ >
249+ { content }
250+ </ Typography >
251+ </ Tooltip >
245252 ) : (
246- < Typography
247- key = { `${ content . value } -${ index } ` }
248- component = "code"
249- sx = { {
250- color : "inherit" ,
251- fontSize : "0.875rem" ,
252- lineHeight : "1.25rem" ,
253- } }
253+ < Tooltip
254+ key = { `${ content } -${ index } ` }
255+ title = { content . value }
256+ enterDelay = { 1000 }
254257 >
255- { content . value }
256- </ Typography >
258+ < Typography
259+ component = "code"
260+ sx = { {
261+ color : "inherit" ,
262+ fontSize : "0.875rem" ,
263+ lineHeight : "1.25rem" ,
264+ } }
265+ >
266+ { content . value }
267+ </ Typography >
268+ </ Tooltip >
257269 )
258270 ) }
259271 </ Box >
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export function generateDocsHomeUrl(lang?: string) {
3838 case "ja" :
3939 return "/ja/tidbcloud" ;
4040 case "zh" :
41- return "/zh" ;
41+ return "/zh/ " ;
4242 case "en" :
4343 default :
4444 return "/" ;
You can’t perform that action at this time.
0 commit comments