-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feature/sof 6727 #127
Feature/sof 6727 #127
Conversation
Added TS, imported cove.js package and necessary packages for it to work, viewSettingsToolbar is moved to Dropdown and actions work, probably broke that one when updating the cove.js locally
"underscore.string": "^3.3.4" | ||
"underscore.string": "^3.3.4", | ||
"@exabyte-io/cove.js": "2023.7.14-0", | ||
"@mui/lab": "^5.0.0-alpha.120", |
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.
Why do we need this?
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.
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.
@zoomchik - do we need this? Any way to avoid?
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.
@timurbazhirov We need this packages as peerDependencies at least to avoid multiple copies of React. https://legacy.reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react
src/components/ThreeDEditor.jsx
Outdated
import { WaveComponent } from "./WaveComponent"; | ||
|
||
const darkTheme = createTheme({ |
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.
We should use the cove.js theme
fullWidth: boolean; | ||
} | ||
|
||
export const DefaultDropdownButton = function ({ |
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.
Why do we even need this component? It's just using the default Button
src/components/dropdown/Dropdown.tsx
Outdated
/** | ||
* MUI dropdown component have a default button with dropdown also could be used with | ||
* custom button which takes from children, actions array -> array which will be converted | ||
* to dropdown menu items. |
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.
This sentence is not understandable, plus has many grammatic errors
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.
Sure it is. I've noticed it too, but this was just a test so I just copied to use the component.
src/components/dropdown/Dropdown.tsx
Outdated
{...popperProps} | ||
> | ||
{({ TransitionProps }) => ( | ||
<Grow {...TransitionProps} style={{ transformOrigin: "center top" }}> |
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.
Why do we need all this stuff?? There's a Dropdown component in cove.js that we should update to deal with the necessary logic
{...popperProps} | ||
> | ||
{({ TransitionProps }) => ( | ||
<Grow {...TransitionProps} style={{ transformOrigin: "center top" }}> |
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.
Code here is exactly the same as in the component above - remove duplicates
src/react-app-env.d.ts
Outdated
@@ -0,0 +1 @@ | |||
/// <reference types="react-scripts" /> |
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.
WTH is this?
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.
It was created during npm run start
. I'll look into tsconfig.json, how it's handled in other packages.
src/components/ThreeDEditor.jsx
Outdated
import Replay from "@mui/icons-material/Replay"; | ||
import Spellcheck from "@mui/icons-material/Spellcheck"; | ||
import SquareFootIcon from "@mui/icons-material/SquareFoot"; | ||
import SwitchCamera from "@mui/icons-material/SwitchCamera"; | ||
import ThreeDRotation from "@mui/icons-material/ThreeDRotation"; | ||
import { createTheme, ThemeProvider, Tooltip } from "@mui/material"; | ||
// import { styled } from "@mui/system";; | ||
import { ButtonGroup, createTheme, ThemeProvider, Tooltip } from "@mui/material"; |
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.
Do not import the whole lib, import individual components eg. import from "@mui/material/Tooltip";
… conditional rendering
…xtension and override
… feature/SOF-6727
src/components/ParametersMenu.tsx
Outdated
@@ -68,6 +67,7 @@ function ParametersMenu(props: ParametersMenuProps) { | |||
className="inverse stepper cell-repetitions" | |||
id={`repetitionsAlongLatticeVector${label}`} | |||
value={ | |||
// @ts-ignore | |||
(viewerSettings as { [key: string]: any })[ |
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 we use ViewerSettings type above?
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.
@zoomchik with help from Alex I went with defining type of key:
type ViewerSettingsKey = keyof ViewerSettings;
const key = `repetitionsAlongLatticeVector${label}` as ViewerSettingsKey;
Draft PR