-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new Button component and prop customization features.
- Loading branch information
Showing
7 changed files
with
118 additions
and
48 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from 'react'; | ||
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; | ||
import { okaidia } from 'react-syntax-highlighter/dist/esm/styles/prism'; | ||
import { completeExampleSnippet } from "./snippets/snippets"; | ||
|
||
import Modali, { useModali } from '../../src'; | ||
import Button from "./Button"; | ||
|
||
const CompleteExample = () => { | ||
const [completeExample, toggleCompleteModal] = useModali({ | ||
animated: true, | ||
title: 'Are you sure?', | ||
message: 'Deleting this user will be permanent.', | ||
buttons: [ | ||
<Modali.Button | ||
label="Cancel" | ||
isStyleCancel | ||
onClick={() => toggleCompleteModal()} | ||
/>, | ||
<Modali.Button | ||
label="Delete" | ||
isStyleDestructive | ||
onClick={() => alert('User deleted!')} | ||
/>, | ||
], | ||
}); | ||
return ( | ||
<div className="row mt-5"> | ||
<div className="col-12"> | ||
<h4> | ||
Complete Example | ||
</h4> | ||
</div> | ||
<div className="col-12 mt-2"> | ||
<Button handleClick={toggleCompleteModal}> | ||
Click me to open a complete modal | ||
</Button> | ||
</div> | ||
<div className="col-12"> | ||
<SyntaxHighlighter language='jsx' style={okaidia}>{completeExampleSnippet}</SyntaxHighlighter> | ||
</div> | ||
<Modali.Modal {...completeExample} /> | ||
</div> | ||
) | ||
}; | ||
export default CompleteExample; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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