From d9ccb87c0a907cd2707503ae23cca5729cdbcf45 Mon Sep 17 00:00:00 2001 From: yssk22 Date: Mon, 23 Dec 2024 04:45:10 +0000 Subject: [PATCH] [expo] add follower configuration UI. **Summary** ElineupMallSettingsScreen enable users to configure followership settigns for members who they already follow. **Test** - expo **Issue** - #116 --- expo/assets/translations.json | 99 + .../user/__snapshots__/index.test.tsx.snap | 2 - .../app/user/internals/HelloProject.ts | 24 + .../HelloProjectFragment.graphql.ts | 198 +- .../UserServiceProviderQuery.graphql.ts | 174 +- .../useUpsertFollowMutation.graphql.ts | 210 +- .../artist/internals/useUpsertFollow.ts | 126 +- .../elineupmall/ElineupMallSettingsScreen.tsx | 13 + expo/features/elineupmall/index.tsx | 13 +- .../ElineupMallLimitedTimeItemList.tsx | 22 +- .../ElineupMallLimitedTimeItemListItem.tsx | 35 +- .../internal/ElineupMallNoFollowingsBox.tsx | 30 + ...eupMallLimitedTimeItemListQuery.graphql.ts | 7 +- ...dTimeItemListQueryFragmentQuery.graphql.ts | 7 +- .../ElineupMallSettingsFollowingMember.tsx | 163 + ...lSettingsFollowingMemberCategoryButton.tsx | 63 + .../ElineupMallSettingsFollowings.tsx | 16 + .../home/__snapshots__/index.test.tsx.snap | 346 +- .../__snapshots__/HomeTabArtist.test.tsx.snap | 7211 ++++++++++------- .../home/internals/goods/HomeTabGoods.tsx | 100 +- .../home/internals/menu/HomeTabMenu.tsx | 3 + .../menu/__snapshots__/MenuTab.test.tsx.snap | 174 + expo/generated/Screens.tsx | 28 +- expo/generated/schema.graphql | 38 + ...1ad51a11c68177d7ea9006d12389f2c49393d.json | 610 ++ ...e92e9c97e7b7429d7e093973d9014c773e2a5.json | 3215 ++++++++ 26 files changed, 9889 insertions(+), 3038 deletions(-) create mode 100644 expo/features/elineupmall/ElineupMallSettingsScreen.tsx create mode 100644 expo/features/elineupmall/internal/ElineupMallNoFollowingsBox.tsx create mode 100644 expo/features/elineupmall/internal/settings/ElineupMallSettingsFollowingMember.tsx create mode 100644 expo/features/elineupmall/internal/settings/ElineupMallSettingsFollowingMemberCategoryButton.tsx create mode 100644 expo/features/elineupmall/internal/settings/ElineupMallSettingsFollowings.tsx create mode 100644 expo/system/graphql/__mocks__/snapshots/FeedContextQuery.54356c7e5589009020672c5ce511ad51a11c68177d7ea9006d12389f2c49393d.json create mode 100644 expo/system/graphql/__mocks__/snapshots/UserServiceProviderQuery.67a70173434b9edb8dcf4dcaabee92e9c97e7b7429d7e093973d9014c773e2a5.json diff --git a/expo/assets/translations.json b/expo/assets/translations.json index bc1ec057..6577f868 100644 --- a/expo/assets/translations.json +++ b/expo/assets/translations.json @@ -101,6 +101,105 @@ "Goods": { "ja": "グッズ" }, + "blueray": { + "en": "Blue-ray", + "ja": "ブルーレイ" + }, + "clear_file": { + "en": "Clear file", + "ja": "クリアファイル" + }, + "colllection_other": { + "en": "Collection items (other)", + "ja": "コレクション商品(その他)" + }, + "colllection_photo": { + "en": "Collection items (Photo)", + "ja": "コレクション商品(写真)" + }, + "colllection_pinnap_poster": { + "en": "Collection items (Pinnap Poster)", + "ja": "コレクション商品(ピンポス)" + }, + "dvd": { + "en": "DVD", + "ja": "DVD" + }, + "dvd_magazine": { + "en": "DVD magazine", + "ja": "DVDマガジン" + }, + "dvd_magazine_other": { + "en": "DVD magazine (other)", + "ja": "DVDマガジン(その他)" + }, + "fsk": { + "en": "FSK", + "ja": "FSK" + }, + "keyring_other": { + "en": "Other Keyrings", + "ja": "その他のキーホルダー" + }, + "microfiber_towel": { + "en": "Microfiber towel", + "ja": "マイクロファイバータオル" + }, + "muffler_towel": { + "en": "Muffler towel", + "ja": "マフラータオル" + }, + "other": { + "en": "Other", + "ja": "その他" + }, + "penlight": { + "en": "Penlight", + "ja": "ペンライト" + }, + "photo2_l": { + "en": "Photo 2L", + "ja": "2L 写真" + }, + "photo_a4": { + "en": "Photo A4", + "ja": "A4 写真" + }, + "photo_a5": { + "en": "Photo A5", + "ja": "A5写真" + }, + "photo_album": { + "en": "Photo Album", + "ja": "フォトアルバム" + }, + "photo_album_other": { + "en": "Photo Album", + "ja": "フォトアルバム(その他)" + }, + "photo_book": { + "en": "Photo Book", + "ja": "写真集" + }, + "photo_book_other": { + "en": "Photo Book (Other)", + "ja": "写真集(その他)" + }, + "photo_daily": { + "en": "Daily Photo", + "ja": "日替わり写真" + }, + "photo_other": { + "en": "Photo (Other)", + "ja": "写真(その他)" + }, + "t_shirt": { + "en": "T Shirt", + "ja": "Tシャツ" + }, + "Elineup Mall Settings": { + "ja": "イーラインナップモールの設定" + }, "Order End At": { "ja": "販売終了日時" }, diff --git a/expo/features/app/user/__snapshots__/index.test.tsx.snap b/expo/features/app/user/__snapshots__/index.test.tsx.snap index 500e68e5..3f4146f4 100644 --- a/expo/features/app/user/__snapshots__/index.test.tsx.snap +++ b/expo/features/app/user/__snapshots__/index.test.tsx.snap @@ -234,7 +234,6 @@ rosychronicle testID="user.test.useMembers" > erina_ikuta -ayumi_ishida sakura_oda miki_nonaka maria_makino @@ -246,7 +245,6 @@ mei_yamazaki rio_sakurai haruka_inoue ako_yumigeta -ayano_kawamura moe_kamikokuryo layla_ise rin_hashisako diff --git a/expo/features/app/user/internals/HelloProject.ts b/expo/features/app/user/internals/HelloProject.ts index 89c3db8a..1d876a91 100644 --- a/expo/features/app/user/internals/HelloProject.ts +++ b/expo/features/app/user/internals/HelloProject.ts @@ -30,6 +30,30 @@ const helloProjectFragmentGraphQL = graphql` myFollowStatus { id type + elineupmallOther + elineupmallPhotoDaily + elineupmallPhotoA4 + elineupmallPhotoA5 + elineupmallPhoto2l + elineupmallPhotoOther + elineupmallPhotoAlbum + elineupmallPhotoAlbumOther + elineupmallPhotoBook + elineupmallPhotoBookOther + elineupmallDvd + elineupmallDvdMagazine + elineupmallDvdMagazineOther + elineupmallBlueray + elineupmallPenlight + elineupmallCollectionPinnapPoster + elineupmallCollectionPhoto + elineupmallCollectionOther + elineupmallTshirt + elineupmallMicrofiberTowel + elineupmallMufflerTowel + elineupmallFsk + elineupmallKeyringOther + elineupmallClearFile } } } diff --git a/expo/features/app/user/internals/__generated__/HelloProjectFragment.graphql.ts b/expo/features/app/user/internals/__generated__/HelloProjectFragment.graphql.ts index 16db05ba..adacde0c 100644 --- a/expo/features/app/user/internals/__generated__/HelloProjectFragment.graphql.ts +++ b/expo/features/app/user/internals/__generated__/HelloProjectFragment.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<9c25464f2a13ffe6cbdca07a25411be5>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -9,7 +9,7 @@ // @ts-nocheck import { ReaderFragment } from 'relay-runtime'; -export type HPFollowHPFollowType = "follow" | "follow_with_notification" | "unfollow" | "%future added value"; +export type HPFollowHPFollowType = "follow" | "follow_with_notification" | "unfollow" | "unknown" | "%future added value"; import { FragmentRefs } from "relay-runtime"; export type HelloProjectFragment$data = { readonly artists: ReadonlyArray<{ @@ -25,6 +25,30 @@ export type HelloProjectFragment$data = { readonly joinAt: string | null | undefined; readonly key: string; readonly myFollowStatus: { + readonly elineupmallBlueray: HPFollowHPFollowType; + readonly elineupmallClearFile: HPFollowHPFollowType; + readonly elineupmallCollectionOther: HPFollowHPFollowType; + readonly elineupmallCollectionPhoto: HPFollowHPFollowType; + readonly elineupmallCollectionPinnapPoster: HPFollowHPFollowType; + readonly elineupmallDvd: HPFollowHPFollowType; + readonly elineupmallDvdMagazine: HPFollowHPFollowType; + readonly elineupmallDvdMagazineOther: HPFollowHPFollowType; + readonly elineupmallFsk: HPFollowHPFollowType; + readonly elineupmallKeyringOther: HPFollowHPFollowType; + readonly elineupmallMicrofiberTowel: HPFollowHPFollowType; + readonly elineupmallMufflerTowel: HPFollowHPFollowType; + readonly elineupmallOther: HPFollowHPFollowType; + readonly elineupmallPenlight: HPFollowHPFollowType; + readonly elineupmallPhoto2l: HPFollowHPFollowType; + readonly elineupmallPhotoA4: HPFollowHPFollowType; + readonly elineupmallPhotoA5: HPFollowHPFollowType; + readonly elineupmallPhotoAlbum: HPFollowHPFollowType; + readonly elineupmallPhotoAlbumOther: HPFollowHPFollowType; + readonly elineupmallPhotoBook: HPFollowHPFollowType; + readonly elineupmallPhotoBookOther: HPFollowHPFollowType; + readonly elineupmallPhotoDaily: HPFollowHPFollowType; + readonly elineupmallPhotoOther: HPFollowHPFollowType; + readonly elineupmallTshirt: HPFollowHPFollowType; readonly id: string; readonly type: HPFollowHPFollowType; } | null | undefined; @@ -165,6 +189,174 @@ return { "kind": "ScalarField", "name": "type", "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoDaily", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoA4", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoA5", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhoto2l", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoAlbum", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoAlbumOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoBook", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoBookOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallDvd", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallDvdMagazine", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallDvdMagazineOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallBlueray", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPenlight", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallCollectionPinnapPoster", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallCollectionPhoto", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallCollectionOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallTshirt", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallMicrofiberTowel", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallMufflerTowel", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallFsk", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallKeyringOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallClearFile", + "storageKey": null } ], "storageKey": null @@ -181,6 +373,6 @@ return { }; })(); -(node as any).hash = "b5c428c4a80097a3170f93ce3950f3ba"; +(node as any).hash = "b0e9b68639cacf0fff5e0f4f38e35bd9"; export default node; diff --git a/expo/features/app/user/internals/__generated__/UserServiceProviderQuery.graphql.ts b/expo/features/app/user/internals/__generated__/UserServiceProviderQuery.graphql.ts index 51f6331d..219aca56 100644 --- a/expo/features/app/user/internals/__generated__/UserServiceProviderQuery.graphql.ts +++ b/expo/features/app/user/internals/__generated__/UserServiceProviderQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<3bee21e7750fdc8ef26ceeffec999039>> + * @generated SignedSource<<4bcbad703b8245e66eaa157ac7101fa0>> * @lightSyntaxTransform * @nogrep */ @@ -198,6 +198,174 @@ return { "kind": "ScalarField", "name": "type", "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoDaily", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoA4", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoA5", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhoto2l", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoAlbum", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoAlbumOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoBook", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoBookOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallDvd", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallDvdMagazine", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallDvdMagazineOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallBlueray", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPenlight", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallCollectionPinnapPoster", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallCollectionPhoto", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallCollectionOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallTshirt", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallMicrofiberTowel", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallMufflerTowel", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallFsk", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallKeyringOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallClearFile", + "storageKey": null } ], "storageKey": null @@ -352,12 +520,12 @@ return { ] }, "params": { - "cacheID": "7752f697c6ce1e9efb83116acc5b854d", + "cacheID": "655b875b72da3af617e8f4f2c4a5b7d1", "id": null, "metadata": {}, "name": "UserServiceProviderQuery", "operationKind": "query", - "text": "query UserServiceProviderQuery {\n helloproject {\n ...HelloProjectFragment\n id\n }\n me {\n ...MeFragment\n id\n }\n}\n\nfragment HelloProjectFragment on HelloProjectQuery {\n artists {\n id\n key\n name\n thumbnailURL\n members {\n id\n key\n artistKey\n artistID\n name\n nameKana\n thumbnailURL\n dateOfBirth\n bloodType\n joinAt\n graduateAt\n myFollowStatus {\n id\n type\n }\n }\n }\n}\n\nfragment MeFragment on MeQuery {\n id\n username\n clientId\n clientName\n sortHistories(first: 2) {\n edges {\n node {\n id\n createdAt\n sortResult {\n records {\n artistId\n memberId\n memberKey\n point\n rank\n }\n }\n }\n }\n }\n}\n" + "text": "query UserServiceProviderQuery {\n helloproject {\n ...HelloProjectFragment\n id\n }\n me {\n ...MeFragment\n id\n }\n}\n\nfragment HelloProjectFragment on HelloProjectQuery {\n artists {\n id\n key\n name\n thumbnailURL\n members {\n id\n key\n artistKey\n artistID\n name\n nameKana\n thumbnailURL\n dateOfBirth\n bloodType\n joinAt\n graduateAt\n myFollowStatus {\n id\n type\n elineupmallOther\n elineupmallPhotoDaily\n elineupmallPhotoA4\n elineupmallPhotoA5\n elineupmallPhoto2l\n elineupmallPhotoOther\n elineupmallPhotoAlbum\n elineupmallPhotoAlbumOther\n elineupmallPhotoBook\n elineupmallPhotoBookOther\n elineupmallDvd\n elineupmallDvdMagazine\n elineupmallDvdMagazineOther\n elineupmallBlueray\n elineupmallPenlight\n elineupmallCollectionPinnapPoster\n elineupmallCollectionPhoto\n elineupmallCollectionOther\n elineupmallTshirt\n elineupmallMicrofiberTowel\n elineupmallMufflerTowel\n elineupmallFsk\n elineupmallKeyringOther\n elineupmallClearFile\n }\n }\n }\n}\n\nfragment MeFragment on MeQuery {\n id\n username\n clientId\n clientName\n sortHistories(first: 2) {\n edges {\n node {\n id\n createdAt\n sortResult {\n records {\n artistId\n memberId\n memberKey\n point\n rank\n }\n }\n }\n }\n }\n}\n" } }; })(); diff --git a/expo/features/artist/internals/__generated__/useUpsertFollowMutation.graphql.ts b/expo/features/artist/internals/__generated__/useUpsertFollowMutation.graphql.ts index bf1a7d43..16273e6d 100644 --- a/expo/features/artist/internals/__generated__/useUpsertFollowMutation.graphql.ts +++ b/expo/features/artist/internals/__generated__/useUpsertFollowMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<2150c1899edd3606279aaa7f84411bc9>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -9,18 +9,48 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type HPFollowHPFollowType = "follow" | "follow_with_notification" | "unfollow" | "%future added value"; -export type HPFollowType = "follow" | "follow_with_notification" | "unfollow" | "%future added value"; +export type HPElineupMallItemCategory = "blueray" | "clear_file" | "colllection_other" | "colllection_photo" | "colllection_pinnap_poster" | "dvd" | "dvd_magazine" | "dvd_magazine_other" | "fsk" | "keyring_other" | "microfiber_towel" | "muffler_towel" | "other" | "penlight" | "photo2_l" | "photo_a4" | "photo_a5" | "photo_album" | "photo_album_other" | "photo_book" | "photo_book_other" | "photo_daily" | "photo_other" | "t_shirt" | "%future added value"; +export type HPFollowHPFollowType = "follow" | "follow_with_notification" | "unfollow" | "unknown" | "%future added value"; +export type HPFollowType = "follow" | "follow_with_notification" | "unfollow" | "unknown" | "%future added value"; export type HPFollowUpsertParamsInput = { + elineupMallFollowParams?: ReadonlyArray | null | undefined; followType: HPFollowType; memberId: number; }; +export type HPFollowElineupMallParamsInput = { + category: HPElineupMallItemCategory; + followType: HPFollowType; +}; export type useUpsertFollowMutation$variables = { params: HPFollowUpsertParamsInput; }; export type useUpsertFollowMutation$data = { readonly me: { readonly upsertFollow: { + readonly elineupmallBlueray: HPFollowHPFollowType; + readonly elineupmallClearFile: HPFollowHPFollowType; + readonly elineupmallCollectionOther: HPFollowHPFollowType; + readonly elineupmallCollectionPhoto: HPFollowHPFollowType; + readonly elineupmallCollectionPinnapPoster: HPFollowHPFollowType; + readonly elineupmallDvd: HPFollowHPFollowType; + readonly elineupmallDvdMagazine: HPFollowHPFollowType; + readonly elineupmallDvdMagazineOther: HPFollowHPFollowType; + readonly elineupmallFsk: HPFollowHPFollowType; + readonly elineupmallKeyringOther: HPFollowHPFollowType; + readonly elineupmallMicrofiberTowel: HPFollowHPFollowType; + readonly elineupmallMufflerTowel: HPFollowHPFollowType; + readonly elineupmallOther: HPFollowHPFollowType; + readonly elineupmallPenlight: HPFollowHPFollowType; + readonly elineupmallPhoto2l: HPFollowHPFollowType; + readonly elineupmallPhotoA4: HPFollowHPFollowType; + readonly elineupmallPhotoA5: HPFollowHPFollowType; + readonly elineupmallPhotoAlbum: HPFollowHPFollowType; + readonly elineupmallPhotoAlbumOther: HPFollowHPFollowType; + readonly elineupmallPhotoBook: HPFollowHPFollowType; + readonly elineupmallPhotoBookOther: HPFollowHPFollowType; + readonly elineupmallPhotoDaily: HPFollowHPFollowType; + readonly elineupmallPhotoOther: HPFollowHPFollowType; + readonly elineupmallTshirt: HPFollowHPFollowType; readonly id: string; readonly member: { readonly id: string; @@ -91,6 +121,174 @@ v2 = [ (v1/*: any*/) ], "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoDaily", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoA4", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoA5", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhoto2l", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoAlbum", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoAlbumOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoBook", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPhotoBookOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallDvd", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallDvdMagazine", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallDvdMagazineOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallBlueray", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallPenlight", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallCollectionPinnapPoster", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallCollectionPhoto", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallCollectionOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallTshirt", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallMicrofiberTowel", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallMufflerTowel", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallFsk", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallKeyringOther", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "elineupmallClearFile", + "storageKey": null } ], "storageKey": null @@ -117,16 +315,16 @@ return { "selections": (v2/*: any*/) }, "params": { - "cacheID": "229e234f263ac9f8907abff58f736125", + "cacheID": "27074257b53a091a6263918e35e685cd", "id": null, "metadata": {}, "name": "useUpsertFollowMutation", "operationKind": "mutation", - "text": "mutation useUpsertFollowMutation(\n $params: HPFollowUpsertParamsInput!\n) {\n me {\n upsertFollow(params: $params) {\n id\n type\n member {\n id\n }\n }\n }\n}\n" + "text": "mutation useUpsertFollowMutation(\n $params: HPFollowUpsertParamsInput!\n) {\n me {\n upsertFollow(params: $params) {\n id\n type\n member {\n id\n }\n elineupmallOther\n elineupmallPhotoDaily\n elineupmallPhotoA4\n elineupmallPhotoA5\n elineupmallPhoto2l\n elineupmallPhotoOther\n elineupmallPhotoAlbum\n elineupmallPhotoAlbumOther\n elineupmallPhotoBook\n elineupmallPhotoBookOther\n elineupmallDvd\n elineupmallDvdMagazine\n elineupmallDvdMagazineOther\n elineupmallBlueray\n elineupmallPenlight\n elineupmallCollectionPinnapPoster\n elineupmallCollectionPhoto\n elineupmallCollectionOther\n elineupmallTshirt\n elineupmallMicrofiberTowel\n elineupmallMufflerTowel\n elineupmallFsk\n elineupmallKeyringOther\n elineupmallClearFile\n }\n }\n}\n" } }; })(); -(node as any).hash = "b7f6845140f00007d85f77814a46eb86"; +(node as any).hash = "8529051710ad55463849cc0462b835a8"; export default node; diff --git a/expo/features/artist/internals/useUpsertFollow.ts b/expo/features/artist/internals/useUpsertFollow.ts index 1b70144d..322e5a38 100644 --- a/expo/features/artist/internals/useUpsertFollow.ts +++ b/expo/features/artist/internals/useUpsertFollow.ts @@ -1,7 +1,13 @@ import { useCallback } from 'react'; import { graphql, useMutation } from 'react-relay'; -import { useUpsertFollowMutation, HPFollowType } from './__generated__/useUpsertFollowMutation.graphql'; +import { + useUpsertFollowMutation, + HPFollowType, + HPFollowElineupMallParamsInput +} from './__generated__/useUpsertFollowMutation.graphql'; + +//lineupMallFollowParams?: ReadonlyArray: case null: case undefined; const useUpsertFollowMutationGraphQL = graphql` mutation useUpsertFollowMutation($params: HPFollowUpsertParamsInput!) { @@ -12,21 +18,57 @@ const useUpsertFollowMutationGraphQL = graphql` member { id } + elineupmallBlueray + elineupmallClearFile + elineupmallCollectionOther + elineupmallCollectionPinnapPoster + elineupmallCollectionPhoto + elineupmallDvd + elineupmallDvdMagazine + elineupmallDvdMagazineOther + elineupmallFsk + elineupmallKeyringOther + elineupmallMicrofiberTowel + elineupmallMufflerTowel + elineupmallOther + elineupmallPenlight + elineupmallPhotoDaily + elineupmallPhotoA4 + elineupmallPhotoA5 + elineupmallPhoto2l + elineupmallPhotoOther + elineupmallPhotoAlbum + elineupmallPhotoAlbumOther + elineupmallPhotoBook + elineupmallPhotoBookOther + elineupmallTshirt } } } `; -const useUpsertFollow = (): [(memberId: string, followType: HPFollowType) => Promise, boolean] => { +const useUpsertFollow = (): [ + ( + memberId: string, + followType: HPFollowType, + elineupMallFollowParams?: HPFollowElineupMallParamsInput[] + ) => Promise, + boolean +] => { const [upsertFollow, isUpdating] = useMutation(useUpsertFollowMutationGraphQL); const update = useCallback( - async (memberId: string, followType: HPFollowType): Promise => { + async ( + memberId: string, + followType: HPFollowType, + elineupMallFollowParams?: HPFollowElineupMallParamsInput[] + ): Promise => { const p = new Promise((resolve: (id: string) => void, reject: (err: object) => void) => { upsertFollow({ variables: { params: { memberId: parseInt(memberId, 10), - followType + followType, + elineupMallFollowParams } }, onCompleted: (data, err) => { @@ -49,6 +91,82 @@ const useUpsertFollow = (): [(memberId: string, followType: HPFollowType) => Pro const record = member.getOrCreateLinkedRecord('myFollowStatus', 'HPFollow'); record.setValue(followId, 'id'); record.setValue(followType, 'type'); + (elineupMallFollowParams ?? []).forEach((param) => { + switch (param.category) { + case 'blueray': + record.setValue('elineupmallBlueray', param.followType); + break; + case 'clear_file': + record.setValue('elineupmallClearFile', param.followType); + break; + case 'colllection_other': + record.setValue('elineupmallCollectionOther', param.followType); + break; + case 'colllection_photo': + record.setValue('elineupmallCollectionPhoto', param.followType); + break; + case 'colllection_pinnap_poster': + record.setValue('elineupmallCollectionPinnapPoster', param.followType); + break; + case 'dvd': + record.setValue('elineupmallDvd', param.followType); + break; + case 'dvd_magazine': + record.setValue('elineupmallDvdMagazine', param.followType); + break; + case 'dvd_magazine_other': + record.setValue('elineupmallDvdMagazineOther', param.followType); + break; + case 'fsk': + record.setValue('elineupmallFsk', param.followType); + break; + case 'keyring_other': + record.setValue('elineupmallKeyringOther', param.followType); + break; + case 'microfiber_towel': + record.setValue('elineupmallMicrofiberTowel', param.followType); + break; + case 'muffler_towel': + record.setValue('elineupmallMufflerTowel', param.followType); + break; + case 'other': + record.setValue('elineupmallOther', param.followType); + break; + case 'penlight': + record.setValue('elineupmallPenlight', param.followType); + break; + case 'photo2_l': + record.setValue('elineupmallPhoto2L', param.followType); + break; + case 'photo_a4': + record.setValue('elineupmallPhotoA4', param.followType); + break; + case 'photo_a5': + record.setValue('elineupmallPhotoA5', param.followType); + break; + case 'photo_album': + record.setValue('elineupmallPhotoAlbum', param.followType); + break; + case 'photo_album_other': + record.setValue('elineupmallPhotoAlbumOther', param.followType); + break; + case 'photo_book': + record.setValue('elineupmallPhotoBook', param.followType); + break; + case 'photo_book_other': + record.setValue('elineupmallPhotoBookOther', param.followType); + break; + case 'photo_daily': + record.setValue('elineupmallPhotoDaily', param.followType); + break; + case 'photo_other': + record.setValue('elineupmallPhotoOther', param.followType); + break; + case 't_shirt': + record.setValue('elineupmallTShirt', param.followType); + break; + } + }); } }); }); diff --git a/expo/features/elineupmall/ElineupMallSettingsScreen.tsx b/expo/features/elineupmall/ElineupMallSettingsScreen.tsx new file mode 100644 index 00000000..ac9cbb37 --- /dev/null +++ b/expo/features/elineupmall/ElineupMallSettingsScreen.tsx @@ -0,0 +1,13 @@ +import { defineScreen, useScreenTitle } from '@hpapp/features/common/stack'; +import { t } from '@hpapp/system/i18n'; + +import ElineupMallSettingsFollowings from './internal/settings/ElineupMallSettingsFollowings'; + +export default defineScreen('/elineupmall/settings/', function ElineupMallSettingsScreen() { + useScreenTitle(t('Elineup Mall Settings')); + return ( + <> + + + ); +}); diff --git a/expo/features/elineupmall/index.tsx b/expo/features/elineupmall/index.tsx index b20b927c..5540f48c 100644 --- a/expo/features/elineupmall/index.tsx +++ b/expo/features/elineupmall/index.tsx @@ -1,3 +1,12 @@ -import ElineupMallLimitedTimeItemList from './internal/ElineupMallLimitedTimeItemList'; +import ElineupMallLimitedTimeItemList, { + ElineupMallLimitedTimeItemListProps, + ElineupMallItemCategory +} from './internal/ElineupMallLimitedTimeItemList'; +import ElineupMallNoFollowingsBox from './internal/ElineupMallNoFollowingsBox'; -export { ElineupMallLimitedTimeItemList }; +export { + ElineupMallLimitedTimeItemList, + ElineupMallLimitedTimeItemListProps, + ElineupMallItemCategory, + ElineupMallNoFollowingsBox +}; diff --git a/expo/features/elineupmall/internal/ElineupMallLimitedTimeItemList.tsx b/expo/features/elineupmall/internal/ElineupMallLimitedTimeItemList.tsx index e3dd9aa4..0a1ee6f3 100644 --- a/expo/features/elineupmall/internal/ElineupMallLimitedTimeItemList.tsx +++ b/expo/features/elineupmall/internal/ElineupMallLimitedTimeItemList.tsx @@ -4,7 +4,10 @@ import { FlatList, RefreshControl } from 'react-native'; import { graphql, usePaginationFragment } from 'react-relay'; import { ElineupMallLimitedTimeItemListItem } from './ElineupMallLimitedTimeItemListItem'; -import { ElineupMallLimitedTimeItemListQuery } from './__generated__/ElineupMallLimitedTimeItemListQuery.graphql'; +import { + ElineupMallLimitedTimeItemListQuery, + HPElineupMallItemCategory +} from './__generated__/ElineupMallLimitedTimeItemListQuery.graphql'; import { ElineupMallLimitedTimeItemListQuery_helloproject_query_elineupmall_items$key } from './__generated__/ElineupMallLimitedTimeItemListQuery_helloproject_query_elineupmall_items.graphql'; const ElineupMallLimitedTimeItemListQueryGraphQL = graphql` @@ -32,17 +35,30 @@ const ElineupMallLimitedTimeItemListQueryFragmentGraphQL = graphql` const numPerFetch = 20; +export type ElineupMallItemCategory = HPElineupMallItemCategory; + export type ElineupMallLimitedTimeItemListProps = { + memberCategories: { + memberId: string; + categories: ElineupMallItemCategory[]; + }[]; memberIds: string[]; + categories: ElineupMallItemCategory[]; }; -export default function ElineupMallLimitedTimeItemList({ memberIds }: ElineupMallLimitedTimeItemListProps) { +export default function ElineupMallLimitedTimeItemList({ + memberCategories, + memberIds, + categories +}: ElineupMallLimitedTimeItemListProps) { const { data, isReloading, reload } = useLazyReloadableQuery( ElineupMallLimitedTimeItemListQueryGraphQL, { first: numPerFetch, params: { - memberIDs: memberIds + memberIDs: memberIds, + categories, + memberCategories } } ); diff --git a/expo/features/elineupmall/internal/ElineupMallLimitedTimeItemListItem.tsx b/expo/features/elineupmall/internal/ElineupMallLimitedTimeItemListItem.tsx index 7a82755c..2a94ff3b 100644 --- a/expo/features/elineupmall/internal/ElineupMallLimitedTimeItemListItem.tsx +++ b/expo/features/elineupmall/internal/ElineupMallLimitedTimeItemListItem.tsx @@ -1,5 +1,7 @@ +/* eslint-disable local-rules/no-translation-entry */ +import { useThemeColor } from '@hpapp/features/app/theme'; import { ExternalImage, Text } from '@hpapp/features/common'; -import { Spacing } from '@hpapp/features/common/constants'; +import { FontSize, Spacing } from '@hpapp/features/common/constants'; import { ListItem } from '@hpapp/features/common/list'; import { useNavigation } from '@hpapp/features/common/stack'; import ElineupMallWebViewScreen from '@hpapp/features/elineupmall/ElineupMallWebViewScreen'; @@ -30,6 +32,7 @@ const ElineupMallLimitedTimeItemListItemFragmentGraphQL = graphql` `; export function ElineupMallLimitedTimeItemListItem({ data }: { data: ElineupMallLimitedTimeItemListItemFragment$key }) { + const [color, contrast] = useThemeColor('primary'); const navigation = useNavigation(); const item = useFragment( ElineupMallLimitedTimeItemListItemFragmentGraphQL, @@ -56,6 +59,9 @@ export function ElineupMallLimitedTimeItemListItem({ data }: { data: ElineupMall }} > + + {t(item.category)} + {item.name} @@ -85,7 +91,7 @@ const imageSize = 160; const styles = StyleSheet.create({ container: { - height: 180, + minHeight: 180, padding: Spacing.Small }, image: { @@ -94,26 +100,33 @@ const styles = StyleSheet.create({ }, nameAndMetadata: { flexDirection: 'column', - justifyContent: 'center', - alignItems: 'flex-start', - marginRight: Spacing.Medium + marginRight: Spacing.Medium, + flexGrow: 1 }, name: { flexGrow: 1, - fontWeight: 'bold', - marginBottom: Spacing.XSmall + fontWeight: 'bold' }, metadata: { - flexDirection: 'column', - alignItems: 'flex-start' + flexGrow: 1 }, metadataRow: { flexDirection: 'row' }, + metadataRowCategory: { + alignItems: 'flex-start' + }, metadataLabel: { width: 80, - marginRight: Spacing.Small + marginRight: Spacing.Small, + fontSize: FontSize.Small }, metadataValue: {}, - dateString: {} + dateString: {}, + categoryText: { + fontSize: FontSize.Small, + fontWeight: 'bold', + textAlign: 'right', + marginBottom: Spacing.XSmall + } }); diff --git a/expo/features/elineupmall/internal/ElineupMallNoFollowingsBox.tsx b/expo/features/elineupmall/internal/ElineupMallNoFollowingsBox.tsx new file mode 100644 index 00000000..b64236a0 --- /dev/null +++ b/expo/features/elineupmall/internal/ElineupMallNoFollowingsBox.tsx @@ -0,0 +1,30 @@ +import { useNavigation } from '@hpapp/features/common/stack'; +import ElineupMallSettingsScreen from '@hpapp/features/elineupmall/ElineupMallSettingsScreen'; +import { t } from '@hpapp/system/i18n'; +import { Button } from '@rneui/themed'; +import { View, StyleSheet } from 'react-native'; + +export default function ElineupMallNoFollowingsBox() { + const navigation = useNavigation(); + return ( + +