Skip to content

oallouch/material-ui-dialogs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

material-ui-dialogs

Use

//--------------------- Simple helper functions -------------------//
async function main() {
	await muiDialogs.alert({
		title: 'My title',
		content: 'My message',
		okLabel: 'Ok'
	})
}
main()


//------------------------ with Redux Form -------------------------//
class TestReduxFormDialog extends PureComponent {
	formDialogRef = formDialog => {
		this.formDialog = formDialog;
	}
	
	showForm = async() => {
		const values = await this.formDialog.show();
		// values is null if the dialog was cancelled
		console.log("values", values);
	}
	
	render() {
		return (
			<FlatButton onTouchTap={this.showForm} label="ShowForm"/>
			<ReduxFormDialog
				ref={this.formDialogRef}
				title="Form Title"
			>
				<AnyReduxForm />
			</ReduxFormDialog>
		)
	}
}
// you can use the showForm function directly, but you'll have to provide the Redux store as an argument.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 91.8%
  • HTML 8.2%