Skip to content

Commit

Permalink
fix: 表情包路由 评分数量
Browse files Browse the repository at this point in the history
  • Loading branch information
Dearkano committed Dec 19, 2018
1 parent 103e596 commit c818d38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/pages/Editor/Editor/ToolBox/StickerBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const BaseUrl = 'https://www.cc98.org/static/images'
function getStickerReactNode(type: StickerType, handleFunc: Function) {
const stickerArr = []

const suffix = type === 'em' ? 'gif' : 'png'
const suffix = type === 'em' ? 'gif' : type === 'ac' ? 'jpg' : 'png'
let start = 1
let end = 54

Expand All @@ -50,7 +50,12 @@ function getStickerReactNode(type: StickerType, handleFunc: Function) {

for (let i = start; i <= end; i++) {
const number = i < 10 ? `0${i}` : `${i}`
const url = type === 'ac' ? `${type}-mini/${number}` : `${type}-mini/${type}${number}`
const url =
type === 'ac'
? `${type}-mini/${number}`
: type === 'em'
? `${type}/${type}${number}`
: `${type}-mini/${type}${number}`

stickerArr.push(
<Img src={`${BaseUrl}/${url}.${suffix}`} onClick={handleFunc(`${type}${number}`)} />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Topic/PostItem/Awards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const Awards = ({ awards }: Props) => {
{showExpanded && !expanded && (
<TableRowS>
<CellShowMore colSpan={SHOW_AWARDS_NUM} onClick={() => setExpanded(true)}>
展开剩余{awards ? awards.length : 0 - SHOW_AWARDS_NUM}个评分
展开剩余{awards ? awards.length - SHOW_AWARDS_NUM : 0}个评分
</CellShowMore>
</TableRowS>
)}
Expand Down

0 comments on commit c818d38

Please sign in to comment.