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

feat: 一部のコンポーネントを chika3742/mhy-material-components で共通化 #169

Merged
merged 20 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
be85616
chore: 共通コンポーネントの依存関係追加
chika3742 Jul 17, 2023
bcf2e0a
feat: CharacterCard, CharacterIconCard コンポーネントの移行
chika3742 Jul 17, 2023
ee2b6ac
refactor: rename versions.ts -> version.ts
chika3742 Jul 17, 2023
cf6d48e
refactor: rename RelicSetBookmarkDialog -> RelicBookmarkDialog
chika3742 Jul 17, 2023
12864e7
refactor: RelicSetChooseDialog, RelicBookmarkDialog をClientのみで描画するように
chika3742 Jul 17, 2023
bb70221
feat: CharacterSelect コンポーネントの移行
chika3742 Jul 17, 2023
aae1e49
fix: volarでlocalePath, switchLocalePathが解決できない問題の修正
chika3742 Aug 30, 2023
e582df2
refactor: BookmarkableItemをBookmarkableMaterialにリネーム(typeの文字列に統一)
chika3742 Aug 30, 2023
61bd76c
feat: BookmarkableMaterialを判定するタイプガード追加
chika3742 Aug 31, 2023
705c076
remove: Vuetifyのプラグインを削除 (mhy-material-componentsに依存)
chika3742 Aug 31, 2023
90375ea
fix: type mismatch
chika3742 Aug 31, 2023
d70ab5c
refactor: rename component MaterialCards -> MaterialItems
chika3742 Aug 31, 2023
1a604a1
feat: MaterialCard を MaterialItemにリネームし、共通化したMaterialCardを組み込み
chika3742 Aug 31, 2023
02d9224
chore: update mhy-material-components to chika3742/mhy-material-compo…
chika3742 Aug 31, 2023
2712d9a
remove: card-legacy.vue
chika3742 Aug 31, 2023
21a2f31
fix: レアリティ表示の色
chika3742 Aug 31, 2023
7187b6b
feat: キャラ選択プルダウンでの絞り込み closes #163 (#166)
chika3742 Sep 5, 2023
579c451
chore: chika3742/mhy-material-components@7f136a171f7fe14abc9f3d75451d…
chika3742 Sep 5, 2023
883b6f6
feat: キャラページから光円錐リストページへのリンク追加 (closes #164) (#167)
chika3742 Sep 5, 2023
e028205
clean: .DS_Storeの削除
chika3742 Sep 5, 2023
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
36 changes: 24 additions & 12 deletions nuxt/components/bookmark/character-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as _ from "lodash"
import {Bookmark, LevelingBookmark} from "~/types/bookmark/bookmark"
import {CharacterIdWithVariant} from "~/types/strings"
import {reactive} from "#imports"
import {isBookmarkableExp} from "~/types/bookmarkable-ingredient"

interface Props {
character: CharacterIdWithVariant
Expand Down Expand Up @@ -82,17 +83,22 @@ const detailsDialog = reactive({

<div class="pa-2 d-flex flex-column" style="gap: 8px">
<section v-if="groupedBookmarks.characterMaterials.length >= 1">
<v-row no-gutters style="gap: 8px">
<MaterialCard
<div class="d-flex g-2 flex-wrap">
<MaterialItem
v-for="(materials, mId) in _.groupBy(groupedBookmarks.characterMaterials, 'materialId') as Record<string, (Bookmark.CharacterMaterial | Bookmark.Exp)[]>"
:key="mId"
:initial-selected-exp-item="(materials[0] as any).selectedItem"
:initial-selected-exp-item="isBookmarkableExp(materials[0]) ? materials[0].selectedItem : undefined"
:items="materials"
:purpose-types="['ascension', 'basicAttack', 'skill', 'talent', 'ultimate']"
show-details-button
@click:details-button="detailsDialog.items = groupedBookmarks.characterMaterials; detailsDialog.show = true"
/>
</v-row>
<v-btn
:text="tx('common.details')"
class="align-self-center"
prepend-icon="mdi-loupe"
variant="text"
@click="detailsDialog.items = groupedBookmarks.characterMaterials; detailsDialog.show = true"
/>
</div>
</section>

<section v-if="Object.keys(groupedBookmarks.lightCones).length >= 1">
Expand All @@ -107,17 +113,23 @@ const detailsDialog = reactive({
lines="two"
rounded
/>
<v-row class="ml-2 mt-2" no-gutters style="gap: 8px">
<MaterialCard
<div class="d-flex g-2 flex-wrap ml-4 mt-2">
<MaterialItem
v-for="(materials, mId) in _.groupBy(lcMaterials, 'materialId') as Record<string, (Bookmark.LightConeMaterial | Bookmark.Exp)[]>"
:key="mId"
:initial-selected-exp-item="(materials[0] as any).selectedItem"
:initial-selected-exp-item="isBookmarkableExp(materials[0]) ? materials[0].selectedItem : undefined"
:items="materials"
:purpose-types="['ascension']"
show-details-button
@click:details-button="detailsDialog.items = lcMaterials; detailsDialog.show = true"
/>
</v-row>

<v-btn
:text="tx('common.details')"
class="align-self-center"
prepend-icon="mdi-loupe"
variant="text"
@click="detailsDialog.items = lcMaterials; detailsDialog.show = true"
/>
</div>
</div>
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion nuxt/components/bookmark/details-dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ router.beforeEach(() => {
</v-btn>
</v-row>
<div class="material-cards-container">
<MaterialCard
<MaterialItem
v-for="item in __items.sort(materialSortFunc)"
:key="item.id"
:initial-selected-exp-item="isBookmarkableExp(item) ? item.selectedItem : undefined"
Expand Down
2 changes: 1 addition & 1 deletion nuxt/components/bookmark/list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const saveCharacterSort = (ev: Sortable.SortableEvent) => {
:key="characterId"
:data-character-id="characterId"
:bookmarks="characterBookmarks"
:character="characterId"
:character="characterId as string"
/>
</Draggable>

Expand Down
67 changes: 0 additions & 67 deletions nuxt/components/character/card.vue

This file was deleted.

34 changes: 0 additions & 34 deletions nuxt/components/character/icon-card.vue

This file was deleted.

104 changes: 0 additions & 104 deletions nuxt/components/character/select.vue

This file was deleted.

2 changes: 2 additions & 0 deletions nuxt/components/grouped-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const props = withDefaults(defineProps<{
categoryI18nKey: string
itemI18nKey: string
linkBasePath: string
preserveQuery?: boolean
hasSubtitle?: boolean
}>(), {
hasSubtitle: false,
Expand Down Expand Up @@ -48,6 +49,7 @@ const opened = computed({
:item="item"
:item-i18n-key="itemI18nKey"
:link-base-path="linkBasePath"
:preserve-query="preserveQuery"
:lines="hasSubtitle ? 'two' : 'one'"
>
<template #subtitle>
Expand Down
11 changes: 9 additions & 2 deletions nuxt/components/item-list-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
withDefaults(defineProps<{
item: Record<string, unknown> & { id: string, rarity: number }
linkBasePath: string
preserveQuery?: boolean
itemI18nKey: string
imageFunc: (id: string) => string
lines?: "one" | "two"
Expand All @@ -11,14 +12,20 @@ withDefaults(defineProps<{
</script>

<template>
<v-list-item :lines="lines" :to="localePath(`${linkBasePath}/${item.id}`)">
<v-list-item
:lines="lines"
:to="localePath({
path: `${linkBasePath}/${item.id}`,
query: preserveQuery ? $route.query : {},
})"
>
<template #prepend>
<v-img :src="imageFunc(item.id)" aspect-ratio="1" class="mr-2" width="45px" />
</template>

<v-row align="center" no-gutters style="gap: 8px">
<v-list-item-title>{{ tx(`${itemI18nKey}.${item.id}`) }}</v-list-item-title>
<v-chip :color="`rank${item.rarity}`" size="small">
<v-chip :color="`rarity-${item.rarity}`" size="small">
<v-icon>mdi-star</v-icon>
{{ item.rarity }}
</v-chip>
Expand Down
Loading