Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| 必須 | ||
| </Typography> | ||
| <InfoPopOver> | ||
| {`対応形式:\n 画像[.png .jpg .jpeg .bmp .gif]\n 動画[.mp4 .mov]\n 音源[.mp3 .wav .m4a ]\n モデル[.gltf .fbx]\n zip[.zip]`} |
There was a problem hiding this comment.
文字の前後の空白を入れるか入れないかで統一してほしいです
[.xxx] or [ .xxx ]
前者なら以下の修正
| {`対応形式:\n 画像[.png .jpg .jpeg .bmp .gif]\n 動画[.mp4 .mov]\n 音源[.mp3 .wav .m4a ]\n モデル[.gltf .fbx]\n zip[.zip]`} | |
| {`対応形式:\n 画像[.png .jpg .jpeg .bmp .gif]\n 動画[.mp4 .mov]\n 音源[.mp3 .wav .m4a]\n モデル[.gltf .fbx]\n zip[.zip]`} |
| 必須 | ||
| </Typography> | ||
| <InfoPopOver> | ||
| {`対応形式:\n 画像[.png .jpg .jpeg .bmp .gif]\n 動画[.mp4 .mov]\n 音源[.mp3 .wav .m4a ]\n モデル[.gltf .fbx]\n zip[.zip]`} |
There was a problem hiding this comment.
<br />じゃだめ?(特に要件とか仕様は確認してないので,何か理由があるなら無視してOK.)
| {`対応形式:\n 画像[.png .jpg .jpeg .bmp .gif]\n 動画[.mp4 .mov]\n 音源[.mp3 .wav .m4a ]\n モデル[.gltf .fbx]\n zip[.zip]`} | |
| 対応形式: | |
| <br /> | |
| 画像[.png .jpg .jpeg .bmp .gif] | |
| <br /> | |
| 動画[.mp4 .mov] | |
| <br /> | |
| 音源[.mp3 .wav .m4a ] | |
| <br /> | |
| モデル[.gltf .fbx] | |
| <br /> | |
| zip[.zip] |
| children: ReactNode; | ||
| }; | ||
|
|
||
| export const InfoPopOver: FC<Props> = ({ children }) => ( |
There was a problem hiding this comment.
Infoだと情報が薄くて何の情報なのかわかりづらいからSupportExtPopOverとかにしてもいいかも
| 必須 | ||
| </Typography> | ||
| <InfoPopOver> | ||
| {`対応形式:\n 画像[.png .jpg .jpeg .bmp .gif]\n 動画[.mp4 .mov]\n 音源[.mp3 .wav .m4a ]\n モデル[.gltf .fbx]\n zip[.zip]`} |
There was a problem hiding this comment.
拡張子情報は親要素から受け取るわけじゃないからpopoverの中に隠蔽しちゃっていいと思う
There was a problem hiding this comment.
って思ったけどこれアセットとサムネイルで違うのか
| <TooltipContent className="rounded-md relative text-xl border-2 bg-white border-orange-pop"> | ||
| <p className="whitespace-pre-wrap text-[10px] font-bold">{children}</p> | ||
| </TooltipContent> |
There was a problem hiding this comment.
| <TooltipContent className="rounded-md relative text-xl border-2 bg-white border-orange-pop"> | |
| <p className="whitespace-pre-wrap text-[10px] font-bold">{children}</p> | |
| </TooltipContent> | |
| <TooltipContent className="rounded-md relative text-xl border-2 bg-white border-orange-pop"> | |
| { | |
| supportedExts.map(({category,exts})=>( | |
| <Vertical> | |
| <Typography> | |
| {category} | |
| </Typography> | |
| <span> | |
| [ | |
| <Vertical> | |
| { | |
| exts.map((ext)=>( | |
| <p> | |
| .{ext} | |
| </p> | |
| )) | |
| } | |
| <Vertical> | |
| ] | |
| </Vertical> | |
| )) | |
| } | |
| </TooltipContent> |
冗長ではあると思うけど私だったらこういうふうに書くかも(動くかどうかは確かめてない、あくまでイメージ)
supportedExtっていうpropsを取ってそれを元にPopoverがレンダリングする
supportedExtはcategoryとextsをkeyに持つ構造体の配列
で親からsupportedExtを渡すだけでpopoverが統一されたスタイルでレンダリングをしてくれる
親が渡すsupportedExtは固定値で持っておけば何か変更があったとしても構造体を変えるだけでそれまでと同様のスタイルが保てる(文字列だと開発者がスタイルを気にして開発しなきゃいけなくなる(ドットだったりスペースだったり))
There was a problem hiding this comment.
ありがとうございます 勉強になりま
そんな感じにしてみます
| 必須 | ||
| </Typography> | ||
| <SupportExtPopOver | ||
| supportedExts={[ |
There was a problem hiding this comment.
supportedExtsは別で変数化して渡すだけにする
src/contstantsに記述する
Thumbnailも同様の変更が必要
メリット
対応拡張子が増えたときに編集する箇所がconstantsだけになりuiファイルに変更が起きないため意図しない変更が起きづらい
もし可能であればinputのaccept fileもsupportedExtsを参照するようにしたい(これは別issueに切り出しても良き)
There was a problem hiding this comment.
了解です
とりあえずsupportedExtsはやります
inputの方はついででできる感じならしますけどissue切り出す?
There was a problem hiding this comment.
個人的にはissueの内容と外れるので分けた方がいいとは思いますけどそこまで大きいタスクでもないのでやりやすい方で任せます
| export const ASSET_ACCEPT_EXTENSIONS = | ||
| 'image/png, image/jpeg, image/jpg, image/bmp, image/gif, video/mp4, video/mov, audio/mp3, audio/wav, audio/m4a, model/gltf, model/fbx, application/zip'; |
There was a problem hiding this comment.
ここは静的なものではなくASSET_EXTENSIONSから生成するようにしてください
|
お願いします |
| ? `${assets.length}件のアセットをアップロード済み` | ||
| : 'アセットをアップロードしてください'} | ||
| export const AssetUpload: FC<Props> = ({ handleUploadAssets, assets }) => { | ||
| console.log('asset: ', ASSET_ACCEPT_EXTENSIONS); |
| category: 'zip', | ||
| exts: ['zip'], | ||
| }, | ||
| ]; |
There was a problem hiding this comment.
| category: '画像', | ||
| exts: ['png', 'jpg', 'jpeg', 'bmp', 'gif'], | ||
| }, | ||
| ]; |



issue番号
closes #212
変更点概要
itemsの中にInfoPopOverを作成しましたAssetUpload.tsxとThumbnailUpload.tsxに追加しました参考文献(あれば)
https://lucide.dev/icons/info
スクリーンショット(必要であれば)
チェック項目
self assignしたか