-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui-manchette: fix waypoint menu position
- Move the menu next to its related waypoint so it can always be positioned relatively to it - Rename some props to be more neutral Signed-off-by: SharglutDev <[email protected]>
- Loading branch information
1 parent
e74d151
commit f725c80
Showing
9 changed files
with
76 additions
and
96 deletions.
There are no files selected for viewing
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react'; | ||
|
||
export type MenuItem = { | ||
title: string; | ||
icon: React.ReactNode; | ||
onClick: (e: React.MouseEvent) => void; | ||
}; | ||
|
||
type MenuProps = { | ||
items: MenuItem[]; | ||
}; | ||
|
||
/** | ||
* Example of waypoint menu that could be passed to the manchette as props | ||
*/ | ||
const Menu = ({ items }: MenuProps) => ( | ||
<div className="menu"> | ||
{items.map(({ title, icon, onClick }) => ( | ||
<button key={title} type="button" className="menu-item" onClick={onClick}> | ||
<span className="icon">{icon}</span> | ||
<span>{title}</span> | ||
</button> | ||
))} | ||
</div> | ||
); | ||
|
||
export default Menu; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.menu { | ||
position: absolute; | ||
z-index: 10; | ||
@apply bg-grey-5; | ||
width: 305px; | ||
top: 30px; | ||
left: 0; | ||
border: 0.0625rem solid #b6b2af; | ||
border-radius: 0.5rem; | ||
box-shadow: | ||
0 0.375rem 1.3125rem -0.3125rem rgba(101, 169, 232, 0.341810533216783), | ||
0 1rem 1.875rem -0.3125rem rgba(0, 0, 0, 0.2), | ||
0 0.1875rem 0.3125rem -0.125rem rgba(0, 0, 0, 0.1), | ||
inset 0 0 0 0.0625rem #ffffff; | ||
|
||
.menu-item { | ||
width: 100%; | ||
height: 2.75rem; | ||
font-size: 0.875rem; | ||
display: flex; | ||
align-items: center; | ||
|
||
&:not(:first-child) { | ||
border-top: 0.0625rem solid #ffffff; | ||
} | ||
|
||
&:not(:only-of-type, :last-child) { | ||
border-bottom: 0.0625rem solid #d3d1cf; | ||
} | ||
|
||
.icon { | ||
@apply text-primary-40; | ||
padding-inline: 1rem; | ||
} | ||
} | ||
} |
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