Layout refactor (#150)

* Revert recent commits

* Move things around, and do preparation work for nested page systems.

* Fixed issue on side bar not appearing
This commit is contained in:
Redblueflame
2021-03-31 19:09:18 +02:00
committed by GitHub
parent e80a5d82a4
commit af8fc53704
29 changed files with 100 additions and 152 deletions
+15 -23
View File
@@ -1,5 +1,5 @@
<template>
<DashboardPage>
<div>
<div class="section-header">
<h3 class="column-grow-1">Followed mods</h3>
</div>
@@ -9,18 +9,18 @@
:id="mod.id"
:key="mod.id"
:author="mod.author"
:name="mod.title"
:description="mod.description"
:latest-version="mod.latest_version"
:created-at="mod.published"
:updated-at="mod.updated"
:downloads="mod.downloads.toString()"
:icon-url="mod.icon_url"
:author-url="mod.author_url"
:page-url="mod.page_url"
:categories="mod.categories"
:created-at="mod.published"
:description="mod.description"
:downloads="mod.downloads.toString()"
:edit-mode="true"
:icon-url="mod.icon_url"
:is-modrinth="true"
:latest-version="mod.latest_version"
:name="mod.title"
:page-url="mod.page_url"
:updated-at="mod.updated"
>
<div class="buttons">
<button
@@ -34,27 +34,26 @@
</ModCard>
</div>
<div v-else class="error">
<FollowIllustration class="icon"></FollowIllustration><br />
<FollowIllustration class="icon"></FollowIllustration>
<br />
<span class="text"
>You don't have any followed mods. <br />
Why don't you <nuxt-link to="/mods" class="link">search</nuxt-link> for
Why don't you <nuxt-link class="link" to="/mods">search</nuxt-link> for
new ones?</span
>
</div>
</DashboardPage>
</div>
</template>
<script>
import axios from 'axios'
import DashboardPage from '@/components/wrapper/DashboardPage'
import ModCard from '~/components/ui/ProjectCard'
import FollowIcon from '~/assets/images/utils/heart.svg?inline'
import FollowIllustration from '~/assets/images/illustrations/follow_illustration.svg?inline'
export default {
components: {
DashboardPage,
ModCard,
FollowIcon,
FollowIllustration,
@@ -76,17 +75,9 @@ export default {
},
methods: {
async unfavMod(index) {
const config = {
headers: {
Authorization: this.$auth.getToken('local')
? this.$auth.getToken('local')
: '',
},
}
await axios.delete(
`https://api.modrinth.com/api/v1/mod/${this.mods[index].id}/follow`,
config
this.$auth.headers
)
this.mods.splice(index, 1)
@@ -111,6 +102,7 @@ export default {
margin-left: auto;
padding: 0.5rem;
}
.error {
display: flex;
flex-direction: column;