-
Notifications
You must be signed in to change notification settings - Fork 0
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
作品作成画面の対応拡張子のポップアップ #235
base: develop
Are you sure you want to change the base?
作品作成画面の対応拡張子のポップアップ #235
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -23,27 +24,10 @@ export const AssetUpload: FC<Props> = ({ handleUploadAssets, assets }) => ( | |||
<Typography className="text-red-500" variant="body2"> | |||
必須 | |||
</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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文字の前後の空白を入れるか入れないかで統一してほしいです
[.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]`} |
@@ -23,27 +24,10 @@ export const AssetUpload: FC<Props> = ({ handleUploadAssets, assets }) => ( | |||
<Typography className="text-red-500" variant="body2"> | |||
必須 | |||
</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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Info
だと情報が薄くて何の情報
なのかわかりづらいからSupportExtPopOver
とかにしてもいいかも
@@ -23,27 +24,10 @@ export const AssetUpload: FC<Props> = ({ handleUploadAssets, assets }) => ( | |||
<Typography className="text-red-500" variant="body2"> | |||
必須 | |||
</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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
拡張子情報は親要素から受け取るわけじゃないからpopoverの中に隠蔽しちゃっていいと思う
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
って思ったけどこれアセットとサムネイルで違うのか
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとうございます 勉強になりま
そんな感じにしてみます
@@ -23,27 +24,31 @@ export const AssetUpload: FC<Props> = ({ handleUploadAssets, assets }) => ( | |||
<Typography className="text-red-500" variant="body2"> | |||
必須 | |||
</Typography> | |||
<SupportExtPopOver | |||
supportedExts={[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supportedExts
は別で変数化して渡すだけにする
src/contstants
に記述する
Thumbnailも同様の変更が必要
メリット
対応拡張子が増えたときに編集する箇所がconstantsだけになりuiファイルに変更が起きないため意図しない変更が起きづらい
もし可能であればinputのaccept fileもsupportedExtsを参照するようにしたい(これは別issueに切り出しても良き)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
了解です
とりあえずsupportedExts
はやります
inputの方はついででできる感じならしますけどissue切り出す?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
個人的には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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここは静的なものではなくASSET_EXTENSIONSから生成するようにしてください
お願いします |
? `${assets.length}件のアセットをアップロード済み` | ||
: 'アセットをアップロードしてください'} | ||
export const AssetUpload: FC<Props> = ({ handleUploadAssets, assets }) => { | ||
console.log('asset: ', ASSET_ACCEPT_EXTENSIONS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.logは消してください
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ごめんなさい
category: 'zip', | ||
exts: ['zip'], | ||
}, | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as constをつけてください
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
category: '画像', | ||
exts: ['png', 'jpg', 'jpeg', 'bmp', 'gif'], | ||
}, | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as const
issue番号
closes #212
変更点概要
items
の中にInfoPopOver
を作成しましたAssetUpload.tsx
とThumbnailUpload.tsx
に追加しました参考文献(あれば)
https://lucide.dev/icons/info
スクリーンショット(必要であれば)
チェック項目
self assign
したか