-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
branch learninhg - cumulative changes
- Loading branch information
1 parent
4b2bf82
commit f878f4c
Showing
40 changed files
with
4,881 additions
and
4,066 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
Large diffs are not rendered by default.
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
File renamed without changes
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 |
---|---|---|
@@ -1,40 +1,48 @@ | ||
<template> | ||
<router-view /> | ||
<v-fade-transition appear> | ||
<router-view /> | ||
</v-fade-transition> | ||
</template> | ||
|
||
<script> | ||
import { get, call } from 'vuex-pathify'; | ||
import { isEmpty } from 'lodash'; | ||
// import { get, call } from 'vuex-pathify'; | ||
// import { isEmpty } from 'lodash'; | ||
export default { | ||
name: 'BaseApp', | ||
name: 'App', | ||
computed: { | ||
...get('authentication', ['isAccountDisabled', 'profile']), | ||
// ...get('authentication', ['isAccountDisabled', 'profile']), | ||
}, | ||
renderTracked({ key, target, type }) { | ||
console.log('renderTracked:', { key, target, type }); | ||
}, | ||
renderTriggered({ key, target, type }) { | ||
console.log('renderTriggered:', { key, target, type }); | ||
}, | ||
// The authenticated account profile gets real-time updates. | ||
// If the disabled flag shows up, that means that auth is revoked. | ||
// We are reacting to isAccountDisabled Vuex getter and forcing a logout. | ||
watch: { | ||
isAccountDisabled(disabled) { | ||
if (disabled) { | ||
this.logout(); | ||
this.snackbarError('You have been logged out, contact support.'); | ||
} | ||
}, | ||
// watch: { | ||
// isAccountDisabled(disabled) { | ||
// if (disabled) { | ||
// this.logout(); | ||
// this.snackbarError('You have been logged out, contact support.'); | ||
// } | ||
// }, | ||
// If the authenticated account profile is missing | ||
// force a logout. | ||
profile(profile) { | ||
if (isEmpty(profile)) { | ||
this.logout(); | ||
} | ||
}, | ||
}, | ||
// // If the authenticated account profile is missing | ||
// // force a logout. | ||
// // profile(profile) { | ||
// // if (isEmpty(profile)) { | ||
// // this.logout(); | ||
// // } | ||
// // }, | ||
// }, | ||
methods: { | ||
...call('snackbar', ['snackbarError']), | ||
...call('authentication', ['logout']), | ||
}, | ||
// methods: { | ||
// ...call('snackbar', ['snackbarError']), | ||
// ...call('authentication', ['logout']), | ||
// }, | ||
}; | ||
</script> |
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,90 @@ | ||
<template> | ||
<transition name="fade"> | ||
<svg v-if="show" class="go-to-top" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 49.484 28.284" @click="scrollToTop"> | ||
<g transform="translate(-229 -126.358)"> | ||
<rect fill="currentColor" width="35" height="5" rx="2" transform="translate(229 151.107) rotate(-45)" /> | ||
<rect fill="currentColor" width="35" height="5" rx="2" transform="translate(274.949 154.642) rotate(-135)" /> | ||
</g> | ||
</svg> | ||
</transition> | ||
</template> | ||
|
||
<script> | ||
import debounce from 'lodash.debounce'; | ||
export default { | ||
name: 'BaseBackToTop', | ||
props: { | ||
threshold: { | ||
type: Number, | ||
default: 50, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
scrollTop: null, | ||
}; | ||
}, | ||
computed: { | ||
show() { | ||
return this.scrollTop > this.threshold; | ||
}, | ||
}, | ||
mounted() { | ||
this.scrollTop = this.getScrollTop(); | ||
window.addEventListener( | ||
'scroll', | ||
debounce(() => { | ||
this.scrollTop = this.getScrollTop(); | ||
}, 100), | ||
); | ||
}, | ||
methods: { | ||
getScrollTop() { | ||
return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; | ||
}, | ||
scrollToTop() { | ||
window.scrollTo({ top: 0, behavior: 'smooth' }); | ||
this.scrollTop = 0; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.go-to-top { | ||
cursor: pointer; | ||
position: fixed; | ||
bottom: 2rem; | ||
right: 2.5rem; | ||
width: 2rem; | ||
color: red; | ||
z-index: 1; | ||
} | ||
.go-to-top:hover { | ||
color: lighten(red, 30%); | ||
} | ||
@media (max-width: 959px) { | ||
.go-to-top { | ||
display: none; | ||
} | ||
} | ||
.fade-enter-active, | ||
.fade-leave-active { | ||
transition: opacity 0.3s; | ||
} | ||
.fade-enter, | ||
.fade-leave-to { | ||
opacity: 0; | ||
} | ||
</style> |
Oops, something went wrong.