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

View File

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