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

画像一覧表示画面の作成 #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

m-star18
Copy link
Member

概要

画像表示画面の作成

画面(スクリーンショット)

スマホバージョン
all_picture
タブレットバージョン
all_picture2

レビュー時に見てほしいところ

  • next.config.jsにbackendから受け取った画像のurl(ドメイン)を追加しないといけないんだけど, 正しいものが指定されているか
  • 画像表示のstylingに問題がないか
    あたりを中心に見てほしいです.

@m-star18 m-star18 added task:frontend frontend task type:feature Feature Request labels Dec 15, 2022
@m-star18 m-star18 requested review from kobapi28 and myuto7 December 15, 2022 13:39
@m-star18 m-star18 self-assigned this Dec 15, 2022
@vercel
Copy link

vercel bot commented Dec 15, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
hacku-kosen-2022-frontend ✅ Ready (Inspect) Visit Preview Dec 15, 2022 at 3:57PM (UTC)

next.config.js Outdated
@@ -2,6 +2,6 @@ module.exports = {
// Your existing module.exports
reactStrictMode: true,
images: {
domains: [""],
domains: ["hacku-kosen-2022-backend-id432d3htq-an.a.run.app", "via.placeholder.com"],
Copy link
Contributor

Choose a reason for hiding this comment

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

https://nextjs.org/docs/api-reference/next/image#domains
僕もそこまでNext.js詳しくないので公式から引っ張ってきただけなんだけど、

images: {
  domains: ["..."],
}

で指定するよりも

images: {
  remotePatterns: [
    {
      protocol: 'https',
      hostname: 'example.com',
      port: '',
      pathname: '/account123/**',
    },
  ],
},

で指定してあげた方がいいみたい。domainsによる指定だとportとかまで指定できないからみたいなニュアンスっぽい。

Copy link
Contributor

Choose a reason for hiding this comment

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

これは別に対応mustではないかなというお気持ち(この開発スケジュール的には)

Copy link
Member Author

Choose a reason for hiding this comment

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

vercel/next.js#36783
via.placeholder.com はdomainのみを追加してほしいらしい
本番用の画像urlは下の書き方がいいと思った!

@@ -1,6 +1,8 @@
import Link from "next/link";
import { useRouter } from "next/router";
import Image from "next/legacy/image";
Copy link
Contributor

Choose a reason for hiding this comment

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

Starting with Next.js 13, the next/image component was rewritten to improve both the performance and developer experience. In order to provide a backwards compatible upgrade solution, the old next/image was renamed to next/legacy/image.

https://nextjs.org/docs/api-reference/next/legacy/image

legacyっぽい。

Copy link
Contributor

Choose a reason for hiding this comment

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

これもmustで対応するやつではない気がする(開発スケジュール的な話で)

Copy link
Contributor

@kobapi28 kobapi28 left a comment

Choose a reason for hiding this comment

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

[MSW] Warning: captured a request without a matching request handler:

• GET https://via.placeholder.com/150
If you still wish to intercept this unhandled request, please create a request handler for it.
Read more: https://mswjs.io/docs/getting-started/mocks
upstream image response failed for https://via.placeholder.com/150 403

こっちでは上手く表示できてない...
たぶんnext.config.jsdomain周りだろうなあとは思っている...

いや、mswとの噛み合わせかな?

@kobapi28
Copy link
Contributor

image

@m-star18
Copy link
Member Author

next/legacy/image の部分修正しといた!

@m-star18 m-star18 requested a review from kobapi28 December 15, 2022 16:07
@m-star18 m-star18 linked an issue Dec 16, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task:frontend frontend task type:feature Feature Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

画像表示画面の作成
2 participants