Skip to content

Commit

Permalink
[#131] add new event link to the preview-card head
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreezag committed Jun 6, 2024
1 parent d148c11 commit dbe1436
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/shared/ui/icon-svg/icon-svg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,27 @@ defineProps<Props>();
<path d="M12 17v-6" />
<path d="M9.5 14.5l2.5 2.5l2.5 -2.5" />
</svg>

<svg
v-else-if="name === 'window-maximize'"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="icon icon-tabler icons-tabler-outline icon-tabler-window-maximize"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path
d="M3 16m0 1a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-3a1 1 0 0 1 -1 -1z"
/>
<path d="M4 12v-6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-6" />
<path d="M12 8h4v4" />
<path d="M16 8l-5 5" />
</svg>
</div>
</template>

Expand Down
23 changes: 22 additions & 1 deletion src/shared/ui/preview-card/preview-card-header.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import { computed } from "vue";
import type { EventType } from "../../types";
import { EVENT_TYPES, type EventType } from "../../types";
import { IconSvg } from "../icon-svg";
import { DownloadType } from "./types";
Expand Down Expand Up @@ -54,6 +54,12 @@ const lockEvent = () => {
};
const isVisibleTags = computed(() => props.tags.length > 0);
const newPageLink = computed(() => {
if (!Object.values(EVENT_TYPES).includes(props.eventType)) return "";
return `/${props.eventType}/${props.eventId}`;
});
</script>

<template>
Expand All @@ -80,6 +86,16 @@ const isVisibleTags = computed(() => props.tags.length > 0);
{{ tag }}
</div>
</template>

<template v-if="newPageLink">
<NuxtLink
:to="newPageLink"
class="preview-card-header__open"
title="Open event in the new window"
>
<IconSvg name="window-maximize" />
</NuxtLink>
</template>
</div>

<div v-if="isVisibleControls" class="preview-card-header__buttons">
Expand Down Expand Up @@ -216,6 +232,11 @@ $eventTypeColorsMap: (
}
}
.preview-card-header__open {
@apply flex justify-end;
@apply h-4 md:h-5;
}
.preview-card-header__buttons {
@apply flex justify-end;
@apply gap-2 md:gap-3;
Expand Down

0 comments on commit dbe1436

Please sign in to comment.