Skip to content

Commit babd2ed

Browse files
authored
Merge pull request #264 from traPtitech/feat/update_iconify
iconify周りをupdate
2 parents afc3a50 + 8dde9a1 commit babd2ed

File tree

12 files changed

+87
-310
lines changed

12 files changed

+87
-310
lines changed

package-lock.json

Lines changed: 58 additions & 283 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"start-mock": "prism mock -p 4010 -d https://raw.githubusercontent.com/traPtitech/traPortfolio/main/docs/swagger/traPortfolio.v1.yaml"
1616
},
1717
"dependencies": {
18-
"@iconify/iconify": "^3.1.1",
1918
"autosize": "^6.0.1",
2019
"axios": "^1.6.8",
2120
"pinia": "^2.1.7",
@@ -26,7 +25,7 @@
2625
"vue-toastification": "^2.0.0-rc.5"
2726
},
2827
"devDependencies": {
29-
"@iconify/json": "^2.2.224",
28+
"@iconify/vue": "^4.1.2",
3029
"@stoplight/prism-cli": "^5.8.1",
3130
"@types/autosize": "^4.0.3",
3231
"@types/jest": "^29.5.12",
@@ -45,7 +44,6 @@
4544
"ts-morph": "^23.0.0",
4645
"typescript": "^5.5.3",
4746
"vite": "^5.3.2",
48-
"vite-plugin-purge-icons": "^0.10.0",
4947
"vitest": "^1.6.0",
5048
"vue-tsc": "2.0.24"
5149
},

src/assets/AtCoder.png

92.9 KB
Loading

src/assets/AtCoder.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/components/UI/FormInput.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ const handleInput = (event: Event) => {
3333

3434
<template>
3535
<div :class="$style.container" :data-has-anchor="props.hasAnchor">
36-
<div v-if="typeof props.icon !== 'undefined'" :class="$style.iconContainer">
37-
<icon :name="`mdi:${props.icon}`" :icon="$style.icon" />
36+
<div v-if="props.icon !== undefined" :class="$style.iconContainer">
37+
<icon :name="`mdi:${props.icon}`" />
3838
</div>
3939
<input
4040
:class="$style.input"

src/components/UI/Icon.vue

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
<script lang="ts" setup>
2-
import { computed } from 'vue'
2+
import { Icon } from '@iconify/vue'
33
44
interface Props {
55
name: string
66
size?: number
77
}
8-
const props = withDefaults(defineProps<Props>(), { size: 24 })
9-
10-
const styles = computed(() => ({
11-
height: `${props.size}px`,
12-
width: `${props.size}px`
13-
}))
8+
withDefaults(defineProps<Props>(), { size: 24 })
149
</script>
1510

1611
<template>
17-
<span
18-
class="iconify"
19-
:data-icon="name"
20-
:style="styles"
21-
:class="$style.icon"
22-
/>
12+
<icon :icon="name" :height="size" :width="size" :class="$style.icon" />
2313
</template>
2414

2515
<style lang="scss" module>

src/components/User/UserAccounts.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@ const shownServices = computed((): Service[] =>
3939
:class="$style.anchor"
4040
:data-has-account="service.url !== null"
4141
>
42-
<icon :name="service.icon" :class="$style.icon" />
42+
<img
43+
v-if="service.notIcon"
44+
:alt="service.name"
45+
:src="service.icon"
46+
:class="$style.icon"
47+
width="24"
48+
height="24"
49+
/>
50+
<icon v-else :name="service.icon" :class="$style.icon" />
4351
</a>
4452
</div>
4553
</template>

src/consts/services.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { deepFreeze } from '/@/lib/deepFreeze'
22
import { AccountType } from '/@/lib/apis'
3+
import AtCoder from '/@/assets/AtCoder.png'
34

45
export interface Service<Type extends AccountType = AccountType> {
56
icon: string
67
type: Type
8+
notIcon?: boolean
79
}
810

911
export interface ServiceWithName<Type extends AccountType = AccountType>
@@ -66,8 +68,9 @@ export const services = deepFreeze({
6668
type: AccountType.zenn
6769
},
6870
AtCoder: {
69-
icon: 'atcoder', //アイコンは保留
70-
type: AccountType.atcoder
71+
icon: AtCoder,
72+
type: AccountType.atcoder,
73+
notIcon: true
7174
},
7275
SoundCloud: {
7376
icon: 'mdi:soundcloud',

src/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import Toast, { POSITION } from 'vue-toastification'
77
import 'vue-toastification/dist/index.css'
88

99
import './index.scss'
10-
import '@purge-icons/generated'
1110

1211
const pinia = createPinia()
1312
const app = createApp(App)

src/types/shims-png.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.png' {
2+
const content: string
3+
export default content
4+
}

0 commit comments

Comments
 (0)