Skip to content

Commit

Permalink
Merge pull request #56 from deriv-com/henry/dtra-1047/snackbar-component
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-deriv committed Apr 15, 2024
2 parents cb80567 + 34b5fc7 commit befafcf
Show file tree
Hide file tree
Showing 7 changed files with 797 additions and 1 deletion.
42 changes: 42 additions & 0 deletions lib/components/Snackbar/SnackbarWrapper.tsx
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>
);
};
Loading

0 comments on commit befafcf

Please sign in to comment.