-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/floating action buttons (#326)
- Loading branch information
1 parent
b524d20
commit 2128887
Showing
20 changed files
with
281 additions
and
139 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
src/main/components/uml-element/updatable/FloatingButton.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,48 @@ | ||
import React from 'react'; | ||
import { styled } from '../../theme/styles'; | ||
|
||
const FloatingButtonContainer = styled.g.attrs((props) => ({ | ||
...props, | ||
}))` | ||
transition: all 180ms ease-in-out; | ||
pointer-events: all; | ||
path { | ||
pointer-events: all; | ||
fill: var(--apollon-primary-contrast); | ||
} | ||
rect { | ||
pointer-events: all; | ||
fill: var(--apollon-background); | ||
stroke: var(--apollon-gray); | ||
} | ||
:hover { | ||
transform: translate(0px, -30px); | ||
} | ||
:active { | ||
transform: translate(0px, -30px); | ||
} | ||
:hover rect { | ||
fill: var(--apollon-gray); | ||
stroke: var(--apollon-gray-variant); | ||
} | ||
:active rect { | ||
fill: var(--apollon-gray); | ||
stroke: var(--apollon-gray-variant); | ||
} | ||
`; | ||
|
||
export interface FloatingButtonProps { | ||
style?: React.CSSProperties | undefined; | ||
children?: React.ReactNode; | ||
onClick?: () => void; | ||
} | ||
|
||
export const FloatingButton: React.FC<FloatingButtonProps> = ({ children, ...props }) => { | ||
return ( | ||
<FloatingButtonContainer {...props}> | ||
<rect height={30} width={30} rx="0.25rem" ry="0.25rem" /> | ||
{children} | ||
</FloatingButtonContainer> | ||
); | ||
}; |
7 changes: 7 additions & 0 deletions
7
src/main/components/uml-element/updatable/icons/DeleteIcon.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,7 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
|
||
export const DeleteIcon: FunctionComponent<React.SVGProps<SVGSVGElement>> = (props) => ( | ||
<svg {...props} height={20} width={20}> | ||
<path d="M4.66666 14C4.29999 14 3.9861 13.8694 3.72499 13.6083C3.46388 13.3472 3.33332 13.0333 3.33332 12.6667V4H2.66666V2.66667H5.99999V2H9.99999V2.66667H13.3333V4H12.6667V12.6667C12.6667 13.0333 12.5361 13.3472 12.275 13.6083C12.0139 13.8694 11.7 14 11.3333 14H4.66666ZM11.3333 4H4.66666V12.6667H11.3333V4ZM5.99999 11.3333H7.33332V5.33333H5.99999V11.3333ZM8.66666 11.3333H9.99999V5.33333H8.66666V11.3333Z" /> | ||
</svg> | ||
); |
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,7 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
|
||
export const EditIcon: FunctionComponent<React.SVGProps<SVGSVGElement>> = (props) => ( | ||
<svg {...props} height={20} width={20}> | ||
<path d="M2.39999 13.6H3.53999L11.36 5.77999L10.22 4.63999L2.39999 12.46V13.6ZM0.799988 15.2V11.8L11.36 1.25999C11.52 1.11332 11.6967 0.999988 11.89 0.919988C12.0833 0.839988 12.2867 0.799988 12.5 0.799988C12.7133 0.799988 12.92 0.839988 13.12 0.919988C13.32 0.999988 13.4933 1.11999 13.64 1.27999L14.74 2.39999C14.9 2.54665 15.0167 2.71999 15.09 2.91999C15.1633 3.11999 15.2 3.31999 15.2 3.51999C15.2 3.73332 15.1633 3.93665 15.09 4.12999C15.0167 4.32332 14.9 4.49999 14.74 4.65999L4.19999 15.2H0.799988ZM10.78 5.21999L10.22 4.63999L11.36 5.77999L10.78 5.21999Z" /> | ||
</svg> | ||
); |
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.