Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

// Native imports
import { useState } from "react"
import { useEffect, useState } from "react"

// 3rd Party Imports
import { Tabs, Accordion, Button, Modal, TextInput } from "@mantine/core"
Expand Down Expand Up @@ -64,9 +64,10 @@ export default function PreFlightChecklistTab({ tabPadding }) {
// Show error message
showErrorNotification("Name cannot be empty")
}

useEffect(() => {
AddCommand("new_preflight_checklist", () => setNewChecklistModal(true))
}, [])
// Add create new checklist as a spotlight command
AddCommand("new_preflight_checklist", () => setNewChecklistModal(true))

const items = preFlightChecklistItems.map((item) => (
<Accordion.Item
Expand Down
8 changes: 6 additions & 2 deletions gcs/src/components/navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ import { selectIsConnectedToSocket } from "../redux/slices/socketSlice.js"
import { twMerge } from "tailwind-merge"
import resolveConfig from "tailwindcss/resolveConfig"
import tailwindConfig from "../../tailwind.config.js"
import { useEffect } from "react"
const tailwindColors = resolveConfig(tailwindConfig).theme.colors

export default function Navbar() {
Expand Down Expand Up @@ -138,8 +139,11 @@ export default function Navbar() {
dispatch(setConnectionModal(true))
}

AddCommand("connect_to_drone", connectToDroneFromButton)
AddCommand("disconnect_from_drone", disconnect)
useEffect(() => {
AddCommand("connect_to_drone", connectToDroneFromButton)
AddCommand("disconnect_from_drone", disconnect)
}, [])


const linkClassName =
"text-md px-2 rounded-sm outline-none focus:text-falconred-400 hover:text-falconred-400 transition-colors delay-50"
Expand Down
Loading