Skip to content

Commit

Permalink
traPブログへのリンクを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
mehm8128 committed Jun 10, 2024
1 parent 71db581 commit 8d6424f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
17 changes: 13 additions & 4 deletions src/components/User/AccountList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@
import AccountListItem from './AccountListItem.vue'
import { Account } from '/@/lib/apis'
interface Props {
const props = defineProps<{
userName: string
accounts: Account[]
}
defineProps<Props>()
}>()
</script>

<template>
<ul :class="$style.accounts">
<li>
<a
:href="`https://trap.jp/author/${props.userName}`"
target="_blank"
rel="noreferrer noopener"
>
<img src="/@/assets/traP_logo_icon.svg" width="24" height="24" />
</a>
</li>
<account-list-item
v-for="account in accounts"
:key="account.id"
Expand All @@ -23,5 +31,6 @@ defineProps<Props>()
.accounts {
display: flex;
gap: 0.5rem;
list-style: none;
}
</style>
18 changes: 10 additions & 8 deletions src/components/User/AccountListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ defineProps<Props>()
</script>

<template>
<a
:class="$style.link"
:href="account.url"
target="_blank"
rel="noreferrer noopener"
>
<a-icon :name="services.get(account.type)?.icon ?? ''" :size="24" />
</a>
<li>
<a
:class="$style.link"
:href="account.url"
target="_blank"
rel="noreferrer noopener"
>
<a-icon :name="services.get(account.type)?.icon ?? ''" :size="24" />
</a>
</li>
</template>

<style lang="scss" module>
Expand Down
6 changes: 5 additions & 1 deletion src/components/User/UserDetailContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ defineProps<{
{{ userDetail.realName }}
</div> -->
</div>
<account-list v-if="userDetail" :accounts="userDetail.accounts" />
<account-list
v-if="userDetail"
:accounts="userDetail.accounts"
:user-name="userDetail.name"
/>
</div>
</div>
</template>
Expand Down

0 comments on commit 8d6424f

Please sign in to comment.