Skip to content

Commit

Permalink
fix(landing): set pointerEvents to avoid reset button overlap (#245)
Browse files Browse the repository at this point in the history
* fix(landing): set pointerEvents to avoid reset button overlap

Fixes CSB-2014

* chore(landing): dim reset button when code is unchanged

Closes CSB-2015
  • Loading branch information
matchai authored Dec 8, 2021
1 parent c8da242 commit 51be6cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions website/landing/components/Intro/Sections/Custom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export const CustomExample: React.FC = () => {
onClick={() => {
sandpack.updateCurrentFile(ORIGINAL_CODE);
}}
style={{ opacity: code === ORIGINAL_CODE ? 0.3 : 1 }}
>
<svg
fill="currentColor"
Expand Down
1 change: 1 addition & 0 deletions website/landing/components/Intro/Sections/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export const EditorExample: React.FC = () => {
sandpack.updateCurrentFile(ORIGINAL_CODE);
setOptions(ORIGINAL_CUSTOM);
}}
style={{ opacity: code === ORIGINAL_CODE ? 0.3 : 1 }}
>
<svg
fill="currentColor"
Expand Down
3 changes: 2 additions & 1 deletion website/landing/components/Intro/Sections/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,13 @@ export const FadeAnimation: React.FC = ({ children }) => {
],
[shouldAnimate ? 0 : 1, 1, 1, 1, 1, shouldAnimate ? 0 : 1]
);
const pointerEvents = opacity.get() ? "auto" : "none";

return (
<motion.li
ref={sectionRef}
className="fade-animation"
style={{ opacity, width: "100%" }}
style={{ opacity, pointerEvents, width: "100%" }}
>
{children}
</motion.li>
Expand Down

0 comments on commit 51be6cf

Please sign in to comment.