Skip to content

Commit

Permalink
fix: mismatch number tag (#11624)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuanyang233 committed May 15, 2024
1 parent a5e8daa commit 7e4f716
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const SideBarNativeItemPaddingRef = new ValueRef('11px')

function toolboxInSidebarSelector() {
// Organization account don't have a [data-testid=AppTabBar_More_Menu] in page. see MF-3866
return querySelector<HTMLElement>('[role="banner"] nav[role="navigation"] > div[data-testid=AppTabBar_More_Menu]')
return querySelector<HTMLElement>(
'[role="banner"] nav[role="navigation"] > button[data-testid=AppTabBar_More_Menu]',
)
}

export function injectToolboxHintAtTwitter(signal: AbortSignal, category: 'wallet' | 'application') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ export function postEditorContentInPopupSelector() {
)
}
export function postEditorInPopupSelector() {
return querySelector<E>(
'[aria-labelledby="modal-header"] div[data-testid="toolBar"] [role="presentation"]:has(> div[data-testid="geoButton"])',
)
return querySelector<E>('div[data-testid="toolBar"] [role="presentation"]:has(> button[data-testid="geoButton"])')
}
export function sideBarProfileSelector() {
return querySelector<E>('[role="banner"] [role="navigation"] [data-testid="AppTabBar_Profile_Link"] > div')
Expand Down Expand Up @@ -310,7 +308,7 @@ export function searchRetweetAvatarSelector() {

export function searchReplyToolbarSelector() {
return querySelector<E>(
'div[data-testid="primaryColumn"] div[data-testid="toolBar"] [role="presentation"]:has(> div[data-testid="geoButton"])',
'div[data-testid="primaryColumn"] div[data-testid="toolBar"] [role="presentation"]:has(> button[data-testid="geoButton"])',
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ export const RenderLinkFragment = memo(function RenderLink(
HashLink = Text,
} = context
const sharedProps = { style, children, suggestedPostImage }
if (category === 'cash') return <CashLink {...sharedProps} />

if (category === 'cash') {
if (/^\$\d+/.test(children)) return <Text {...sharedProps} />
return <CashLink {...sharedProps} />
}
if (category === 'hash') return <HashLink {...sharedProps} />
if (category === 'user') return <AtLink {...sharedProps} />
return <Link {...sharedProps} href={href} />
Expand Down

0 comments on commit 7e4f716

Please sign in to comment.