Skip to content

Commit

Permalink
Add "Scroll" text to in-app tutorial highlights (#7356)
Browse files Browse the repository at this point in the history
Don't show in changelog
  • Loading branch information
4ian authored Jan 30, 2025
1 parent 2ba7075 commit bf7ecd9
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow
import * as React from 'react';
import { Trans } from '@lingui/macro';
import Rectangle from '../Utils/Rectangle';
import useOnResize from '../Utils/UseOnResize';
import useForceUpdate from '../Utils/UseForceUpdate';
Expand All @@ -13,6 +14,7 @@ import Mouse from '../UI/CustomSvgIcons/Mouse';
import useIsElementVisibleInScroll from '../Utils/UseIsElementVisibleInScroll';
import { aboveMaterialUiMaxZIndex } from '../UI/MaterialUISpecificUtil';
import { useResponsiveWindowSize } from '../UI/Responsive/ResponsiveWindowMeasurer';
import Text from '../UI/Text';

type Props = {|
element: HTMLElement,
Expand Down Expand Up @@ -40,6 +42,7 @@ const styles = {
boxShadow: `0 0 12px 2px ${highlighterPrimaryColor}`,
padding: '2px 5px 2px 2px',
borderRadius: 3,
gap: 1,
},
};

Expand Down Expand Up @@ -162,14 +165,17 @@ function InAppTutorialElementHighlighter({ element }: Props) {
? scrollParentRectangle.left + 15
: scrollDirection === 'right'
? scrollParentRectangle.right - 50
: elementRectangle.centerX() - 15,
: elementRectangle.centerX() - 35,
}}
>
<div style={styles.scrollDirectionArrow}>
{Icon && (
<>
<Icon fontSize="large" />
{isMobile ? <PointerFinger /> : <Mouse />}
<Text noMargin color="inherit">
<Trans>Scroll</Trans>
</Text>
</>
)}
</div>
Expand Down

0 comments on commit bf7ecd9

Please sign in to comment.