@bynder/compact-view
    TypeScript icon, indicating that this package has built-in type declarations

    2.5.0 • Public • Published

    Bynder Compact View React Component

    Usage example

    import * as React from 'react';
    import * as ReactDOM from 'react-dom';
    import { CompactView, Modal, Login } from '@bynder/compact-view';
    const assetFieldSelection = `
      name
      url
      originalUrl
      derivatives {
        thumbnail
        webImage
      }
      ... on Video {
        previewUrls
      }
    `;
    class App extends React.Component {
    	constructor(props) {
    		super(props);
    		this.state = { isOpen: false };
    	}
    	onSuccess(assets) {
    		console.log(assets);
    	}
    	render() {
    		return (
    			<>
    				<button onClick={() => this.setState({ isOpen: true })}>Open Compact View</button>
    				<Modal isOpen={this.state.isOpen} onClose={() => this.setState({ isOpen: false })}>
    					<Login>
    						<CompactView
    							language="en_US"
    							onSuccess={this.onSuccess}
    							assetFieldSelection={assetFieldSelection}
    						/>
    					</Login>
    				</Modal>
    			</>
    		);
    	}
    }
    ReactDOM.render(<App />, document.getElementById('app'));

    Keywords

    none

    Install

    npm i @bynder/compact-view

    DownloadsWeekly Downloads

    234

    Version

    2.5.0

    License

    UNLICENSED

    Unpacked Size

    536 kB

    Total Files

    7

    Last publish

    Collaborators

    • devops-bynder
    • elseee
    • guilhermescp
    • crokker
    • wouterbynder
    • insitus
    • roald.bankras
    • betacar