diff --git a/src/components/Layout.js b/src/components/FlameLinkComponentCreations.js similarity index 72% rename from src/components/Layout.js rename to src/components/FlameLinkComponentCreations.js index 7d9ebca..34ee9f4 100644 --- a/src/components/Layout.js +++ b/src/components/FlameLinkComponentCreations.js @@ -2,7 +2,7 @@ import React, { Component} from 'react'; import FlameLinkStructure from './FlameLinkStructure'; import Grid from '@material-ui/core/Grid'; -class Layout extends Component { +class FlameLinkComponentCreations extends Component { getSchemaFieldData(schemaData){ var arr = []; @@ -13,7 +13,7 @@ class Layout extends Component { } createComponents(num){ - return + return } render() { @@ -25,4 +25,4 @@ class Layout extends Component { } } -export default Layout; \ No newline at end of file +export default FlameLinkComponentCreations; \ No newline at end of file diff --git a/src/components/FlameLinkFieldSet.js b/src/components/FlameLinkFieldSet.js new file mode 100644 index 0000000..2954db5 --- /dev/null +++ b/src/components/FlameLinkFieldSet.js @@ -0,0 +1,31 @@ +import React, { Component} from 'react'; +import Grid from '@material-ui/core/Grid'; +import FlameLinkFieldSetContent from './FlameLinkFieldSetContent'; + + +class FlameLinkFieldSet extends Component { + + + getFieldSetContent(content1, content2){ + var arr = []; + for (var val in content2){ + arr.push(val); + } + var arrContent = [content1, content2]; + return arr.map(this.createFieldSetComponents, arrContent); + } + + createFieldSetComponents(num){ + return + } + + render() { + return( + + {this.getFieldSetContent(this.props.field, this.props.field2)} + + ); + } +} + +export default FlameLinkFieldSet; \ No newline at end of file diff --git a/src/components/FlameLinkFieldSetContent.js b/src/components/FlameLinkFieldSetContent.js new file mode 100644 index 0000000..2e32b0a --- /dev/null +++ b/src/components/FlameLinkFieldSetContent.js @@ -0,0 +1,43 @@ +import React, { Component} from 'react'; +import Grid from '@material-ui/core/Grid'; +import Typography from '@material-ui/core/Typography'; +import FlameLinkImage from './FlameLinkImage'; + +class FlameLinkFieldSetContent extends Component { + + getContent(key, type, description, fieldsetContent){ + if (type === 'text'){ + return ( + + {fieldsetContent[key]} + + ) + } + if(type === 'textarea'){ + return ( + + {fieldsetContent[key]} + + ) + } + if (type === 'media'){ + for (var val in fieldsetContent[key]){ + return + } + } + } + + 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( + + {this.getContent(this.props.fieldKey, this.props.type, this.props.field.description, this.props.data)} + + ); + } +} + +export default FlameLinkFieldSetContent; \ No newline at end of file diff --git a/src/components/FlameLinkImage.js b/src/components/FlameLinkImage.js index 08a4d03..a40cb61 100644 --- a/src/components/FlameLinkImage.js +++ b/src/components/FlameLinkImage.js @@ -15,7 +15,7 @@ class FlameLinkImage extends Component { .then(url => this.setState({ mediaURL: url })) - return + return } render() { diff --git a/src/components/FlameLinkStructure.js b/src/components/FlameLinkStructure.js index 028190a..e1aeb7f 100644 --- a/src/components/FlameLinkStructure.js +++ b/src/components/FlameLinkStructure.js @@ -1,9 +1,18 @@ import React, { Component} from 'react'; import Grid from '@material-ui/core/Grid'; import Typography from '@material-ui/core/Typography'; +import { withStyles } from '@material-ui/core/styles'; import flamelinkApp from '../flamelink.js'; import FlameLinkImage from './FlameLinkImage'; +import FlameLinkFieldSet from './FlameLinkFieldSet'; +const styles = theme => ({ + flamelinkItem: { + paddingRight: 20, + paddingLeft: 20, + paddingTop: 20, + }, + }); class FlameLinkStructure extends Component { constructor() { @@ -13,55 +22,99 @@ class FlameLinkStructure extends Component { schemaContent: '', } - flamelinkApp.content.get('martenSchemaDemo') + flamelinkApp.content.get(global.schemaName) .then(result => this.setState({ schemaContent: result })) - } - getContent(key, type, description){ + getContent(schemaField, key, type, description){ if (type === 'text'){ if(description === 'h1'){ return ( - - {this.state.schemaContent[key]} + + {this.state.schemaContent[key]} ) } if(description === 'h2'){ return ( - - {this.state.schemaContent[key]} + + {this.state.schemaContent[key]} + + ) + } + if(description === 'h3'){ + return ( + + {this.state.schemaContent[key]} + + ) + } + if(description === 'h4'){ + return ( + + {this.state.schemaContent[key]} + + ) + } + if(description === 'h5'){ + return ( + + {this.state.schemaContent[key]} + + ) + } + if(description === 'h6'){ + return ( + + {this.state.schemaContent[key]} ) } else{ return ( - - {this.state.schemaContent[key]} + + {this.state.schemaContent[key]} ) } } + if(type === 'textarea'){ + return ( + + {this.state.schemaContent[key]} + + ) + } if (type === 'media'){ for (var val in this.state.schemaContent[key]){ return } } + if (type === 'fieldset'){ + if(this.state.schemaContent === ''){ + return + } + else{ + return + } + } } render() { + const { classes } = this.props; + 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( - - {this.getContent(this.props.field.key, this.props.type, this.props.field.description)} + + {this.getContent(this.props.field, this.props.field.key, this.props.type, this.props.field.description)} ); } } -export default FlameLinkStructure; \ No newline at end of file +export default withStyles(styles)(FlameLinkStructure); \ No newline at end of file diff --git a/src/keys/marten-application-firebase-adminsdk-zvjmp-c177ac648f.json b/src/keys/marten-application-firebase-adminsdk-zvjmp-c177ac648f.json deleted file mode 100644 index 4b5072b..0000000 --- a/src/keys/marten-application-firebase-adminsdk-zvjmp-c177ac648f.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "service_account", - "project_id": "marten-application", - "private_key_id": "c177ac648f803d7e5e4398e4d7302ea4e6972c79", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDygOhbLLjSDLAd\n9B29umgVUrAn4/a1lGE04j6aQrjbgLa/NjU9u12dRiiOFDLX3QjEWFBcLYrU4Eb9\ncD48TJug+/Nc0nFjFk2GATmzlFnMzOaMCbH844TBX34h0UEgPt+iQh7g3cEH685a\nm0zlDXGOh88POvcTtez8S+2UMU6J+6mNh/ErRli3lTuD4zTGpZA3SyX8Us8aoFaG\njaC7P9T10M5kZWmGZMg6DiywX9xnjWPCI5hp1XE3SkyRQ1vpsA9lCPZPxb5QS2yM\nTYBd4Qh90kbEA0jVPIjIt8JwboFAV9UCuG4SQ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6hnvLKV+l7wYb5zukwxGU\nCfCjs5hlwfLc0HxdXbczE0ps+kUt9X3CsmTD8TfBAoGBAJWU+HjJgSAOQBBy7Akw\nYY0sFrRoGlzZHFudLSloarH8csMVxWmLsz4CET6lMRmJbYipEQd5FKxhkfXJvcEn\nTc7x0+5fyAe3zBW4NgchxjWHFLjCNFX+gy4hZFpCbgSg/5EOgNzfKexqgcZR+nzv\nVjcQAU5jOlcZ6MFpDJJNK30k\n-----END PRIVATE KEY-----\n", - "client_email": "firebase-adminsdk-zvjmp@marten-application.iam.gserviceaccount.com", - "client_id": "100533957773437883097", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-zvjmp%40marten-application.iam.gserviceaccount.com" -} diff --git a/src/pages/Info.js b/src/pages/Info.js index 62edbe0..1642662 100644 --- a/src/pages/Info.js +++ b/src/pages/Info.js @@ -1,17 +1,19 @@ import React, { Component, Fragment } from 'react'; import Typography from '@material-ui/core/Typography'; -import Layout from '../components/Layout'; +import FlameLinkComponentCreations from '../components/FlameLinkComponentCreations'; import flamelinkApp from '../flamelink.js'; class Info extends Component { constructor() { super(); + global.schemaName = 'martenSchemaDemo'; + this.state = { schemaDetails: '', } - flamelinkApp.schemas.getFields('martenSchemaDemo', { fields: [ 'title', 'key', 'type', 'gridColumns', 'description' ] }) + flamelinkApp.schemas.getFields(global.schemaName, { fields: [ 'title', 'key', 'type', 'gridColumns', 'description', 'options' ] }) .then(result => this.setState({ schemaDetails: result })) @@ -27,7 +29,7 @@ class Info extends Component { - +