Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat: update citation text #169

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 34 additions & 7 deletions components/side/CitationViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,46 @@ onMounted(() => {
<n-flex vertical :size="[0, 0]">
<h3 class="mb-3">Citation</h3>

<p class="pb-1 text-sm font-medium">
<p class="hidden pb-1 text-sm font-medium">
When using this resource, please cite:
</p>

<!-- TODO: Remove this when we have a better way to handle this -->
<p v-if="id === '1'" class="pb-1 text-sm">
When using this resource, please follow the citation instructions
provided at
<NuxtLink
href="https://docs.aireadi.org/docs/1/citation"
target="_blank"
class="underline transition-all hover:text-slate-600"
>
https://docs.aireadi.org/docs/1/citation
</NuxtLink>
</p>

<!-- TODO: Remove this when we have a better way to handle this -->
<p v-if="id === '2'" class="pb-1 text-sm">
When using this resource, please follow the citation instructions
provided at
<NuxtLink
href="https://docs.aireadi.org/docs/2/citation"
target="_blank"
class="underline transition-all hover:text-slate-600"
>
https://docs.aireadi.org/docs/2/citation
</NuxtLink>
</p>

<TransitionFade>
<div v-if="citationPending" class="py-2">
<div v-if="citationPending" class="hidden py-2">
<n-skeleton text style="width: 80%" />

<n-skeleton text />

<n-skeleton text style="width: 60%" />
</div>

<div v-else class="py-2">
<div v-else class="hidden py-2">
<n-alert v-if="citationError" type="error">
Something went wrong with generating the citation. Please try again
later.
Expand All @@ -119,13 +145,13 @@ onMounted(() => {
</div>
</TransitionFade>

<n-flex align="center" justify="space-between">
<n-flex align="center" justify="space-between" class="hidden">
<n-select
v-model:value="citationFormat"
size="small"
:options="citationFormats"
:consistent-menu-width="false"
class="w-max"
class="hidden w-max"
:loading="citationPending"
:disabled="citationPending"
@update:value="getFormattedCitation"
Expand All @@ -135,6 +161,7 @@ onMounted(() => {
quaternary
type="info"
size="large"
class="hidden"
@click="copyToClipboard(citation?.formattedText)"
>
<template #icon>
Expand All @@ -143,9 +170,9 @@ onMounted(() => {
</n-button>
</n-flex>

<n-divider />
<n-divider class="hidden" />

<n-alert type="warning" :bordered="false">
<n-alert type="warning" :bordered="false" class="hidden">
There maybe other required citations when using this dataset. Please
check the license and other resources associated with the dataset for
more information.
Expand Down
Loading
Loading