diff --git a/src/components/FlameLinkStructure.js b/src/components/FlameLinkStructure.js new file mode 100644 index 0000000..ccf4c7d --- /dev/null +++ b/src/components/FlameLinkStructure.js @@ -0,0 +1,54 @@ +import React, { Component, Fragment} from 'react'; +import Grid from '@material-ui/core/Grid'; +import Paper from '@material-ui/core/Paper'; +import Typography from '@material-ui/core/Typography'; +import flamelinkApp from '../flamelink.js'; + +class FlameLinkStructure extends Component { + constructor() { + super(); + + this.state = { + schemaContent: '', + } + + flamelinkApp.content.get('martenSchemaDemo') + .then(result => this.setState({ + schemaContent: result + })) + } + + getContent(key, type){ + if (type == 'text'){ + return this.state.schemaContent[key] + } + if (type == 'media'){ + for (var val in this.state.schemaContent[key]){ + console.log(this.state.schemaContent[key][val]); + flamelinkApp.storage.getURL(this.state.schemaContent[key][val]) + .then(url => console.log('File URL:', url)) + } + } + } + + render() { + const lg = this.props.field.gridColumns.lg; + const md = this.props.field.gridColumns.md; + const sm = this.props.field.gridColumns.sm; + const xs = this.props.field.gridColumns.xs; + return( + + + + HEADER + + + {this.getContent(this.props.field.key, this.props.type)} + + + + ); + } +} + +export default FlameLinkStructure; \ No newline at end of file