Skip to content

Commit

Permalink
fix(TagDigest): remove unused props
Browse files Browse the repository at this point in the history
  • Loading branch information
Kechicode committed Nov 13, 2024
1 parent 843247f commit 85008e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/components/TagDigest/Feed/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import Link from 'next/link'
import { TEST_ID } from '~/common/enums'
import { toPath } from '~/common/utils'
import { abbr } from '~/common/utils/number/abbr'
import { CardProps } from '~/components'
import { TagDigestFeedTagFragment } from '~/gql/graphql'

import styles from './styles.module.css'

export type TagDigestFeedProps = {
tag: TagDigestFeedTagFragment
} & CardProps
onClick?: () => void
}

const fragments = {
tag: gql`
Expand All @@ -24,7 +24,7 @@ const fragments = {
`,
}

const Feed = ({ tag, ...cardProps }: TagDigestFeedProps) => {
const Feed = ({ tag, onClick }: TagDigestFeedProps) => {
const path = toPath({
page: 'tagDetail',
tag,
Expand All @@ -33,7 +33,7 @@ const Feed = ({ tag, ...cardProps }: TagDigestFeedProps) => {
const numArticles = abbr(tag.numArticles, 2)

return (
<Link {...path} legacyBehavior>
<Link {...path} legacyBehavior onClick={onClick}>
<a className={styles.tag} data-test-id={TEST_ID.DIGEST_TAG_FEED}>
<span className={styles.name}>{tag.content}</span>&nbsp;
<span
Expand Down
9 changes: 1 addition & 8 deletions src/views/Tags/Feed.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _get from 'lodash/get'

import { analytics, mergeConnections, toPath } from '~/common/utils'
import { analytics, mergeConnections } from '~/common/utils'
import {
EmptyTag,
InfiniteScroll,
Expand Down Expand Up @@ -75,13 +75,6 @@ const Feed = ({ type }: Props) => {
<li key={tag.id} className={styles.listItem}>
<TagDigest.Feed
tag={tag}
spacing={[8, 0]}
href={
toPath({
page: 'tagDetail',
tag, // : node,
}).href
}
onClick={() =>
analytics.trackEvent('click_feed', {
type: trackingType,
Expand Down

0 comments on commit 85008e1

Please sign in to comment.