-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(forms): 🎉 update forms and buttons
- Loading branch information
1 parent
7e118e6
commit a90ecbd
Showing
17 changed files
with
198 additions
and
239 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
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,27 @@ | ||
import { ReactElement } from "react"; | ||
import { IDetails } from "../../interfaces/robotInterfaces"; | ||
import { FormikProps } from "formik"; | ||
import CFInputToggle from "../CFInputToggle/CFInputToggle"; | ||
|
||
interface ICFBridgeToggle { | ||
formik: FormikProps<IDetails>; | ||
isImportRobot?: boolean; | ||
} | ||
|
||
export default function CFBridgeToggle({ | ||
formik, | ||
isImportRobot, | ||
}: ICFBridgeToggle): ReactElement { | ||
return ( | ||
<CFInputToggle | ||
labelName="ROS2 Bridge:" | ||
labelInfoTip="The ROS2 Bridge allows you to connect your robot to the ecosystem. This allows you to use ROS2 tools to interact with your robot." | ||
dataTut="create-robot-step1-ros2-bridge" | ||
disabled={isImportRobot} | ||
checked={formik?.values?.isEnabledROS2Bridge} | ||
onChange={(e: any) => { | ||
formik.setFieldValue("isEnabledROS2Bridge", e); | ||
}} | ||
/> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ReactElement } from "react"; | ||
import CFInputToggle from "../CFInputToggle/CFInputToggle"; | ||
import { IDetails } from "../../interfaces/robotInterfaces"; | ||
import { FormikProps } from "formik"; | ||
|
||
interface ICFDevMode { | ||
formik: FormikProps<IDetails>; | ||
isImportRobot?: boolean; | ||
} | ||
|
||
export default function CFDevMode({ | ||
formik, | ||
isImportRobot, | ||
}: ICFDevMode): ReactElement { | ||
return ( | ||
<CFInputToggle | ||
labelName="Development Mode:" | ||
labelInfoTip="Leave this option turned on if you want it to be able to build and launch on the robot you want" | ||
dataTut="create-robot-step1-development-mode" | ||
disabled={formik.isSubmitting || isImportRobot} | ||
checked={formik?.values?.isDevelopmentMode} | ||
onChange={(e: any) => formik.setFieldValue("isDevelopmentMode", e)} | ||
/> | ||
); | ||
} |
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,27 @@ | ||
import { ReactElement } from "react"; | ||
import CFInputToggle from "../CFInputToggle/CFInputToggle"; | ||
import { IDetails } from "../../interfaces/robotInterfaces"; | ||
import { FormikProps } from "formik"; | ||
|
||
interface ICFGPUToggle { | ||
formik: FormikProps<IDetails>; | ||
isImportRobot?: boolean; | ||
} | ||
|
||
export default function CFGPUToggle({ | ||
formik, | ||
isImportRobot, | ||
}: ICFGPUToggle): ReactElement { | ||
return ( | ||
<CFInputToggle | ||
labelName="GPU Usage Enabled for Cloud Instance:" | ||
labelInfoTip="If you want or need to GPU resource on cloud instance set active" | ||
dataTut="create-robot-step1-gpu-resource" | ||
disabled={formik.isSubmitting || isImportRobot} | ||
checked={formik?.values?.gpuEnabledForCloudInstance} | ||
onChange={(e: any) => | ||
formik.setFieldValue("gpuEnabledForCloudInstance", e) | ||
} | ||
/> | ||
); | ||
} |
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,27 @@ | ||
import { IDetails } from "../../interfaces/robotInterfaces"; | ||
import FormInputText from "../FormInputText/FormInputText"; | ||
import { ReactElement } from "react"; | ||
import { FormikProps } from "formik"; | ||
|
||
interface ICFRobotName { | ||
formik: FormikProps<IDetails>; | ||
isImportRobot?: boolean; | ||
} | ||
|
||
export default function CFRobotName({ | ||
formik, | ||
isImportRobot, | ||
}: ICFRobotName): ReactElement { | ||
return ( | ||
<FormInputText | ||
dataTut="create-robot-step1-name" | ||
labelName="Robot Name:" | ||
labelInfoTip="Type a new robot name." | ||
inputProps={formik.getFieldProps("robotName")} | ||
disabled={formik.isSubmitting || isImportRobot} | ||
inputHoverText="You can't change robot name because this robot is created before." | ||
inputError={formik.errors.robotName} | ||
inputTouched={formik.touched.robotName} | ||
/> | ||
); | ||
} |
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.