Use same path for public and internal "about" pages

This commit is contained in:
silverpill 2022-09-18 22:41:11 +00:00
parent 3a78b0070b
commit 66b1d4f799
5 changed files with 18 additions and 33 deletions

View file

@ -2,7 +2,7 @@
<div class="instance-info" v-if="instance"> <div class="instance-info" v-if="instance">
<h1 class="instance-title">{{ instance.title }}</h1> <h1 class="instance-title">{{ instance.title }}</h1>
<div class="instance-description">{{ instance.short_description }}</div> <div class="instance-description">{{ instance.short_description }}</div>
<router-link class="btn" :to="{ name: 'about-public' }">Learn more</router-link> <router-link class="btn" :to="{ name: 'about' }">Learn more</router-link>
</div> </div>
</template> </template>

View file

@ -1,7 +1,6 @@
import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router" import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router"
import AboutPage from "@/views/About.vue" import AboutPage from "@/views/About.vue"
import AboutPublicPage from "@/views/AboutPublic.vue"
import HomeTimeline from "@/views/HomeTimeline.vue" import HomeTimeline from "@/views/HomeTimeline.vue"
import LandingPage from "../views/LandingPage.vue" import LandingPage from "../views/LandingPage.vue"
import NotificationList from "../views/NotificationList.vue" import NotificationList from "../views/NotificationList.vue"
@ -43,10 +42,10 @@ const routes: Array<RouteRecordRaw> = [
meta: { onlyGuest: true }, meta: { onlyGuest: true },
}, },
{ {
path: "/about-public", path: "/about",
name: "about-public", name: "about",
component: AboutPublicPage, component: AboutPage,
meta: { onlyGuest: true }, meta: { },
}, },
{ {
path: "/ethereum", path: "/ethereum",
@ -54,12 +53,6 @@ const routes: Array<RouteRecordRaw> = [
component: EthereumPage, component: EthereumPage,
meta: { onlyGuest: true }, meta: { onlyGuest: true },
}, },
{
path: "/about",
name: "about",
component: AboutPage,
meta: { onlyAuthenticated: true },
},
{ {
path: "/home", path: "/home",
name: "home", name: "home",

View file

@ -1,26 +1,36 @@
<template> <template>
<sidebar-layout> <sidebar-layout v-if="currentUser">
<template #content v-if="instance"> <template #content v-if="instance">
<h1>{{ instance.title }}</h1> <h1>{{ instance.title }}</h1>
<div class="description static-text" v-html="renderMarkdown(instance.description)"></div> <div class="description static-text" v-html="renderMarkdown(instance.description)"></div>
</template> </template>
</sidebar-layout> </sidebar-layout>
<static-page v-else-if="currentUser === null && instance" class="wide">
<template #heading>{{ instance.title }}</template>
<template #text>
<div v-html="renderMarkdown(instance.description)"></div>
</template>
</static-page>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { $ } from "vue/macros" import { $ } from "vue/macros"
import SidebarLayout from "@/components/SidebarLayout.vue" import SidebarLayout from "@/components/SidebarLayout.vue"
import StaticPage from "@/components/StaticPage.vue"
import { useCurrentUser } from "@/store/user"
import { useInstanceInfo } from "@/store/instance" import { useInstanceInfo } from "@/store/instance"
import { renderMarkdown } from "@/utils/markdown" import { renderMarkdown } from "@/utils/markdown"
const { currentUser } = $(useCurrentUser())
const { instance } = $(useInstanceInfo()) const { instance } = $(useInstanceInfo())
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import "../styles/layout"; @import "../styles/layout";
.description { /* Internal page */
.content .description {
font-size: 18px; font-size: 18px;
font-weight: lighter; font-weight: lighter;
line-height: 2; line-height: 2;

View file

@ -1,18 +0,0 @@
<template>
<static-page v-if="instance" class="wide">
<template #heading>{{ instance.title }}</template>
<template #text>
<div v-html="renderMarkdown(instance.description)"></div>
</template>
</static-page>
</template>
<script setup lang="ts">
import { $ } from "vue/macros"
import StaticPage from "@/components/StaticPage.vue"
import { useInstanceInfo } from "@/store/instance"
import { renderMarkdown } from "@/utils/markdown"
const { instance } = $(useInstanceInfo())
</script>

View file

@ -6,7 +6,7 @@
<div class="instance-description"> <div class="instance-description">
{{ instance.short_description }} {{ instance.short_description }}
<br> <br>
<router-link :to="{name: 'about-public'}">Learn more <span class="arrow">&gt;&gt;</span></router-link> <router-link :to="{ name: 'about' }">Learn more <span class="arrow">&gt;&gt;</span></router-link>
</div> </div>
</div> </div>
<form v-if="instance" class="login-form"> <form v-if="instance" class="login-form">