-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(domain selector): add SSR fallback
- Loading branch information
1 parent
a7d7462
commit cf27378
Showing
2 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
components/pages/posts/navigation/DomainSelectorFallback.vue
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,49 @@ | ||
<script lang="ts" setup> | ||
import { ChevronUpDownIcon } from '@heroicons/vue/20/solid' | ||
defineOptions({ | ||
inheritAttrs: false | ||
}) | ||
interface DomainSelectorProps { | ||
compact?: boolean | ||
} | ||
const props = defineProps<DomainSelectorProps>() | ||
</script> | ||
|
||
<template> | ||
<div | ||
:class="[props.compact ? 'flex w-auto items-stretch !rounded-full !p-2.5' : 'w-56']" | ||
class="hover:hover-text-util focus-visible:focus-outline-util hover:hover-bg-util relative cursor-default rounded-md bg-transparent py-1.5 pl-3 pr-10 text-left ring-1 ring-inset ring-base-0/20 sm:text-sm sm:leading-6" | ||
v-bind="$attrs" | ||
> | ||
<span class="flex items-center"> | ||
<img | ||
:src="`https://icons.duckduckgo.com/ip2/r34.app.ico`" | ||
alt="Favicon" | ||
class="h-5 w-5 flex-shrink-0 rounded" | ||
height="128" | ||
loading="eager" | ||
width="128" | ||
/> | ||
|
||
<span class="sr-only"> Website to browse: </span> | ||
|
||
<span | ||
v-if="!props.compact" | ||
class="ml-3 block truncate" | ||
> | ||
r34.app | ||
</span> | ||
</span> | ||
|
||
<!-- Chevron --> | ||
<span | ||
v-if="!props.compact" | ||
class="pointer-events-none absolute inset-y-0 right-0 ml-3 flex items-center pr-2" | ||
> | ||
<ChevronUpDownIcon class="h-5 w-5" /> | ||
</span> | ||
</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