Skip to content

Commit 94f7ba9

Browse files
Merge branch 'yoution-issue_96' into nav-bugbash-2
2 parents 979b3fd + 1f4b154 commit 94f7ba9

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

dist/dev/index.js

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/prod/index.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/ChosenArrow/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import styles from './styles.module.scss'
55
const ChosenArrow = ({ show, x }) => (
66
<div
77
className={styles.chosenArrow}
8-
style={{ transform: `translateX(calc(${x}px - 50%))` }}
8+
style={{ transform: `translateX(${x}px)` }}
99
hidden={!show}
1010
>
1111
<svg width='40px' height='10px' viewBox='0 0 40 10'>

src/components/ChosenArrow/styles.module.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.chosenArrow {
44
position: absolute;
55
bottom: -1px;
6-
left: 0;
6+
left: -20px;
77
z-index: 1;
88
-webkit-transition: -webkit-transform 0.5s;
99
transition: transform 0.5s;

src/components/IconSelect/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import styles from './styles.module.scss'
44

55
const IconSelect = ({ show, x, isResize }) => {
66
let styleObj = {
7-
transform: `translateX(calc(${x}px - 50%))`
7+
transform: `translateX(${x}px)`
88

99
}
1010
// is window is on resize, stop animation

src/components/IconSelect/styles.module.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.iconSelect {
44
position: absolute;
55
bottom: -1px;
6-
left: 0;
6+
left: -7px;
77
width: 15px;
88
height: 3px;
99
border-radius: 1.5px;

src/components/TopNav/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ const TopNav = ({
115115
const rect = el.getBoundingClientRect()
116116
return {
117117
...menu,
118-
initialX: rect.left
118+
initialX: rect.x || rect.left
119119
}
120120
}))
121121
}, [cache.refs, cache.slide])
122122

123123
const getMenuCenter = useCallback(menuId => {
124124
const el = cache.refs[menuId]
125125
const rect = el.getBoundingClientRect()
126-
return rect.left + rect.width / 2
126+
return (rect.x || rect.left) + rect.width / 2
127127
}, [cache.refs])
128128

129129
const setChosenArrowPos = useCallback(menuId => {
@@ -269,7 +269,7 @@ const TopNav = ({
269269
cache.slide[menu.id] = false
270270
const el = cache.refs[menu.id]
271271
const rect = el.getBoundingClientRect()
272-
const relativeX = menu.initialX - rect.left
272+
const relativeX = menu.initialX - (rect.x || rect.left)
273273
el.style.transform = `translateX(${relativeX}px)`
274274
setTimeout(() => {
275275
el.style.transition = 'transform 250ms ease-out'

0 commit comments

Comments
 (0)