Skip to content

Commit

Permalink
Merge pull request #84 from catenax-ng/fix/CPLP-3097-mobile-version
Browse files Browse the repository at this point in the history
fix(usermenu): extend props
  • Loading branch information
oyo authored Jan 23, 2024
2 parents f4b68c7 + 52ee0e5 commit 771bf87
Showing 4 changed files with 20 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.1.18

- fix(usermenu): extend props - position and shadow

## 2.1.17

- fix(eslint): enable no-unsafe-return rule
2 changes: 1 addition & 1 deletion DEPENDENCIES
Original file line number Diff line number Diff line change
@@ -214,7 +214,7 @@ npm/npmjs/-/domhandler/4.3.1, BSD-2-Clause, approved, clearlydefined
npm/npmjs/-/domutils/2.8.0, BSD-2-Clause, approved, clearlydefined
npm/npmjs/-/dot-case/3.0.4, MIT, approved, clearlydefined
npm/npmjs/-/dotenv-expand/10.0.0, BSD-2-Clause, approved, clearlydefined
npm/npmjs/-/dotenv/16.3.1, BSD-2-Clause, approved, clearlydefined
npm/npmjs/-/dotenv/16.3.1, BSD-2-Clause, approved, #12851
npm/npmjs/-/duplexify/3.7.1, MIT, approved, clearlydefined
npm/npmjs/-/eastasianwidth/0.2.0, MIT, approved, clearlydefined
npm/npmjs/-/ee-first/1.1.1, MIT, approved, clearlydefined
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@catena-x/portal-shared-components",
"version": "2.1.17",
"version": "2.1.18",
"description": "Catena-X Portal Shared Components",
"author": "Catena-X Contributors",
"license": "Apache-2.0",
22 changes: 14 additions & 8 deletions src/components/content/UserMenu/index.tsx
Original file line number Diff line number Diff line change
@@ -20,22 +20,30 @@

import { Box, ClickAwayListener, useTheme } from '@mui/material'
import { Typography } from '../../basic/Typography'
import { type Theme } from '@mui/material/styles'
import { type SxProps } from '@mui/system'

interface UserMenuProps {
open: boolean
userName: string
userRole: string
top?: number
children?: React.ReactElement[]
shadow?: boolean
onClickAway?: (event: MouseEvent | TouchEvent) => void
sx?: SxProps<Theme>
}

export const UserMenu = ({
open,
userName,
userRole,
children,
top = 0,
sx = {
top: '0px',
width: '256px',
position: 'absolute',
},
shadow = true,
onClickAway = () => {
// empty
},
@@ -49,19 +57,17 @@ export const UserMenu = ({
display={open ? 'block' : 'none'}
sx={{
borderRadius: 4,
backgroundColor: 'background.background01',
boxShadow: shadows['20'],
width: 256,
backgroundColor: shadow ? 'background.background01' : '#fff',
boxShadow: shadow ? shadows['20'] : 'none',
overflow: 'hidden',
position: 'absolute',
right: 0,
top,
...sx,
}}
{...props}
>
<Box
sx={{
backgroundColor: 'background.background02',
backgroundColor: shadow ? 'background.background02' : '#fff',
borderBottom: '1px solid',
borderColor: 'border.border01',
padding: spacing(2, 3),

0 comments on commit 771bf87

Please sign in to comment.