Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mf-5560 twitter toolbar DOM gets updated #11050

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface PostDialogHintUIProps extends withClasses<'buttonTransform' | 'iconBut
const useStyles = makeStyles()((theme) => ({
button: {
// TODO: is it correct? (what about twitter?)
padding: isMobileFacebook ? 0 : '7px',
padding: isMobileFacebook ? 0 : '10px',
},
text: {
color: theme.palette.grey[300],
Expand All @@ -42,12 +42,12 @@ const ICON_MAP: Record<string, JSX.Element> = {
default: <Icons.SharpMask size={17} color={MaskColors.light.maskColor.publicTwitter} />,
}

const EntryIconButton = memo((props: PostDialogHintUIProps) => {
const EntryIconButton = memo(function EntryIconButton(props: PostDialogHintUIProps) {
const { t } = useMaskSharedTrans()
const { tooltip, disableGuideTip } = props
const { classes, cx } = useStyles(undefined, { props })

const getEntry = () => (
const Entry = (
<ShadowRootTooltip
title={t('mask_network')}
placement={tooltip?.placement}
Expand All @@ -66,10 +66,10 @@ const EntryIconButton = memo((props: PostDialogHintUIProps) => {
)

return disableGuideTip ? (
getEntry()
Entry
) : (
<GuideStep step={4} total={4} tip={t('user_guide_tip_4')} onComplete={props.onHintButtonClicked}>
{getEntry()}
{Entry}
</GuideStep>
)
})
Expand Down
6 changes: 4 additions & 2 deletions packages/mask/src/site-adaptors/twitter.com/utils/selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ export const postEditorContentInPopupSelector: () => LiveSelector<E, true> = ()
'[aria-labelledby="modal-header"] > div:first-child > div:first-child > div:first-child > div:nth-child(3)',
)
export const postEditorInPopupSelector: () => LiveSelector<E, true> = () =>
querySelector<E>('[aria-labelledby="modal-header"] div[data-testid="toolBar"] div[data-testid="geoButton"]')
querySelector<E>(
'[aria-labelledby="modal-header"] div[data-testid="toolBar"] [role="presentation"]:has(> div[data-testid="geoButton"])',
)
export const sideBarProfileSelector: () => LiveSelector<E, true> = () =>
querySelector<E>('[role="banner"] [role="navigation"] [data-testid="AppTabBar_Profile_Link"] > div')
export const postEditorInTimelineSelector: () => LiveSelector<E, true> = () =>
Expand Down Expand Up @@ -267,7 +269,7 @@ export const searchTwitterAvatarNFTLinkSelector = () => querySelector<E>('a[href

export const searchReplyToolbarSelector = () =>
querySelector<E>('div[data-testid="primaryColumn"] div[data-testid="toolBar"]').querySelector<E>(
'div[data-testid="geoButton"]',
'[role="presentation"]:has(> div[data-testid="geoButton"])',
)

// nameTag dom
Expand Down
Loading