This file contains hidden or 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
| <Grid Alignment="Center" CellSpacing="10" > | |
| <Each Count="5"> | |
| <Text Value="This is a Fruit list"/> | |
| </Each> | |
| </Grid> |
This file contains hidden or 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
| Fruits: [ | |
| { | |
| type: "Apple", | |
| subtypes: [ | |
| "GrannySmith", | |
| "Crab", | |
| "Red", | |
| "Toffee" | |
| ] | |
| }, |
This file contains hidden or 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
| var express = require('express') | |
| var fetch = require('isomorphic-fetch') | |
| const FigmaAPIKey = 'mysecretkey' | |
| const FigmaFileID = 'VAyAHaZn1tHmjOFK79pbnMTj' | |
| async function figmaFileFetch(fileId){ | |
| let result = await fetch('https://api.figma.com/v1/files/' + fileId , { | |
| method: 'GET', | |
| headers: { |
This file contains hidden or 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
| app.use('/', async function (req, res, next) { | |
| let result = await figmaFileFetch(FigmaFileID).catch(error => console.log(error)) | |
| res.send(JSON.stringify(result)) | |
| }) | |
| app.listen(3001, console.log("Holy shit, I'm a server and I am listening on port 3001")) |
This file contains hidden or 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
| async function figmaFileFetch(fileId){ | |
| let result = await fetch('https://api.figma.com/v1/files/' + fileId , { | |
| method: 'GET', | |
| headers: { | |
| 'X-Figma-Token': FigmaAPIKey | |
| } | |
| }) | |
| let figmaFileStruct = await result.json() | |
This file contains hidden or 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
| async function figmaFileFetch(fileId){ | |
| let result = await fetch('https://api.figma.com/v1/files/' + fileId , { | |
| method: 'GET', | |
| headers: { | |
| 'X-Figma-Token': FigmaAPIKey | |
| } | |
| }) | |
| let figmaFileStruct = await result.json() |
This file contains hidden or 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
| app.use('/frames', async function (req, res, next) { | |
| let result = await figmaFileFetch(FigmaFileID).catch(error => console.log(error)) | |
| res.send(result) | |
| }) |
This file contains hidden or 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
| class App extends Component { | |
| state = { images: [ | |
| { name: '', url:'' } | |
| ]} | |
| render() { | |
| return ( | |
| ); | |
| } |
This file contains hidden or 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
| class App extends Component { | |
| state = { images: [ | |
| { name: '', url:'' } | |
| ]} | |
| render() { | |
| return ( | |
| <div className="App" > | |
| {this.state.images.map( //1 | |
| (frame,i) => |
This file contains hidden or 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
| class App extends Component { | |
| state = { images: [ | |
| { name: '', url:'' } | |
| ]} | |
| componentDidMount() {//1 | |
| fetch('/frames')//2 | |
| .then(res => res.json())//3 | |
| .then(data => this.setState({ images: data }))//4 | |
| .catch(error => console.log(error)); |