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

Move recenter button #565

Merged
merged 13 commits into from
Nov 10, 2023
Merged

Conversation

cosmicpotato137
Copy link
Contributor

@cosmicpotato137 cosmicpotato137 commented Nov 3, 2023

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.

Copy link
Collaborator

@Rassl Rassl left a 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

Copy link
Collaborator

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)`
Copy link
Collaborator

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

Copy link
Contributor Author

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);
`;

Copy link
Collaborator

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

Copy link
Collaborator

@Rassl Rassl Nov 6, 2023

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;
}

}
`

Copy link
Contributor Author

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!

Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just removed hover effects!

Copy link
Collaborator

@Rassl Rassl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tomsmith8
Copy link
Contributor

@kevkevinpal Ok to merge?

@kevkevinpal kevkevinpal merged commit 378004e into stakwork:master Nov 10, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move recenter map
4 participants