Skip to content

Commit

Permalink
fix: update previous utils to match dev
Browse files Browse the repository at this point in the history
  • Loading branch information
byhow committed Jul 30, 2024
1 parent 7cf443e commit d65fc1f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 198 deletions.
2 changes: 1 addition & 1 deletion src/common/utils/text/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './article'
export * from './moment'
export * from './notice'
export * from './tag'
export * from './user'

Expand Down
90 changes: 0 additions & 90 deletions src/common/utils/text/moment.test.ts

This file was deleted.

105 changes: 0 additions & 105 deletions src/common/utils/text/moment.ts

This file was deleted.

7 changes: 5 additions & 2 deletions src/components/Notice/NoticeMomentTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useContext } from 'react'
import { useIntl } from 'react-intl'

import { TEST_ID } from '~/common/enums'
import { stripHtml, toPath, truncateMomentTitle } from '~/common/utils'
import { stripHtml, toPath, truncateNoticeTitle } from '~/common/utils'
import { LanguageContext } from '~/components'
import { NoticeMomentTitleFragment } from '~/gql/graphql'

Expand All @@ -23,7 +23,10 @@ const NoticeMomentTitle = ({
moment,
})

const title = truncateMomentTitle(stripHtml(moment.content || ''), 10, lang)
const title = truncateNoticeTitle(stripHtml(moment.content || ''), {
maxLength: 10,
locale: lang,
})
const images = moment.assets.length
? intl
.formatMessage({ defaultMessage: `[image]`, id: 'W3tqQO' })
Expand Down

0 comments on commit d65fc1f

Please sign in to comment.