-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app/pano):used toast component (#577)
# Description Added Toast component that will be triggered when the Copy Link text in the DropDown Menu is clicked. ### Checklist - [x] discord username: `muhammed-gumus` - [x] Closes <#568> - [x] PR must be created for an issue from issues under "In progress" column from [our project board](https://github.com/orgs/kamp-us/projects/2/views/1). - [x] A descriptive and understandable title: The PR title should clearly describe the nature and purpose of the changes. The PR title should be the first thing displayed when the PR is opened. And it should follow the semantic commit rules, and should include the app/package/service name in the title. For example, a title like "docs(@kampus-apps/pano): Add README.md" can be used. - [ ] Related file selection: Only relevant files should be touched and no other files should be affected. - [ ] I ran `npx turbo run` at the root of the repository, and build was successful. - [ ] I installed the npm packages using `npm install --save-exact <package>` so my package is pinned to a specific npm version. Leave empty if no package was installed. Leave empty if no package was installed with this PR. ### How were these changes tested? Please describe the tests you did to test the changes you made. Please also specify your test configuration. --------- Co-authored-by: Muhammed Gümüş <[email protected]> Co-authored-by: Can Sirin <[email protected]> Co-authored-by: Umut Sirin <[email protected]>
- Loading branch information
1 parent
1e6372f
commit 570f405
Showing
5 changed files
with
54 additions
and
6 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"use client"; | ||
|
||
import { | ||
Toast, | ||
ToastClose, | ||
ToastDescription, | ||
ToastProvider, | ||
ToastTitle, | ||
ToastViewport, | ||
useToast, | ||
} from "@kampus/ui-next"; | ||
|
||
export function Toaster() { | ||
const { toasts } = useToast(); | ||
|
||
return ( | ||
<ToastProvider> | ||
{toasts.map(function ({ id, title, description, action, ...props }) { | ||
return ( | ||
<Toast key={id} {...props}> | ||
<div className="grid gap-1"> | ||
{title && <ToastTitle>{title}</ToastTitle>} | ||
{description && <ToastDescription>{description}</ToastDescription>} | ||
</div> | ||
{action} | ||
<ToastClose /> | ||
</Toast> | ||
); | ||
})} | ||
<ToastViewport /> | ||
</ToastProvider> | ||
); | ||
} |