mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-02-07 15:28:42 +01:00
refactor: Cage Cards components in molecules according to atomic design
This commit is contained in:
parent
6a8585a0ec
commit
e75e13f043
@ -30,7 +30,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import Toot from './Cards/Toot'
|
||||
import Toot from '~/src/renderer/components/molecules/Toot'
|
||||
import scrollTop from '../../utils/scroll'
|
||||
import reloadable from '~/src/renderer/components/mixins/reloadable'
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import Toot from './Cards/Toot'
|
||||
import Toot from '~/src/renderer/components/molecules/Toot'
|
||||
import scrollTop from '../../utils/scroll'
|
||||
import reloadable from '~/src/renderer/components/mixins/reloadable'
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import Toot from '../Cards/Toot'
|
||||
import Toot from '~/src/renderer/components/molecules/Toot'
|
||||
import scrollTop from '../../../utils/scroll'
|
||||
import reloadable from '~/src/renderer/components/mixins/reloadable'
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import Toot from './Cards/Toot'
|
||||
import Toot from '~/src/renderer/components/molecules/Toot'
|
||||
import scrollTop from '../../utils/scroll'
|
||||
import reloadable from '~/src/renderer/components/mixins/reloadable'
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import User from '../Cards/User'
|
||||
import User from '~/src/renderer/components/molecules/User'
|
||||
|
||||
export default {
|
||||
name: 'edit-list',
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import Toot from '../Cards/Toot'
|
||||
import Toot from '~/src/renderer/components/molecules/Toot'
|
||||
import scrollTop from '../../../utils/scroll'
|
||||
import reloadable from '~/src/renderer/components/mixins/reloadable'
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import Toot from './Cards/Toot'
|
||||
import Toot from '~/src/renderer/components/molecules/Toot'
|
||||
import scrollTop from '../../utils/scroll'
|
||||
import reloadable from '~/src/renderer/components/mixins/reloadable'
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import Notification from './Cards/Notification'
|
||||
import Notification from '~/src/renderer/components/molecules/Notification'
|
||||
import scrollTop from '../../utils/scroll'
|
||||
import reloadable from '~/src/renderer/components/mixins/reloadable'
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import Toot from './Cards/Toot'
|
||||
import Toot from '~/src/renderer/components/molecules/Toot'
|
||||
import scrollTop from '../../utils/scroll'
|
||||
import reloadable from '~/src/renderer/components/mixins/reloadable'
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import User from '../Cards/User'
|
||||
import User from '~/src/renderer/components/molecules/User'
|
||||
|
||||
export default {
|
||||
name: 'search-account',
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import User from '../../Cards/User'
|
||||
import User from '~/src/renderer/components/molecules/User'
|
||||
|
||||
export default {
|
||||
name: 'followers',
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import User from '../../Cards/User'
|
||||
import User from '~/src/renderer/components/molecules/User'
|
||||
|
||||
export default {
|
||||
name: 'follows',
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import Toot from '../../Cards/Toot'
|
||||
import Toot from '~/src/renderer/components/molecules/Toot'
|
||||
|
||||
export default {
|
||||
name: 'timeline',
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import Toot from '../Cards/Toot'
|
||||
import Toot from '~/src/renderer/components/molecules/Toot'
|
||||
|
||||
export default {
|
||||
name: 'toot-detail',
|
||||
|
@ -300,12 +300,12 @@ export default {
|
||||
this.$refs.popper.doClose()
|
||||
},
|
||||
block (message) {
|
||||
this.$store.dispatch('TimelineSpace/Contents/Cards/Toot/block', this.originalMessage(message).account)
|
||||
this.$store.dispatch('molecules/Toot/block', this.originalMessage(message).account)
|
||||
this.$refs.popper.doClose()
|
||||
},
|
||||
changeReblog (message) {
|
||||
if (message.reblogged) {
|
||||
this.$store.dispatch('TimelineSpace/Contents/Cards/Toot/unreblog', message)
|
||||
this.$store.dispatch('molecules/Toot/unreblog', message)
|
||||
.then((data) => {
|
||||
this.$emit('update', data)
|
||||
})
|
||||
@ -316,7 +316,7 @@ export default {
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.$store.dispatch('TimelineSpace/Contents/Cards/Toot/reblog', message)
|
||||
this.$store.dispatch('molecules/Toot/reblog', message)
|
||||
.then((data) => {
|
||||
this.$emit('update', data)
|
||||
})
|
||||
@ -330,7 +330,7 @@ export default {
|
||||
},
|
||||
changeFavourite (message) {
|
||||
if (message.favourited) {
|
||||
this.$store.dispatch('TimelineSpace/Contents/Cards/Toot/removeFavourite', message)
|
||||
this.$store.dispatch('molecules/Toot/removeFavourite', message)
|
||||
.then((data) => {
|
||||
this.$emit('update', data)
|
||||
})
|
||||
@ -341,7 +341,7 @@ export default {
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.$store.dispatch('TimelineSpace/Contents/Cards/Toot/addFavourite', message)
|
||||
this.$store.dispatch('molecules/Toot/addFavourite', message)
|
||||
.then((data) => {
|
||||
this.$emit('update', data)
|
||||
})
|
||||
@ -389,7 +389,7 @@ export default {
|
||||
return this.$store.state.TimelineSpace.account.accountId === this.originalMessage(message).account.id
|
||||
},
|
||||
deleteToot (message) {
|
||||
this.$store.dispatch('TimelineSpace/Contents/Cards/Toot/deleteToot', message)
|
||||
this.$store.dispatch('molecules/Toot/deleteToot', message)
|
||||
.then((message) => {
|
||||
this.$emit('delete', message)
|
||||
})
|
@ -6,7 +6,6 @@ import Local from './Contents/Local'
|
||||
import Public from './Contents/Public'
|
||||
import Search from './Contents/Search'
|
||||
import Lists from './Contents/Lists'
|
||||
import Cards from './Contents/Cards'
|
||||
import Hashtag from './Contents/Hashtag'
|
||||
import DirectMessages from './Contents/DirectMessages'
|
||||
|
||||
@ -22,7 +21,6 @@ const Contents = {
|
||||
Public,
|
||||
Search,
|
||||
Lists,
|
||||
Cards,
|
||||
Hashtag
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +0,0 @@
|
||||
import Toot from './Cards/Toot'
|
||||
|
||||
const Cards = {
|
||||
namespaced: true,
|
||||
modules: {
|
||||
Toot
|
||||
}
|
||||
}
|
||||
|
||||
export default Cards
|
@ -9,6 +9,7 @@ import Authorize from './Authorize'
|
||||
import TimelineSpace from './TimelineSpace'
|
||||
import Preferences from './Preferences'
|
||||
import Settings from './Settings'
|
||||
import molecules from './molecules'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
@ -24,6 +25,7 @@ export default new Vuex.Store({
|
||||
Authorize,
|
||||
TimelineSpace,
|
||||
Preferences,
|
||||
Settings
|
||||
Settings,
|
||||
molecules
|
||||
}
|
||||
})
|
||||
|
8
src/renderer/store/molecules.js
Normal file
8
src/renderer/store/molecules.js
Normal file
@ -0,0 +1,8 @@
|
||||
import Toot from './molecules/Toot'
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
modules: {
|
||||
Toot
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user