-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from deriv-com/henry/dtra-1047/snackbar-component
- Loading branch information
Showing
7 changed files
with
797 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { StandalonePlaceholderRegularIcon } from "@deriv/quill-icons/Standalone"; | ||
import { Snackbar } from "."; | ||
import React, { useState } from "react"; | ||
|
||
export const SnackbarWrapper = () => { | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const handleActionClick = () => { | ||
handleClose(); | ||
}; | ||
|
||
const handleOpen = () => { | ||
setIsOpen(true); | ||
}; | ||
|
||
const handleClose = () => { | ||
setTimeout(() => { | ||
setIsOpen(false); | ||
}, 1000); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<button onClick={handleOpen} style={{ color: "white" }}> | ||
Click me | ||
</button> | ||
<Snackbar | ||
icon={ | ||
<StandalonePlaceholderRegularIcon | ||
fill="#ffffff" | ||
iconSize="sm" | ||
/> | ||
} | ||
message="Enter message here" | ||
actionText="Action" | ||
onActionClick={handleActionClick} | ||
isOpen={isOpen} | ||
onClose={handleClose} | ||
/> | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.