-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(visualizer): update block colors (#1193)
* feat(visualizer): update block colors * chore: rename visualizer component to NovaVisualizer * feat: adapt color legend to combile multi colors --------- Co-authored-by: Begoña Alvarez <[email protected]>
- Loading branch information
1 parent
0590809
commit e895097
Showing
11 changed files
with
194 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from "react"; | ||
import { useGetThemeMode } from "~/helpers/hooks/useGetThemeMode.js"; | ||
import { VisualizerRouteProps } from "~/app/routes/VisualizerRouteProps.js"; | ||
import { RouteComponentProps } from "react-router-dom"; | ||
import VisualizerInstance from "./VisualizerInstance"; | ||
|
||
export default function NovaVisualizer(props: RouteComponentProps<VisualizerRouteProps>): React.JSX.Element { | ||
const theme = useGetThemeMode(); | ||
|
||
return <VisualizerInstance key={theme} {...props} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
client/src/features/visualizer-threejs/wrapper/ColorPanel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React, { memo } from "react"; | ||
|
||
const ColorPanel = ({ label, color }: { label: string; color: string | string[] }): React.JSX.Element => ( | ||
<div className="key-panel-item"> | ||
{Array.isArray(color) ? ( | ||
<div className="key-panel-item-multi-color"> | ||
{color.map((c, index) => ( | ||
<div | ||
key={`${label}-${index}`} | ||
className="key-marker" | ||
style={{ | ||
backgroundColor: c, | ||
}} | ||
/> | ||
))} | ||
</div> | ||
) : ( | ||
<div | ||
className="key-marker" | ||
style={{ | ||
backgroundColor: color, | ||
}} | ||
/> | ||
)} | ||
<div className="key-label">{label}</div> | ||
</div> | ||
); | ||
|
||
export default memo(ColorPanel); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.