Skip to content

Commit

Permalink
fix: copy icon position
Browse files Browse the repository at this point in the history
Signed-off-by: ZTL-UwU <zhangtianli2006@163.com>
  • Loading branch information
ZTL-UwU committed Aug 3, 2024
1 parent fbdcd69 commit c8426d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
30 changes: 14 additions & 16 deletions components/content/CodeCopy.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<template>
<span>
<Transition name="fade" mode="out-in">
<Icon
v-if="copied === false"
name="lucide:copy"
class="self-center cursor-pointer text-muted-foreground hover:text-primary"
@click="handleClick"
/>
<Icon
v-else
ref="checkIconRef"
name="lucide:check"
class="self-center cursor-pointer text-muted-foreground hover:text-primary"
/>
</Transition>
</span>
<Transition name="fade" mode="out-in">
<Icon
v-if="copied === false"
name="lucide:copy"
class="block self-center cursor-pointer text-muted-foreground hover:text-primary"
@click="handleClick"
/>
<Icon
v-else
ref="checkIconRef"
name="lucide:check"
class="block self-center cursor-pointer text-muted-foreground hover:text-primary"
/>
</Transition>
</template>

<script setup lang="ts">
Expand Down
4 changes: 1 addition & 3 deletions components/content/ProseCode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
<div v-if="!inGroup && filename" class="p-3 border-b flex text-sm font-mono">
<Icon v-if="icon" :name="icon" class="self-center mr-1.5" />
{{ filename }}
<span class="ml-auto mr-1">
<CodeCopy :code="code" />
</span>
<CodeCopy :code="code" class="ml-auto mr-1" />
</div>
<UiScrollArea>
<div
Expand Down

0 comments on commit c8426d8

Please sign in to comment.