-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: space Refactored component props and loop structures in multiple components to improve readability and maintainability. Updated props definitions in Header.vue, Module.vue, and Flow components. Adjusted loop syntax in Index.vue and Module.vue files to enhance consistency and clarity. Removed unused CSS styles from Index.vue and default.vue layouts for better code cleanliness. Updated field naming for consistency in the Space model in prisma/schema.prisma file. * feat(space): add dynamic title to space page Added dynamic title to the space page component using the space's title property. This enhances the user experience by displaying relevant information. * refactor(api): Remove unnecessary code in space endpoint
- Loading branch information
Showing
14 changed files
with
207 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<script setup lang="ts"> | ||
interface Props { | ||
url: string | null | ||
url?: string | null | ||
title: string | ||
id: string | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<script setup lang="ts"> | ||
import type { inferRouterOutputs } from '@trpc/server' | ||
import type { AppRouter } from '@/server/trpc/routers' | ||
type RouterOutput = inferRouterOutputs<AppRouter> | ||
type SpaceOutput = RouterOutput['space']['get'] | ||
type Space = Exclude<SpaceOutput, null> | ||
interface Props { | ||
space: Space | ||
header?: boolean | ||
} | ||
const props = withDefaults(defineProps<Props>(), { | ||
header: true, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="flow"> | ||
<FlowHeader | ||
v-if="props.header" | ||
:id="props.space.id" | ||
:title="props.space.title" | ||
/> | ||
|
||
<div class="flow-body n-grid"> | ||
<NuxtLink | ||
v-for="flow in props.space.flows" | ||
:key="flow.id" | ||
:title="flow.title" | ||
target="_blank" | ||
> | ||
<LazySpaceModule v-bind="{ flow }" /> | ||
</NuxtLink> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<script setup lang="ts"> | ||
import type { inferRouterOutputs } from '@trpc/server' | ||
import type { AppRouter } from '@/server/trpc/routers' | ||
type RouterOutput = inferRouterOutputs<AppRouter> | ||
type FlowOutput = RouterOutput['flow']['get'] | ||
type Flow = Exclude<FlowOutput, null | undefined> | ||
interface Props { | ||
flow: Flow | ||
} | ||
const props = defineProps<Props>() | ||
</script> | ||
|
||
<template> | ||
<div class="module shu-card p-4"> | ||
<div class="px-3 py-2 text-base"> | ||
{{ flow.title }} | ||
</div> | ||
<div class="list-none m-0 p-0"> | ||
<NuxtLink | ||
v-for="module in props.flow.module" | ||
:key="module.id" | ||
:title="module.title" | ||
:href="module.url" | ||
target="_blank" | ||
class="flex flex-row items-center gap-2 hover:bg-gray-100 focus:bg-gray-200 rounded-2xl px-3 py-2 transition duration-300" | ||
> | ||
<LinkIcon | ||
class="w-5 h-5 basis-5" | ||
:width="20" | ||
:url="module.url" | ||
/> | ||
<div class="truncate "> | ||
{{ module.title }} | ||
</div> | ||
</NuxtLink> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<script setup lang="ts"> | ||
const id = useRoute().params.id as string | ||
const { $client } = useNuxtApp() | ||
const space = await $client.space.get.query({ id }) | ||
const config = await useGetConfig() | ||
if (!space) { | ||
throw createError({ | ||
statusCode: 404, | ||
}) | ||
} | ||
defineOgImageComponent('NuxtSeo', { | ||
theme: config.ogTheme, | ||
title: space.title, | ||
description: space.description, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="page"> | ||
<Head> | ||
<Title>{{ space.title }}</Title> | ||
</Head> | ||
<div class="container"> | ||
<PublicProse | ||
v-if="space.description" | ||
:title="space.title" | ||
> | ||
{{ space.description }} | ||
</PublicProse> | ||
<PublicProse | ||
v-else | ||
:title="space.title" | ||
/> | ||
<SpaceFlow v-bind="{ header: false, space }" /> | ||
<template | ||
v-for=" flow in space.flows" | ||
:key="flow.id" | ||
> | ||
<LazyFlow | ||
v-if="flow.module.length > 0" | ||
v-bind="{ flow }" | ||
/> | ||
</template> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.sidebar { | ||
@apply fixed w-0 lg:w-64 bg-white h-full; | ||
} | ||
.content { | ||
@apply lg:pl-72 lg:pr-8; | ||
} | ||
</style> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.