feat: main Added hideable keys to objects

This commit is contained in:
Nikolaj Frey 2023-07-02 00:22:04 +10:00
parent 4cac573bb6
commit 9b9171be21
3 changed files with 18 additions and 5 deletions

View File

@ -17,9 +17,21 @@ try {
// nothing // nothing
} }
const forceable = {
'Bottom Content': {
Content: {
hidden1: "Edit this to your heart's desire.",
hidden2: '?',
'How?':
'Just search for Bottom Content.Content and edit the value to whatever you want.'
}
}
}
const initialThingtime = { const initialThingtime = {
nav: {}, nav: {},
version: 4 version: 9,
...forceable
} }
const userData = { const userData = {
@ -28,9 +40,7 @@ const userData = {
clearCommanderOnToggle: true, clearCommanderOnToggle: true,
clearCommanderContextOnToggle: true clearCommanderContextOnToggle: true
}, },
'Bottom Content': { ...forceable
Content: "Edit this to your heart's desire"
}
} }
export const ThingtimeProvider = (props: any): JSX.Element => { export const ThingtimeProvider = (props: any): JSX.Element => {

View File

@ -194,6 +194,9 @@ export const Thingtime = props => {
const [showContextMenu, setShowContextMenu] = React.useState(false) const [showContextMenu, setShowContextMenu] = React.useState(false)
const path = React.useMemo(() => { const path = React.useMemo(() => {
if (props?.path?.human?.includes?.('hidden')) {
return null
}
return ( return (
<Flex maxW='100%' pl={pl} wordBreak={'break-all'} fontSize='12px'> <Flex maxW='100%' pl={pl} wordBreak={'break-all'} fontSize='12px'>
{props?.path?.human} {props?.path?.human}

View File

@ -16,8 +16,8 @@ export default function Index () {
justifyContent='center' justifyContent='center'
> >
<Splash></Splash> <Splash></Splash>
<ThingtimeDemo></ThingtimeDemo>
<Thingtime mb={200} thing={thingtime['Bottom Content']}></Thingtime> <Thingtime mb={200} thing={thingtime['Bottom Content']}></Thingtime>
<ThingtimeDemo></ThingtimeDemo>
<ProfileDrawer></ProfileDrawer> <ProfileDrawer></ProfileDrawer>
</Flex> </Flex>
) )