feat: main

This commit is contained in:
Nikolaj Frey 2023-07-10 10:49:30 +10:00
parent 2452f0b126
commit ad26166723
2 changed files with 11 additions and 6 deletions

View File

@ -222,7 +222,7 @@ export const Thingtime = (props) => {
return props?.path?.human || ""
}, [props?.path])
const path = React.useMemo(() => {
const renderedPath = React.useMemo(() => {
if (humanPath?.includes?.("hidden")) {
return null
}
@ -230,6 +230,11 @@ export const Thingtime = (props) => {
// take only path from before the string unique
return humanPath.split?.("unique")?.[0]
}
return humanPath
}, [humanPath])
const path = React.useMemo(() => {
return (
<Flex
maxWidth="100%"
@ -237,10 +242,10 @@ export const Thingtime = (props) => {
fontSize="12px"
wordBreak="break-all"
>
{humanPath}
{renderedPath}
</Flex>
)
}, [humanPath, pl, props?.pathPl])
}, [renderedPath, pl, props?.pathPl])
const handleMouseEvent = React.useCallback(
(e) => {

View File

@ -39,9 +39,9 @@ export const ThingtimeDemo = (props) => {
name: "three",
},
],
"...unique1": "I'm unique",
"...unique2": "I'm unique",
"...unique3": "I'm unique",
"Identical Keys unique1": "I'm unique 1",
"Identical Keys unique2": "I'm unique 2",
"Identical Keys unique3": "I'm unique 3",
}
const [demoThing, setDemoThing] = React.useState(thing)