-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '61-content-component-profile-view' into 81-create-featu…
…re-component
- Loading branch information
Showing
7 changed files
with
66 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<script lang="ts" setup> | ||
interface Props { | ||
params: TextWindowItem["params"]; | ||
} | ||
const props = defineProps<Props>(); | ||
const { params } = toRefs(props); | ||
const { data, isPending, isPlaceholderData } = useProfileById(params); | ||
const openNewWindowFromAnchor = useAnchorClickHandler(); | ||
const isLoading = computed(() => { | ||
return isPending.value || isPlaceholderData.value; | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div | ||
class="relative isolate grid h-full w-full overflow-auto" | ||
:class="{ 'opacity-50 grayscale': isLoading }" | ||
> | ||
<!-- eslint-disable-next-line vue/no-v-html, vuejs-accessibility/click-events-have-key-events, vuejs-accessibility/no-static-element-interactions --> | ||
<div v-if="data" class="prose max-w-3xl p-8" @click="openNewWindowFromAnchor" v-html="data" /> | ||
|
||
<Centered v-if="isLoading"> | ||
<LoadingIndicator /> | ||
</Centered> | ||
</div> | ||
</template> | ||
|
||
<style> | ||
/* stylelint-disable-next-line selector-class-pattern */ | ||
.tbHeader { | ||
margin: 0; | ||
} | ||
</style> |
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
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,16 @@ | ||
import { useQuery } from "@tanstack/vue-query"; | ||
|
||
export function useProfileById(params: MaybeRef<{ id: string }>, options?: { enabled?: boolean }) { | ||
const api = useApiClient(); | ||
|
||
return useQuery({ | ||
enabled: options?.enabled, | ||
queryKey: ["get-profile-by-id", params] as const, | ||
async queryFn({ queryKey: [, params] }) { | ||
const response = await api.vicav.getProfile(params, { | ||
headers: { accept: "application/xml" }, | ||
}); | ||
return response.text(); | ||
}, | ||
}); | ||
} |
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