import React from 'react'
import PropTypes from 'prop-types'
import Head from 'react-helmet'
import { GoogleSheetsApi } from '../../'
import DynamicSpreadsheet from './DynamicSpreadsheet'
import ApiForm from './ApiForm'
import Blob from './Blob'
const SheetsDemo = props => (
{({ authorize, loading: apiLoading, signout, signedIn, error }) => (
{apiLoading ? (
Loading...
) : error ? (
) : signedIn ? (
) : (
)}
{signedIn &&
}
)}
)
SheetsDemo.propTypes = {
clientId: PropTypes.string.isRequired,
apiKey: PropTypes.string.isRequired,
reset: PropTypes.func.isRequired,
}
class App extends React.Component {
state = {
apiKey: 'AIzaSyDS0rsId2YdsGWAgU4xiLm8zS8gf4k9d2Y',
clientId:
'377437361891-v0ib2hve7mupdcpsibtuqr35o2h61op9.apps.googleusercontent.com',
}
handleSubmit = state => this.setState(state)
reset = () => this.setState({ apiKey: '', clientId: '' })
render() {
return (
Google Sheets React Component Demo
Google Sheets API React Component
{this.state.apiKey && (
)}
{this.state.apiKey ? (
) : (
)}
)
}
}
export default App