feat: support series argument for unlockCg#954
Open
ChangeSuger wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request implements grouping and ordering for CG assets in the gallery by adding an 'order' property to the asset interface and updating the 'changeBg' and 'unlockCg' scripts. The gallery UI was refactored to group assets by series and sort them, while the preview component now supports cycling through grouped images. Feedback was provided to remove a redundant 'isImage' memoization in 'ExtraCgElement.tsx' to simplify the code.
Comment on lines
32
to
+35
| const isImage = useMemo(() => { | ||
| const extension = props.resourceUrl.split('.').pop()?.toLowerCase() || ''; | ||
| const extension = previewResource.url.split('.').pop()?.toLowerCase() || ''; | ||
| return ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg', 'bmp'].includes(extension); | ||
| }, [props.resourceUrl]); | ||
| }, [previewResource.url]); |
Contributor
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
changeCg指令的series参数目前似乎完全没使用,补充了一下基于 series 将 cg 进行分组的逻辑,并增加order参数,用于控制统一分组下 CG 的展示顺序。在预览时,如果有多张图片,点击图片会切换到下一张图片,如果没有下一张,则退出预览状态。
此外,基于 series 进行分组逻辑只针对图片,视频仍单独展示。