-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Toast Add & Update import path (#1828)
* fix(page): prettier code indentation fix * fix(bottomSheet): improve user experience * fix(bottom-sheet): bottom sheet component add * fix(+page): integrate bottom sheet * feat(pageCss): css for page route * feat(icons): icon add * fix(bottom-sheet): width fix * feat(more): stacked card UI * feat(images): lock icons add * feat(+page): symbolLayer add to display lockIcons, more layer color add * feat(icons): layer, legend icon add * feat(clickOutside): handle outside click function add * fix(+page): integrate legend and layer-switcher * feat(legend): legend UI slice * feat(layer-switcher): component for layer switcher * feat(close): icon add * fix(+page): task actions modal add * fix(+page): only show modal if status ready or locked for mapping * feat(icons): icon add * feat(tiptap): tiptap rich text editor package add * feat(editor): tiptap rich text editor add * fix(bottom-sheet): fix css * feat(more): implement text editor on comment section * fix(+page): more section add * feat(button): button css define * fix(button): btn classes add for styling * feat(icons): icons add * fix(+page): icon add to task action btns * fix(+page): change selected task boundary color on task select * feat(asset): location image add * feat(image): replace locationDot image * feat(geolocate): icon add * feat(getDeviceRotation): device orientation track function * feat(+page): geolocation with device orientation functionality add * fix(viteConfig): alias store path * fix(icon): icon add * feat(toast): reusable toast component add * feat(layout): add toast component to the main * feat(commonStore): create writable store to display toast * fix(toast): show toast for 4 sec * fix(+page): show toast if browser firefox or safari * feat(viteConfig): add path aliases * fix(+page): replace relative paths with absolute paths
- Loading branch information
Showing
8 changed files
with
77 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<script lang="ts"> | ||
import { setAlert } from '$store/common'; | ||
let alertRef; | ||
let alertInfo; | ||
setAlert.subscribe((value) => { | ||
if (!value?.message) return; | ||
alertInfo = value; | ||
alertRef?.toast(); | ||
}); | ||
const iconName = { | ||
default: 'info-circle', | ||
success: 'check', | ||
warning: 'exclamation-triangle', | ||
danger: 'exclamation-octagon', | ||
}; | ||
// map with variant because red color for error/danger is not red color i.e. primary is associated with red color (due to HOT theme) | ||
const variantMap = { | ||
default: 'default', | ||
success: 'success', | ||
warning: 'warning', | ||
danger: 'primary', | ||
}; | ||
</script> | ||
|
||
<div> | ||
<sl-alert bind:this={alertRef} variant={variantMap?.[alertInfo?.variant]} duration="4000" closable> | ||
<sl-icon slot="icon" name={iconName?.[alertInfo?.variant]}></sl-icon> | ||
{alertInfo?.message} | ||
</sl-alert> | ||
</div> | ||
|
||
<style> | ||
.alert-duration sl-alert { | ||
margin-top: var(--sl-spacing-medium); | ||
} | ||
</style> |
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,6 @@ | ||
import { writable } from 'svelte/store'; | ||
|
||
export const setAlert = writable({ | ||
variant: '', | ||
message: '', | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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