feat(web/menu): display arrow when menu is scrollable

This commit is contained in:
Luke
2022-08-02 12:09:10 +02:00
committed by Luke
parent dcce65d472
commit 34fe33000f

View File

@@ -7,6 +7,7 @@ import Header from "./Header";
import FocusTrap from "focus-trap-react";
import { IconProp } from "@fortawesome/fontawesome-svg-core";
import { fetchNui } from "../../../utils/fetchNui";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
export interface MenuItem {
label: string;
@@ -184,7 +185,7 @@ const ListMenu: React.FC = () => {
height="fit-content"
maxHeight={415}
overflow="hidden"
borderRadius="md"
borderRadius={menu.items.length < 6 || selected === menu.items.length - 1 ? "md" : undefined}
bg="#141517"
fontFamily="Nunito"
borderTopLeftRadius="none"
@@ -209,6 +210,11 @@ const ListMenu: React.FC = () => {
</Stack>
</FocusTrap>
</Box>
{menu.items.length > 6 && selected !== menu.items.length - 1 && (
<Box bg="#141517" textAlign="center" borderBottomLeftRadius="md" borderBottomRightRadius="md" height={25}>
<FontAwesomeIcon icon="chevron-down" color="#909296" fontSize={20} />
</Box>
)}
</Box>
</Tooltip>
)}