Skip to content

Commit

Permalink
Working on new modal for managing assemblies in the scnee
Browse files Browse the repository at this point in the history
  • Loading branch information
HunterBarclay committed Mar 16, 2024
1 parent fd18b1e commit 18a406d
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 22 deletions.
2 changes: 1 addition & 1 deletion fission/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/synthesis-logo.svg" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Synthesis | Fission</title>
<title>Fission | Synthesis</title>
</head>
<body>
<div id="root"></div>
Expand Down
38 changes: 19 additions & 19 deletions fission/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,44 +18,44 @@
"@barclah/jolt-physics": "^0.19.1",
"@react-three/drei": "^9.96.5",
"@react-three/fiber": "^8.15.15",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"three": "^0.159.0",
"colord": "^2.9.3",
"framer-motion": "^10.13.1",
"react": "^18.2.0",
"react-colorful": "^5.6.1",
"react-icons": "^4.10.1"
"react-dom": "^18.2.0",
"react-icons": "^4.10.1",
"three": "^0.159.0"
},
"devDependencies": {
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@types/three": "^0.160.0",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.15.6",
"@types/node": "^20.4.4",
"@types/pako": "^2.0.3",
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@types/three": "^0.160.0",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^8.56.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"pako": "^2.1.0",
"protobufjs": "^7.2.6",
"protobufjs-cli": "^1.1.2",
"typescript": "^5.2.2",
"vite": "^5.1.4",
"vitest": "^1.3.1",
"@types/node": "^20.4.4",
"@vitejs/plugin-react": "^4.0.3",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.14",
"cssnano": "^6.0.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"pako": "^2.1.0",
"postcss": "^8.4.26",
"prettier": "^3.0.0",
"protobufjs": "^7.2.6",
"protobufjs-cli": "^1.1.2",
"tailwindcss": "^3.3.3",
"tsconfig-paths": "^4.2.0",
"vite-plugin-singlefile": "^0.13.5"
"typescript": "^5.2.2",
"vite": "^5.1.4",
"vite-plugin-singlefile": "^0.13.5",
"vitest": "^1.3.1"
}
}
2 changes: 2 additions & 0 deletions fission/src/Synthesis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import ScoringZonesPanel from "./panels/configuring/scoring/ScoringZonesPanel"
import ZoneConfigPanel from "./panels/configuring/scoring/ZoneConfigPanel"
import ScoreboardPanel from "./panels/information/ScoreboardPanel"
import DriverStationPanel from "./panels/simulation/DriverStationPanel"
import ManageAssembliesModal from './modals/spawning/ManageAssembliesModal.tsx';

const DEFAULT_MIRA_PATH = 'test_mira/Team_2471_(2018)_v7.mira';

Expand Down Expand Up @@ -255,6 +256,7 @@ const initialModals = [
<MatchModeModal modalId="match-mode" />,
<SpawningModal modalId="spawning" />,
<ConfigMotorModal modalId="config-motor" />,
<ManageAssembliesModal modalId="manage-assembles" />,
]

const initialPanels: ReactElement[] = [
Expand Down
5 changes: 5 additions & 0 deletions fission/src/components/MainHUD.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ const MainHUD: React.FC = () => {
onClick={() => openModal("spawning")}
/>
<div className="flex flex-col gap-0 bg-background w-full rounded-3xl">
<MainHUDButton
value={"Manage Assemblies"}
icon={<FaGear />}
onClick={() => openModal("manage-assembles")}
/>
<MainHUDButton
value={"Settings"}
icon={<FaGear />}
Expand Down
5 changes: 3 additions & 2 deletions fission/src/components/ScrollView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import React, { ReactNode } from "react"
type ScrollViewProps = {
children?: ReactNode
className?: string
maxHeight?: string
}

const ScrollView: React.FC<ScrollViewProps> = ({ className, children }) => {
const ScrollView: React.FC<ScrollViewProps> = ({ className, maxHeight, children }) => {
return (
<div
className={`bg-background-secondary p-4 rounded-md max-h-full w-full ${className} overflow-y-scroll`}
className={`bg-background-secondary p-4 rounded-md ${maxHeight ? maxHeight : 'max-h-70vh'} w-full overflow-y-scroll ${className}`}
>
{children}
</div>
Expand Down
48 changes: 48 additions & 0 deletions fission/src/modals/spawning/ManageAssembliesModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React from "react"
import Modal, { ModalPropsImpl } from "../../components/Modal"
import { FaPlus } from "react-icons/fa6"
import ScrollView from "@/components/ScrollView"

const ManageAssembliesModal: React.FC<ModalPropsImpl> = ({ modalId }) => {
// update tooltip based on type of drivetrain, receive message from Synthesis
// const { showTooltip } = useTooltipControlContext()

return (
<Modal
name={"Manage Assemblies"}
icon={<FaPlus />}
modalId={modalId}
onAccept={() => {
// showTooltip("controls", [
// { control: "WASD", description: "Drive" },
// { control: "E", description: "Intake" },
// { control: "Q", description: "Dispense" },
// ]);
}
}
>
<ScrollView maxHeight="max-h-70vh" className="h-64" children={
<div>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
</div>
}>
</ScrollView>
</Modal>
)
}

export default ManageAssembliesModal
3 changes: 3 additions & 0 deletions fission/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export default {
theme: {
extend: {
colors: colors,
maxHeight: {
'70vh': '70vh',
}
},
},
safelist: safelist,
Expand Down

0 comments on commit 18a406d

Please sign in to comment.