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

traPブログへのリンクを追加 #147

Merged
merged 1 commit into from
Jun 11, 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
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" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここでblogだけ別個で実装したのはsvgファイルを別個で用意しているからですかね…?
これで行くとAtCoderのロゴもこういう実装になるんですかね

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そうですね、ここだけ別です
AtCoderも確かに今のままでは無理ですが、AccountListItemコンポーネント自体の実装を修正すれば多分いい感じにsvgにもアイコンにも対応できるようにはできそうです(まだロゴ用意できてなさそうなので今はこのままで)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あ〜、だとするとAtCoderのsvgが用意できた状態でAccountListItemの実装を直す感じになるんですかね…?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そうなりそうですね

</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
Loading