diff --git a/src/hooks/useGitHubContent.hook.ts b/src/hooks/useGitHubContent.hook.ts index 61a12bd..cd47b53 100644 --- a/src/hooks/useGitHubContent.hook.ts +++ b/src/hooks/useGitHubContent.hook.ts @@ -33,11 +33,11 @@ export const useGitHubContent = ({ } ) - confirmMessage('Note saved') + confirmMessage('✅ Note saved') return response?.data.content?.sha ?? null } catch (error) { - errorMessage('Note could not be saved') + errorMessage('❌ Note could not be saved') console.warn(error) } diff --git a/src/hooks/useGitHubLogin.hook.ts b/src/hooks/useGitHubLogin.hook.ts index 63b1fbb..19dbf13 100644 --- a/src/hooks/useGitHubLogin.hook.ts +++ b/src/hooks/useGitHubLogin.hook.ts @@ -19,7 +19,7 @@ const saveCredentials = async (token: GithubToken): Promise => { const accessToken = await saveAccessToken(token) await saveAccessTokenToLocal() - confirmMessage(`${accessToken.username} is logged in!`) + confirmMessage(`✅ ${accessToken.username} is logged in!`) } export const useGitHubLogin = () => { diff --git a/src/main.ts b/src/main.ts index 59cff79..0db387f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,5 @@ -import './styles/app.css' import 'notyf/notyf.min.css' +import './styles/app.css' import { createPinia } from 'pinia' import { createApp } from 'vue' diff --git a/src/modules/note/components/CacheAllNote.vue b/src/modules/note/components/CacheAllNote.vue index e9f6cb5..b4ba65c 100644 --- a/src/modules/note/components/CacheAllNote.vue +++ b/src/modules/note/components/CacheAllNote.vue @@ -1,12 +1,14 @@ diff --git a/src/styles/app.css b/src/styles/app.css index 4f9fc9e..b808915 100644 --- a/src/styles/app.css +++ b/src/styles/app.css @@ -60,9 +60,13 @@ a { } } -.notif-success { - background-color: oklch(var(--a)); - color: oklch(var(--ac)); +.notyf__wrapper { + padding-top: 0; + padding-bottom: 0; +} + +.alert { + max-width: 500px; } .repo-note { diff --git a/src/utils/notif.ts b/src/utils/notif.ts index 4845e66..a056d16 100644 --- a/src/utils/notif.ts +++ b/src/utils/notif.ts @@ -3,8 +3,12 @@ import { Notyf } from 'notyf' const notif = new Notyf({ types: [ { - className: 'notif-success', + className: 'prose alert alert-success', type: 'confirm' + }, + { + className: 'prose alert alert-error', + type: 'error' } ] }) @@ -15,4 +19,5 @@ export const confirmMessage = (message: string) => message }) -export const errorMessage = (message: string) => notif.error(message) +export const errorMessage = (message: string) => + notif.open({ type: 'error', message })