-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
psp-7862 collapse/expand map sidebar.
- Loading branch information
1 parent
3353581
commit f54d082
Showing
141 changed files
with
12,434 additions
and
10,760 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
54 changes: 54 additions & 0 deletions
54
source/frontend/src/components/common/buttons/ExpandCollapseButton.tsx
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,54 @@ | ||
import React from 'react'; | ||
import { | ||
MdOutlineKeyboardDoubleArrowLeft, | ||
MdOutlineKeyboardDoubleArrowRight, | ||
} from 'react-icons/md'; | ||
import styled from 'styled-components'; | ||
|
||
import { Button, ButtonProps } from '.'; | ||
|
||
interface IExpandCollapseButtonProps extends ButtonProps { | ||
expanded: boolean; | ||
toggleExpanded: () => void; | ||
} | ||
|
||
/** | ||
* PlusButton displaying a plus button, used to add new items. | ||
* @param param0 | ||
*/ | ||
export const ExpandCollapseButton: React.FC< | ||
React.PropsWithChildren<IExpandCollapseButtonProps> | ||
> = ({ expanded, toggleExpanded, className }) => { | ||
return ( | ||
<StyledExpandButton | ||
variant="light" | ||
icon={expanded ? <MdOutlineKeyboardDoubleArrowLeft /> : <MdOutlineKeyboardDoubleArrowRight />} | ||
title={expanded ? 'collapse' : 'expand'} | ||
onClick={() => toggleExpanded()} | ||
className={className} | ||
></StyledExpandButton> | ||
); | ||
}; | ||
|
||
const StyledExpandButton = styled(Button)` | ||
&.btn.btn-light.Button { | ||
padding: 0; | ||
border: 0.1rem solid ${props => props.theme.bcTokens.typographyColorDisabled}; | ||
background-color: white; | ||
color: ${props => props.theme.bcTokens.typographyColorSecondary}; | ||
&:focus, | ||
&:active { | ||
background-color: white; | ||
color: ${props => props.theme.bcTokens.typographyColorSecondary}; | ||
} | ||
} | ||
&.btn, | ||
.Button__icon, | ||
svg { | ||
max-width: 2.4rem; | ||
min-width: 2.4rem; | ||
max-height: 2.4rem; | ||
min-height: 2.4rem; | ||
font-size: 1.4rem; | ||
} | ||
`; |
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
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
Oops, something went wrong.