-
Notifications
You must be signed in to change notification settings - Fork 4
JTE/PKFE-42 #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
JTE/PKFE-42 #52
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a917c2f
Split the toolbar into different files based on groups
justinnas 9827844
Made sidebar as an individual component
justinnas 4ee533e
Moved BaseLayout into routes, made sidebar icons highlighted dependin…
justinnas 3c4167d
Small fixes
justinnas 5227150
Addressed issues, made it so the navigation buttons could be disabled
justinnas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 @@ | ||
export { Sidebar } from './sidebar'; |
This file contains hidden or 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,84 @@ | ||
import { IconTitleButton } from '@/components/buttons/IconTitleButton'; | ||
import { Paths } from '@/types'; | ||
import { | ||
AutoMode as AutoModeIcon, | ||
Home as HomeIcon, | ||
SettingsOutlined as SettingsOutlinedIcon, | ||
SwitchAccessShortcut as SwitchAccessShortcutIcon, | ||
} from '@mui/icons-material'; | ||
import { Box } from '@mui/material'; | ||
import { useLocation, useNavigate } from 'react-router-dom'; | ||
|
||
interface SidebarProps { | ||
settingsDialogOpen: () => void; | ||
shortcutsDialogOpen: () => void; | ||
} | ||
|
||
export const Sidebar: React.FC<SidebarProps> = ({ settingsDialogOpen, shortcutsDialogOpen }) => { | ||
const location = useLocation(); | ||
const navigate = useNavigate(); | ||
|
||
return ( | ||
<Box sx={{ width: '4.2vw', height: '100%', display: 'flex', flexDirection: 'column' }}> | ||
<Box | ||
sx={{ | ||
width: '100%', | ||
height: '50%', | ||
paddingTop: '0.625rem', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: '0.625rem', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<IconTitleButton | ||
icon={ | ||
<HomeIcon | ||
sx={{ | ||
width: '1.5rem', | ||
height: '1.5rem', | ||
}} | ||
/> | ||
} | ||
title={'Home'} | ||
isActive={location.pathname === Paths.HOME} | ||
onClick={() => navigate(Paths.HOME)} | ||
/> | ||
<IconTitleButton | ||
icon={ | ||
<AutoModeIcon | ||
sx={{ | ||
width: '1.5rem', | ||
height: '1.5rem', | ||
}} | ||
/> | ||
} | ||
title={'Macros'} | ||
isActive={location.pathname === Paths.MACROS} | ||
onClick={() => navigate(Paths.MACROS)} | ||
disabled | ||
/> | ||
</Box> | ||
<Box | ||
sx={{ | ||
width: '100%', | ||
height: '50%', | ||
paddingBottom: '0.625rem', | ||
display: 'flex', | ||
flexDirection: 'column-reverse', | ||
gap: '0.625rem', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<IconTitleButton | ||
icon={<SettingsOutlinedIcon sx={{ width: '1.5rem', height: '1.5rem' }} />} | ||
onClick={settingsDialogOpen} | ||
/> | ||
<IconTitleButton | ||
icon={<SwitchAccessShortcutIcon sx={{ width: '1.5rem', height: '1.5rem' }} />} | ||
onClick={shortcutsDialogOpen} | ||
/> | ||
</Box> | ||
</Box> | ||
); | ||
}; |
26 changes: 26 additions & 0 deletions
26
...-end/src/features/editor/components/toolbarView/toolbarGroupButtons/applyGroupButtons.tsx
This file contains hidden or 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,26 @@ | ||
import { Deblur as DeblurIcon } from '@mui/icons-material'; | ||
|
||
import { ToolbarGroupItemProps } from '@/features/editor/components/toolbarView'; | ||
|
||
const applySpliceAiClick = () => { | ||
console.log('Clicked Apply SpliceAI Button!'); | ||
}; | ||
|
||
const applyCaddClick = () => { | ||
console.log('Clicked Apply CADD Button!'); | ||
}; | ||
|
||
export const ApplyGroupButtons: ToolbarGroupItemProps[] = [ | ||
{ | ||
group: 'apply', | ||
icon: DeblurIcon, | ||
label: 'Apply SpliceAI', | ||
onClick: applySpliceAiClick, | ||
}, | ||
{ | ||
group: 'apply', | ||
icon: DeblurIcon, | ||
label: 'Apply CADD', | ||
onClick: applyCaddClick, | ||
}, | ||
]; |
36 changes: 36 additions & 0 deletions
36
...d/src/features/editor/components/toolbarView/toolbarGroupButtons/downloadGroupButtons.tsx
This file contains hidden or 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,36 @@ | ||
import { ToolbarGroupItemProps } from '@/features/editor/components/toolbarView'; | ||
|
||
import { Download as DownloadIcon } from '@mui/icons-material'; | ||
|
||
const handleDownloadLovdClick = () => { | ||
console.log('Clicked Download Lovd Button!'); | ||
}; | ||
|
||
const handleDownloadClinvarClick = () => { | ||
console.log('Clicked Download Clinvar Button!'); | ||
}; | ||
|
||
const handleDownloadGnomadClick = () => { | ||
console.log('Clicked Download Gnomad Button!'); | ||
}; | ||
|
||
export const DownloadGroupButtons: ToolbarGroupItemProps[] = [ | ||
{ | ||
group: 'download', | ||
icon: DownloadIcon, | ||
label: 'LOVD', | ||
onClick: handleDownloadLovdClick, | ||
}, | ||
{ | ||
group: 'download', | ||
icon: DownloadIcon, | ||
label: 'ClinVar', | ||
onClick: handleDownloadClinvarClick, | ||
}, | ||
{ | ||
group: 'download', | ||
icon: DownloadIcon, | ||
label: 'gnomAD', | ||
onClick: handleDownloadGnomadClick, | ||
}, | ||
]; |
3 changes: 3 additions & 0 deletions
3
app/front-end/src/features/editor/components/toolbarView/toolbarGroupButtons/index.ts
This file contains hidden or 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,3 @@ | ||
export { ApplyGroupButtons } from './applyGroupButtons'; | ||
export { DownloadGroupButtons } from './downloadGroupButtons'; | ||
export { MergeGroupButtons } from './mergeGroupButtons'; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add disabled for unusable buttons like macros to not be available (disabled)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!