Created
November 7, 2019 09:48
-
-
Save kamescg/287a3e83d8dce98ecc4b9c14b43cc036 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* --- Global Dependencies --- */ | |
import React from 'react' | |
import PropTypes from 'prop-types' | |
import { BoxInject } from '3box-ui-state' | |
/* --- Local Dependencies --- */ | |
import { Component, ListObjectValues } from '@horizin/ui-compose' | |
import { Effects } from '3box-ui-state' | |
/* --- Component --- */ | |
const StorageRender = ({ box, ...props }) => { | |
const storage = Effects.useStorageRetrieveEffect(box, props) | |
return ( | |
!storage.data | |
? null | |
: props.isList | |
? <ListObjectValues | |
data={storage.data} | |
pass={props.pass} | |
component={props.component} | |
/> | |
: Component(props.component, { | |
...storage.data, | |
...props.pass | |
}) | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment