Giter Site home page Giter Site logo

Comments (7)

LukeWasTakenn avatar LukeWasTakenn commented on August 28, 2024

All of the styling for the context menu is written with Chakra's built in styling system here:

<Flex
position="absolute"
w="75%"
h="80%"
justifyContent="flex-end"
alignItems="center"
>
<ScaleFade in={visible} unmountOnExit>
<Box w="xs" h={580}>
<Flex justifyContent="center" alignItems="center" mb={3}>
{contextMenu.menu && (
<Flex
borderRadius="md"
bg="gray.800"
flex="1 15%"
alignSelf="stretch"
textAlign="center"
justifyContent="center"
alignItems="center"
marginRight={2}
p={2}
_hover={{ bg: "gray.700" }}
transition="300ms"
onClick={() => openMenu(contextMenu.menu)}
>
<FontAwesomeIcon icon="chevron-left" />
</Flex>
)}
<Box borderRadius="md" bg="gray.800" flex="1 85%">
<Text
fontFamily="Poppins"
fontSize="md"
p={2}
textAlign="center"
fontWeight="light"
>
{contextMenu.title}
</Text>
</Box>
</Flex>
<Box maxH={560} overflowY="scroll">
{Object.entries(contextMenu.options).map((option, index) => (
<Item option={option} key={`context-item-${index}`} />
))}
</Box>
</Box>
</ScaleFade>
</Flex>

<>
<Popover
placement="right-start"
trigger="hover"
eventListeners={{ scroll: true }}
isLazy
>
<PopoverTrigger>
<Box
bg="gray.800"
borderRadius="md"
h="fit-content"
w="100%"
p={2}
mb={1}
fontFamily="Poppins"
fontSize="md"
transition="300ms"
_hover={{ bg: "gray.700" }}
>
<Flex
w="100%"
alignItems="center"
onClick={() =>
option[1].menu
? openMenu(option[1].menu)
: clickContext(option[0])
}
>
{option[1]?.icon && (
<FontAwesomeIcon
fixedWidth
icon={option[1].icon}
fontSize={20}
style={{
marginRight: 10,
justifySelf: "center",
color: option[1].iconColor,
}}
/>
)}
<Box>
<Box paddingBottom={option[1].description ? 1 : 0}>
<Text w="100%" fontWeight="medium">
{option[1].title ? option[1].title : option[0]}
</Text>
</Box>
{option[1].description && (
<Box paddingBottom={1}>
<Text>{option[1].description}</Text>
</Box>
)}
</Box>
{(option[1].menu || option[1].arrow) && (
<>
<Spacer />
<Box
alignSelf="center"
justifySelf="center"
mr={4}
fontSize="xl"
>
<FontAwesomeIcon icon="chevron-right" />
</Box>
</>
)}
</Flex>
<Portal>
{(option[1].metadata || option[1].image) && (
<PopoverContent
fontFamily="Poppins"
bg="gray.800"
outline="none"
border="none"
w="fit-content"
maxW="2xs"
>
<PopoverBody>
<>
{option[1].image && <Image src={option[1].image} />}
{Array.isArray(option[1].metadata) ? (
option[1].metadata.map(
(
metadata: string | { label: string; value: any },
index: number
) => (
<Text key={`context-metadata-${index}`}>
{typeof metadata === "string"
? `${metadata}`
: `${metadata.label}: ${metadata.value}`}
</Text>
)
)
) : (
<>
{typeof option[1].metadata === "object" &&
Object.entries(option[1].metadata).map(
(metadata: { [key: string]: any }, index) => (
<Text key={`context-metadata-${index}`}>
{metadata[0]}: {metadata[1]}
</Text>
)
)}
</>
)}
</>
</PopoverBody>
</PopoverContent>
)}
</Portal>
</Box>
</PopoverTrigger>
</Popover>
</>

from ox_lib.

Goz-exe avatar Goz-exe commented on August 28, 2024

Yes but I am using the latest version 2.6.0 which does not have src

from ox_lib.

Goz-exe avatar Goz-exe commented on August 28, 2024

@LukeWasTakenn

from ox_lib.

LukeWasTakenn avatar LukeWasTakenn commented on August 28, 2024

If you want to edit the styling you have to download the source code, edit what you want and then compile the source code yourself.

from ox_lib.

Goz-exe avatar Goz-exe commented on August 28, 2024

@LukeWasTakenn
Thank you very much, could you tell me the documentation to do the build once it's finished?

from ox_lib.

LukeWasTakenn avatar LukeWasTakenn commented on August 28, 2024

All the info you need is on this page:

https://overextended.github.io/docs/ox_lib

from ox_lib.

Goz-exe avatar Goz-exe commented on August 28, 2024

@LukeWasTakenn Last question how do I change these colors?
image
image

from ox_lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.