-
Notifications
You must be signed in to change notification settings - Fork 0
作品作成画面の対応拡張子のポップアップ #235
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
Open
yuki6ra
wants to merge
10
commits into
develop
Choose a base branch
from
feat/info-tooltip-#212
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
作品作成画面の対応拡張子のポップアップ #235
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f5c7684
feat: information tool tip
yuki6ra 85b447e
feat: import InfoPopOver to AssetUpload, ThumbnailUpload
yuki6ra 6e29f35
style: change component Name
yuki6ra 032d64d
refactor: interface
yuki6ra 611ecf8
refactor: add supportExtension in constants
yuki6ra 8afed66
refactor: import extensions
yuki6ra b6d7332
refactor: add asset accept constants
yuki6ra 679563a
refactor: generate asset extensions
yuki6ra 4ae3a45
fix: console
yuki6ra a810fbd
refactor: update supportedExts type in SupportExtPopOver and Thumbnai…
yuki6ra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/domains/Work/components/WorkEdit/presentations/items/SupportExtPopOver.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import type { FC } from 'react'; | ||
|
|
||
| import { Info } from 'lucide-react'; | ||
|
|
||
| import { Horizontal } from '@/components/Layout/Horizontal'; | ||
| import { Vertical } from '@/components/Layout/Vertical'; | ||
| import { | ||
| Tooltip, | ||
| TooltipContent, | ||
| TooltipProvider, | ||
| TooltipTrigger, | ||
| } from '@/components/ui/Tooltip'; | ||
| import { Typography } from '@/components/ui/Typography'; | ||
|
|
||
| type Props = { | ||
| supportedExts: { category: string; exts: string[] }[]; | ||
| }; | ||
|
|
||
| export const SupportExtPopOver: FC<Props> = ({ supportedExts }) => ( | ||
| <TooltipProvider> | ||
| <Tooltip> | ||
| <TooltipTrigger> | ||
| <Info size={16} color="#757575" /> | ||
| </TooltipTrigger> | ||
|
|
||
| <TooltipContent className="rounded-md relative border-2 bg-white border-orange-pop text-[10px]"> | ||
| <Horizontal className="gap-1"> | ||
| <Typography variant="strong">対応形式:</Typography> | ||
| {supportedExts.map(({ category, exts }) => ( | ||
| <Vertical key={category} className="pl-4 gap-1"> | ||
| <Typography variant="strong">{category}</Typography> | ||
| <Typography variant="strong"> | ||
| <Vertical className="gap-1"> | ||
| [ | ||
| <Vertical className="gap-1"> | ||
| {exts.map((ext) => ( | ||
| <span key={ext}>.{ext}</span> | ||
| ))} | ||
| </Vertical> | ||
| ] | ||
| </Vertical> | ||
| </Typography> | ||
| </Vertical> | ||
| ))} | ||
| </Horizontal> | ||
| </TooltipContent> | ||
| </Tooltip> | ||
| </TooltipProvider> | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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に切り出しても良き)
https://github.com/Kyutech-C3/ToyBox_front_replace/blob/d0bb9a5915eb678c6c15ddaddc7f6861686ad48b/src/domains/Work/components/WorkEdit/presentations/items/AssetUpload.tsx#L70C4-L82C9
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の内容と外れるので分けた方がいいとは思いますけどそこまで大きいタスクでもないのでやりやすい方で任せます