Skip to content

Commit

Permalink
fix: link -d
Browse files Browse the repository at this point in the history
  • Loading branch information
arpowers committed Apr 11, 2024
1 parent dec321f commit edd52cf
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 27 deletions.
8 changes: 7 additions & 1 deletion @fiction/core/plugin-router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ export class FictionRouter<
this.router.value = vueRouter.createRouter({
history,
routes: this.vueRoutes.value,
scrollBehavior: (to, from, savedPosition) => savedPosition || (to.hash ? { selector: to.hash, behavior: 'smooth' } : { top: 0 }),
scrollBehavior(to, from, savedPosition) {
if (to.hash)
return { el: to.hash, behavior: 'smooth' }
else if (savedPosition)
return savedPosition
else return { top: 0 }
},
})

// Define router hooks directly here if they're not too complex
Expand Down
7 changes: 7 additions & 0 deletions @fiction/core/types/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ export interface NavItem {
target?: string
}

export interface NavItemGroup {
title?: string
key?: string
items: NavItem[] | readonly NavItem[]
class?: string
}

export interface NavGroup {
title?: string
key?: string
Expand Down
24 changes: 11 additions & 13 deletions @fiction/themes/fiction/el/ElFooter.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<script lang="ts" setup>
import type { MediaDisplayObject, MenuGroup, NavItem } from '@fiction/core'
import { vue } from '@fiction/core'
import type { MediaDisplayObject, MenuGroup, NavItem, NavItemGroup } from '@fiction/core'
import { getNavComponentType, vue } from '@fiction/core'
import type { Card } from '@fiction/site/card'
import ElImage from '@fiction/ui/ElImage.vue'
import CardSocials from '@fiction/cards/el/CardSocials.vue'
import ElNavLink from '@fiction/ui/ElNavLink.vue'
export type UserConfig = {
icon?: MediaDisplayObject
menus?: MenuGroup[]
menus?: NavItemGroup[]
socials?: NavItem[]
footerText?: string
privacyPolicy?: string
Expand Down Expand Up @@ -47,24 +48,21 @@ const footer = [
class="col-span-12 sm:col-span-3"
>
<h3
v-if="col.groupName"
v-if="col.title"
class="mb-3 md:mb-6 text-left font-sans text-xs text-theme-500 dark:text-theme-500 font-medium uppercase tracking-widest"
>
{{ col.groupName }}
{{ col.title }}
</h3>
<ul v-if="col.menu" :class="col.class ? col.class : 'space-y-3'">
<ul v-if="col.items" :class="col.class ? col.class : 'space-y-3'">
<li
v-for="(item, ii) in col.menu"
v-for="(item, ii) in col.items"
:key="ii"
class="text-left"
>
<a
:href="item.href"
:target="item.target ? item.target : '_self'"
<ElNavLink
:item="item"
class="hover:text-primary-500 text-theme-800 dark:text-theme-50 dark:hover:text-theme-300 font-sans text-sm font-semibold"
>
{{ item.name }}
</a>
/>
</li>
</ul>
</div>
Expand Down
14 changes: 7 additions & 7 deletions @fiction/themes/fiction/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,23 @@ export function setup(args: { fictionEnv: FictionEnv, fictionStripe: FictionStri
},
menus: [
{
groupName: 'Pages',
menu: [
title: 'Pages',
items: [
{ href: '/tour', name: 'Tour' },
{ href: '/pricing', name: 'Pricing' },
{ href: '/developer', name: 'Developer' },
],
},
{
groupName: 'Company',
menu: [
title: 'Company',
items: [
{ href: '/about', name: 'About' },
{ href: 'https', name: 'Support' },
{ href: `https://docs.${domain}/resources/support.html`, name: 'Support' },
],
},
{
groupName: 'Resources',
menu: [
title: 'Resources',
items: [
{ href: `https://docs.${domain}`, name: 'Docs' },
{ href: '/app', name: 'Dashboard' },
],
Expand Down
20 changes: 20 additions & 0 deletions @fiction/ui/ElNavLink.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script lang="ts" setup>
import type { NavItem, vue } from '@fiction/core'
import { getNavComponentType } from '@fiction/core'
defineProps({
item: { type: Object as vue.PropType<NavItem>, required: true },
})
</script>

<template>
<component
:is="getNavComponentType(item)"
:href="item.href"
:to="item.href"
:target="item.target ? item.target : '_self'"
class="hover:text-primary-500 text-theme-800 dark:text-theme-50 dark:hover:text-theme-300 font-sans text-sm font-semibold"
>
{{ item.name }}
</component>
</template>
13 changes: 7 additions & 6 deletions docs/resources/support.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@ hero:
tagline: Have a question? Need some guidance? Let's chat.
actions:
- theme: brand
text: Chat with Us
text: Discord Community
link: https://discord.gg/e5wNxdDW8u

features:
- icon: ⭐️
title: Satisfaction Guaranteed
details: We provide a no questions asked satisfaction guarantee to paying customers.

- icon: 🧑‍💻
title: Github Repo
title: Github Discussion / Issues
details: Connect with us on Github to report issues, request features, or contribute to the project.
link: https://www.github.com/fictionco/fiction

- icon: 💬
title: Discord Community
title: Chat on Discord
details: Chat with us or other users in our Discord community.
link: https://discord.gg/e5wNxdDW8u

- icon: ⭐️
title: Satisfaction Guaranteed
details: We provide a no questions asked satisfaction guarantee to paying customers.

---

0 comments on commit edd52cf

Please sign in to comment.