Complete main UI #37
@@ -202,6 +202,8 @@
|
|||||||
font-size: 1.4em;
|
font-size: 1.4em;
|
||||||
color: constants.$font-main-color;
|
color: constants.$font-main-color;
|
||||||
user-select: text;
|
user-select: text;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
a{
|
a{
|
||||||
color: constants.$main-color;
|
color: constants.$main-color;
|
||||||
|
|||||||
@@ -411,8 +411,7 @@ const HideScrollbar = forwardRef<HideScrollbarElement, HideScrollbarProps>((prop
|
|||||||
setRefreshTime(Date.now())
|
setRefreshTime(Date.now())
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
const reloadScrollbar = () => {
|
||||||
const resizeObserver = new ResizeObserver(() => {
|
|
||||||
setVerticalScrollbarWidth(
|
setVerticalScrollbarWidth(
|
||||||
(rootRef.current?.offsetWidth ?? 0) - (rootRef.current?.clientWidth ?? 0)
|
(rootRef.current?.offsetWidth ?? 0) - (rootRef.current?.clientWidth ?? 0)
|
||||||
)
|
)
|
||||||
@@ -429,12 +428,20 @@ const HideScrollbar = forwardRef<HideScrollbarElement, HideScrollbarProps>((prop
|
|||||||
setHorizontalScrollbarLength(
|
setHorizontalScrollbarLength(
|
||||||
(rootRef.current.clientWidth / (contentRef.current?.clientWidth ?? 0)) * 100
|
(rootRef.current.clientWidth / (contentRef.current?.clientWidth ?? 0)) * 100
|
||||||
)
|
)
|
||||||
|
|
||||||
refreshLayout()
|
refreshLayout()
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const resizeObserver = new ResizeObserver(() => {
|
||||||
|
reloadScrollbar()
|
||||||
})
|
})
|
||||||
maskRef.current && resizeObserver.observe(maskRef.current)
|
maskRef.current && resizeObserver.observe(maskRef.current)
|
||||||
|
contentRef.current && resizeObserver.observe(contentRef.current)
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
maskRef.current && resizeObserver.unobserve(maskRef.current)
|
maskRef.current && resizeObserver.unobserve(maskRef.current)
|
||||||
|
contentRef.current && resizeObserver.unobserve(contentRef.current)
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user