updated homepage with template chossing option (#2165)

This commit is contained in:
Kiran Ashok 2022-02-07 18:50:30 +05:30 committed by GitHub
parent 8c990df18d
commit 5afbf1f0ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 1 deletions

View file

@ -1,4 +1,5 @@
import React from 'react';
import TemplateLibraryModal from './TemplateLibraryModal/';
export const BlankPage = function BlankPage({
createApp,
@ -7,6 +8,9 @@ export const BlankPage = function BlankPage({
handleImportApp,
isImportingApp,
fileInput,
showTemplateLibraryModal,
hideTemplateLibraryModal,
viewTemplateLibraryModal,
}) {
return (
<div>
@ -41,11 +45,20 @@ export const BlankPage = function BlankPage({
<input type="file" ref={fileInput} style={{ display: 'none' }} />
</label>
</a>
<a onClick={viewTemplateLibraryModal} className="btn btn-primary" style={{ marginLeft: '24px' }}>
Choose from template
</a>
</div>
</div>
</div>
</div>
</div>
<TemplateLibraryModal
show={showTemplateLibraryModal}
onHide={hideTemplateLibraryModal}
onCloseButtonClick={hideTemplateLibraryModal}
darkMode={darkMode}
/>
</div>
);
};

View file

@ -424,7 +424,12 @@ class HomePage extends React.Component {
});
};
showTemplateLibraryModal = () => this.setState({ showTemplateLibraryModal: true });
showTemplateLibraryModal = () => {
this.setState({ showTemplateLibraryModal: true });
};
hideTemplateLibraryModal = () => {
this.setState({ showTemplateLibraryModal: false });
};
render() {
const {
@ -541,6 +546,9 @@ class HomePage extends React.Component {
handleImportApp={this.handleImportApp}
creatingApp={creatingApp}
darkMode={this.props.darkMode}
showTemplateLibraryModal={this.state.showTemplateLibraryModal}
viewTemplateLibraryModal={this.showTemplateLibraryModal}
hideTemplateLibraryModal={this.hideTemplateLibraryModal}
/>
)}