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

コンポーネント整理 #318

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

AKIYAMA-HAYATE
Copy link
Collaborator

@AKIYAMA-HAYATE AKIYAMA-HAYATE commented Oct 17, 2024

対応Issue

概要

コンポーネント整理

実装詳細

以下の構造になるように各コンポーネントを移動
Components
├── Layout
├── common
│ ├── icons
│ │ ├── BackIcon
│ │ ├── BingoIcon
│ │ ├── PrizesIcon
│ │ ├── ReachIcon
│ │ ├── ReactionsIcon
│ │ ├── SettingsIcon
│ ├── buttons
│ │ ├── Button
│ │ ├── DotButton
│ │ ├── ToggleButton
│ ├── cards
│ │ ├── NumberCardList
│ │ ├── NumberCardSmall
│ │ ├── PrizeCard
│ │ ├── PrizeCardList
│ ├── Header
│ ├── HelpCarousel
│ ├── IconFramework
│ ├── Loading
│ ├── Modal
│ ├── NavigationBar
│ ├── ReachCount
│ ├── ReactionStampModal
│ └── index.ts
└── index.ts

画面スクリーンショット等

テスト項目

  • 各コンポーネントの場所があっているか
  • 今まで通り動作するか
  • [ ]

備考

@github-actions github-actions bot added frontend bug Something isn't working labels Oct 17, 2024
Copy link
Collaborator

@hikahana hikahana left a comment

Choose a reason for hiding this comment

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

良いと思います。

よく考えたらiconFrameWorkからiconを作成しているのでiconsにまとめてもよさそうです。

Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion
以下のようにカテゴリ別に分けときますか

Suggested change
// Components
export { default as Header } from "./Header";
export { default as Modal } from "./Modal";
export { default as Loading } from "./Loading";
export { default as NavigationBar } from "./NavigationBar";
export { default as ReactionStampModal } from "./ReactionStampModal";
export { default as HelpCarousel } from "./HelpCarousel";
export { default as ReachCount } from "./ReachCount";
// Buttons
export { default as Button } from "./buttons/Button";
export { default as ToggleButton } from "./buttons/ToggleButton";
export { default as DotButton } from "./buttons/DotButton";
// Icons
export { default as BingoIcon } from "./icons/BingoIcon";
export { default as PrizesIcon } from "./icons/PrizesIcon";
export { default as ReactionsIcon } from "./icons/ReactionsIcon";
export { default as SettingsIcon } from "./icons/SettingsIcon";
export { default as BackIcon } from "./icons/BackIcon";
export { default as ReachIcon } from "./icons/ReachIcon";
export { default as IconFramework } from "./icons/IconFramework";
// Cards
export { default as NumberCardSmall } from "./cards/NumberCardSmall";
export { default as NumberCardLarge } from "./NumberCardLarge";
export { default as PrizeCard } from "./cards/PrizeCard";
export { default as PrizeCardList } from "./cards/PrizeCardList";
export { default as NumberCardList } from "./cards/NumberCardList";

Comment on lines 1 to 5
import React from "react";
import NumberCardSmall from "../NumberCardSmall";

import type { SubscribeListNumbersSubscription } from "@/types/graphql";
import styles from "./NumberCardList.module.css";
import NumberCardSmall from "../NumberCardSmall";
Copy link
Collaborator

Choose a reason for hiding this comment

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

question
ここ2行目空白なのは理由ありますでしょうか。

import React from "react";
import NumberCardSmall from "../NumberCardSmall";
import type { SubscribeListNumbersSubscription } from "@/types/graphql";
import styles from "./NumberCardList.module.css";

Copy link
Collaborator

Choose a reason for hiding this comment

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

must
おそらく直しました。
原因としてwebpackでimagesを再定義したことでremotePatternsが消えてしまったこと、"/bingo/**"というように前にスラッシュを付ける必要がある、であると思います。

images: {
    remotePatterns: [
      {
        protocol: "http",
        hostname: "minio",
        port: "9000",
        pathname: "/bingo/**",
      },
      {
        protocol: "https",
        hostname: "storage.nutfes.net",
        pathname: "/**",
      },
    ],
    disableStaticImages: true,
  },
  webpack: (config) => {
    config.module.rules.push({
      test: /\.svg$/,
      use: [
        {
          loader: "@svgr/webpack",
          options: {
            svgo: false,
          },
        },
      ],
    });
    return config;
  },

Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion
何も取得していないときはカードの表示をさせたくないかもです

            {imageURL && prizeImage.bucketName && prizeImage.fileName && (
              <Image src={imageURL} alt="PrizeImage" fill />
            )}

@AKIYAMA-HAYATE
Copy link
Collaborator Author

修正しました。
確認お願いします

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

コンポーネント分け
2 participants