mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
feat(web/menu): display arrow when menu is scrollable
This commit is contained in:
@@ -7,6 +7,7 @@ import Header from "./Header";
|
|||||||
import FocusTrap from "focus-trap-react";
|
import FocusTrap from "focus-trap-react";
|
||||||
import { IconProp } from "@fortawesome/fontawesome-svg-core";
|
import { IconProp } from "@fortawesome/fontawesome-svg-core";
|
||||||
import { fetchNui } from "../../../utils/fetchNui";
|
import { fetchNui } from "../../../utils/fetchNui";
|
||||||
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
export interface MenuItem {
|
export interface MenuItem {
|
||||||
label: string;
|
label: string;
|
||||||
@@ -184,7 +185,7 @@ const ListMenu: React.FC = () => {
|
|||||||
height="fit-content"
|
height="fit-content"
|
||||||
maxHeight={415}
|
maxHeight={415}
|
||||||
overflow="hidden"
|
overflow="hidden"
|
||||||
borderRadius="md"
|
borderRadius={menu.items.length < 6 || selected === menu.items.length - 1 ? "md" : undefined}
|
||||||
bg="#141517"
|
bg="#141517"
|
||||||
fontFamily="Nunito"
|
fontFamily="Nunito"
|
||||||
borderTopLeftRadius="none"
|
borderTopLeftRadius="none"
|
||||||
@@ -209,6 +210,11 @@ const ListMenu: React.FC = () => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</FocusTrap>
|
</FocusTrap>
|
||||||
</Box>
|
</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>
|
</Box>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user