Skip to content

Commit

Permalink
Add open file location styling
Browse files Browse the repository at this point in the history
  • Loading branch information
guergana committed Aug 29, 2024
1 parent f521a60 commit dfffd8b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
6 changes: 6 additions & 0 deletions client/assets/open_file_location_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 16 additions & 7 deletions client/components/Parts/Trees/File.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useTheme } from '@mui/material/styles'
import openFolderIcon from '../../../assets/open_folder_icon.svg'
import closedFolderIcon from '../../../assets/closed_folder_icon.svg'
import deleteIcon from '../../../assets/delete_icon.svg'
import openFileLocationIcon from '../../../assets/open_file_location_icon.svg'
import MoreHorizIcon from '@mui/icons-material/MoreHoriz'
import IconButton from '../../Parts/Buttons/Icon'
import Menu from '@mui/material/Menu'
Expand Down Expand Up @@ -116,6 +117,13 @@ const StyledTreeItem = styled(
handleClose()
}

const handleOpenFileLocation = () => {
// window.opendataeditor.openPathInExplorer(path)
// get path in users machine from store.state
// or from client/helpers/folder.ts
handleClose()
}

const theme = useTheme()

return (
Expand Down Expand Up @@ -159,13 +167,14 @@ const StyledTreeItem = styled(
'aria-labelledby': 'file-context-menu-btn',
}}
>
<MenuItem onClick={handleClose}>
<ListItemText primary="Rename" />
</MenuItem>
<MenuItem onClick={handleClose}>
<ListItemText primary="Duplicate" secondary="Makes a copy of this file" />
</MenuItem>
<MenuItem onClick={handleClose}>
<MenuItem onClick={handleOpenFileLocation}>
<ListItemIcon sx={{
paddingTop: '6px',
alignSelf: 'flex-start',
minWidth: '24px'
}}>
{<img src={openFileLocationIcon} alt="" />}
</ListItemIcon>
<ListItemText primary="Open File Location" secondary="The ODE folder where this file exists" />
</MenuItem>
<MenuItem onClick={handleDelete}>
Expand Down

0 comments on commit dfffd8b

Please sign in to comment.