-
Notifications
You must be signed in to change notification settings - Fork 51
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
Move recenter button #565
Move recenter button #565
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update icon, or it will be affected with upcoming changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use svgLibBuilder.js, all icons are generated by script, otherwise your changes will be affected with new Icon update. To use this script, just add desired svg Icon to public/svg-icons with proper name, and run node ./svgLibBuilder.js
Styling of Icon should be though parenst color and font-size
@@ -36,6 +29,28 @@ export const Overlay = () => { | |||
) | |||
} | |||
|
|||
const CameraCenterButton = styled(Button)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please, use Button from material-ui ?, size="large" is what you need, it has all hover/active effects applied, just change width, border-radius
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to get the svg generation to work. However, when using material-ui button I am unable to get it to render properly or to be intractable. This is what I'm trying right now:
import { Button } from '@mui/material'
export const Overlay = () => {
...
<CameraCenterButton
disabled={false}
href=""
onClick={() => setCameraFocusTrigger(!cameraFocusTrigger)}
size="large"
startIcon={<CameraCenterIcon/>}
/>
...
)}
const CameraCenterButton = styled(Button)`
position: absolute;
right: 20px;
top: 102px;
z-index: 20px;
width: 32px;
height: 32px;
border-radius: 50%;
display: flex;
padding: 8px 8px 9px 8px;
justify-content: center;
align-items: center;
flex-shrink: 0;
background: var(--BG-1, #23252f);
`;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { Button } from '@mui/material'
it is not interactive, because its parent wrapper has pointer-events: none css property, to make it work, just add pointer-events: all to the button styles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const CameraCenterButton = styled(Button)`
&& {
position: absolute;
right: 20px;
bottom: 102px;
padding: 0;
width: 32px;
min-width: auto;
justify-content: center;
align-items: center;
pointer-events: all;
.MuiButton-startIcon {
margin-left: 0;
}
}
`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the help! all the changes should be ready, but let me know if I should change anything else. I wasn't seeing any hover effects applied so I added them manually and tried to match the style of the layout change buttons below. If there's a better way to go about this let me know!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hove effects are applied at theme level, so you can remove those here, also background it not required, it is also set on theme options. Just copy past code that I provided, should work fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just removed hover effects!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@kevkevinpal Ok to merge? |
closes: #508
I'm done with the styling, but for some reason anything in the overlay layer can't be interacted with. All events go straight to the universe.