-
Notifications
You must be signed in to change notification settings - Fork 19
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 #22 from technikhil314/develop
Develop
- Loading branch information
Showing
12 changed files
with
81 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export default function () { | ||
const cookies = document.cookie.split(';') | ||
const cookieMap: { | ||
isSkipTutorial?: string | ||
} = { | ||
isSkipTutorial: 'false', | ||
} | ||
cookies.forEach((element) => { | ||
const [name, val] = element.split('=') | ||
const trimmedName = name.trim() | ||
if (trimmedName === 'isSkipTutorial') { | ||
cookieMap[trimmedName] = val | ||
} | ||
}) | ||
return cookieMap.isSkipTutorial === 'true' | ||
} |
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 |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
<div class="page-root"> | ||
<Toast /> | ||
<Nuxt /> | ||
<Footer /> | ||
</div> | ||
</template> |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
10 changes: 8 additions & 2 deletions
10
plugins/fart-remover.client.ts → plugins/cookie-injector.client.ts
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 |
---|---|---|
@@ -1,32 +1,38 @@ | ||
import { Plugin } from '@nuxt/types' | ||
import isDarkModeCookie from '~/helpers/isDarkModeCookie' | ||
import isSkipTutorialCookie from '~/helpers/isSkipTutorialCookie' | ||
declare module 'vue/types/vue' { | ||
// this.$isDarkModeinside Vue components | ||
interface Vue { | ||
$isDarkMode: boolean | ||
$isSkipTutorial: boolean | ||
} | ||
} | ||
|
||
declare module '@nuxt/types' { | ||
// nuxtContext.app.$isDarkModeinside asyncData, fetch, plugins, middleware, nuxtServerInit | ||
interface NuxtAppOptions { | ||
$isDarkMode: boolean | ||
$isSkipTutorial: boolean | ||
} | ||
// nuxtContext.isDarkMode$ | ||
interface Context { | ||
$isDarkMode: boolean | ||
$isSkipTutorial: boolean | ||
} | ||
} | ||
|
||
declare module 'vuex/types/index' { | ||
// this.$isDarkModeinside Vuex stores | ||
interface Store<S> { | ||
$isDarkMode: boolean | S | ||
$isSkipTutorial: boolean | S | ||
} | ||
} | ||
|
||
const myPlugin: Plugin = (_context, inject) => { | ||
const cookieInjectorPlugin: Plugin = (_context, inject) => { | ||
inject('isDarkMode', isDarkModeCookie()) | ||
inject('isSkipTutorial', isSkipTutorialCookie()) | ||
} | ||
|
||
export default myPlugin | ||
export default cookieInjectorPlugin |
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
8c75372
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
offline-diff-viewer – ./
differencer.vercel.app
offline-diff-viewer-technikhil314.vercel.app
differencefinder.vercel.app
diffie.vercel.app
diffchecker.vercel.app
offline-diff-viewer-git-main-technikhil314.vercel.app
offline-diff-viewer.vercel.app
diffviewer.vercel.app
textdiff.vercel.app