Make edit button on dashboard more visible and fix edit button on mod page

This commit is contained in:
Prospector 2020-11-30 19:10:17 -08:00
parent 9673922ca1
commit 2c871d1339
3 changed files with 3 additions and 57 deletions

View File

@ -58,10 +58,10 @@
this.$auth.loggedIn &&
members.find((x) => x.user_id === this.$auth.user.id)
"
:to="'/mod/' + mod.id + '/settings'"
:to="'/mod/' + mod.id + '/edit'"
class="tab"
>
Settings
Edit
</nuxt-link>
<div class="filler" />
</div>

View File

@ -95,7 +95,7 @@
</div>
</div>
<div v-if="editMode" class="buttons">
<nuxt-link class="transparent-button column" :to="'/mod/' + id + '/edit'">
<nuxt-link class="button column" :to="'/mod/' + id + '/edit'">
Edit
</nuxt-link>
</div>

View File

@ -1,54 +0,0 @@
<template>
<ModPage :mod="mod" :versions="versions" :members="members"></ModPage>
</template>
<script>
import ModPage from '@/components/ModPage'
import axios from 'axios'
export default {
components: { ModPage },
auth: false,
async asyncData(data) {
let res = await axios.get(
`https://api.modrinth.com/api/v1/mod/${data.params.id}`
)
const mod = res.data
res = await axios.get(
`https://api.modrinth.com/api/v1/team/${mod.team}/members`
)
const members = res.data
for (let i = 0; i < members.length; i++) {
res = await axios.get(
`https://api.modrinth.com/api/v1/user/${members[i].user_id}`
)
members[i].avatar_url = res.data.avatar_url
}
res = await axios.get(mod.body_url)
const versions = []
for (const version of mod.versions) {
try {
res = await axios.get(
`https://api.modrinth.com/api/v1/version/${version}`
)
versions.push(res.data)
} catch {
// eslint-disable-next-line no-console
console.log('Some versions may be missing...')
}
}
return {
mod,
versions,
members,
}
},
}
</script>
<style lang="scss" scoped></style>