Skip to content

Commit

Permalink
Merge pull request #50 from alberto-abarzua/fix/update_menu_icon
Browse files Browse the repository at this point in the history
feat: update drop down menu bug and update icon (BaseAction)
  • Loading branch information
alberto-abarzua authored Nov 21, 2023
2 parents fe39cf0 + 11bf950 commit ba8b37a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
21 changes: 16 additions & 5 deletions frontend/src/components/actions/BaseAction.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ContentCopyIcon from '@mui/icons-material/ContentCopy';
import DownloadIcon from '@mui/icons-material/Download';
import DragIndicatorIcon from '@mui/icons-material/DragIndicator';
import ErrorIcon from '@mui/icons-material/Error';
import MenuOpenIcon from '@mui/icons-material/MenuOpen';
import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
import PlayArrowIcon from '@mui/icons-material/PlayArrow';
import PropTypes from 'prop-types';
import { useRef } from 'react';
Expand All @@ -35,6 +35,7 @@ const BaseAction = ({ icon, children, className, action, ...props }) => {
const id = action.id;
const dispatch = useDispatch();
const [url, setUrl] = useState(null);
const [menuOpen, setMenuOpen] = useState(false);

useEffect(() => {
let actionForDownload = getActionForDownload(action);
Expand Down Expand Up @@ -155,10 +156,20 @@ const BaseAction = ({ icon, children, className, action, ...props }) => {
<CloseIcon className="text-xl" />
</div>

<DropdownMenu>
<DropdownMenuTrigger>
<div className="absolute bottom-0 right-0 mt-10 flex cursor-pointer items-center justify-center rounded-tl-md p-3 text-white transition-all duration-300 hover:bg-gray-100 hover:text-gray-500">
<MenuOpenIcon className="relative -right-1 scale-150 transform" />
<DropdownMenu
open={menuOpen}
onOpenChange={() => {
setMenuOpen(false);
}}
>
<DropdownMenuTrigger
onClick={event => {
event.preventDefault();
setMenuOpen(true);
}}
>
<div className="absolute -bottom-2 right-0 mt-10 flex cursor-pointer items-center justify-center rounded-tl-md p-3 text-white transition-all duration-300 hover:bg-gray-100 hover:text-gray-500">
<MoreHorizIcon className="relative -right-1 scale-150 transform" />
</div>
</DropdownMenuTrigger>
<DropdownMenuContent>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/actions/ToolBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const ToolBar = () => {
type: ActionTypes.MOVE,
value: moveValue,
hovercolor: 'hover:bg-action-move-hover',
helpText: 'Move Addction: Move to a pose (Uses current pose as base)',
helpText: 'Move Action: Move to a position',
},
{
name: 'Sleep',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/MainView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ export default function Home() {
<ActionsPanel></ActionsPanel>
</div>
<div className="relative box-border flex h-full w-full flex-col items-start justify-start bg-slate-50 lg:w-6/12">
<div className="relative flex h-1/2 w-full">
<div className="relative flex h-[40%] w-full">
<ArmSimulation></ArmSimulation>
<div className="absolute right-0">
<ArmStatus></ArmStatus>
</div>
</div>
<div className="relative flex h-1/2 w-full">
<div className="relative flex h-[60%] w-full">
<ControlPanel></ControlPanel>
</div>
</div>
Expand Down

1 comment on commit ba8b37a

@vercel
Copy link

@vercel vercel bot commented on ba8b37a Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.