Skip to content

Commit df393c8

Browse files
committed
feat: App menu and user menu updates
Added border radius, spacing and custom text.
1 parent 4067ca9 commit df393c8

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

src/components/AppsMenu/components/AppItem.jsx

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react'
22

33
import { getAppDisplayName } from 'cozy-client/dist/models/applications'
4+
import { makeStyles } from 'cozy-ui/transpiled/react/styles'
45
import Buttons from 'cozy-ui/transpiled/react/Buttons'
56
import AppIcon from 'cozy-ui/transpiled/react/AppIcon'
67
import AppLinker from 'cozy-ui/transpiled/react/AppLinker'
@@ -12,9 +13,21 @@ import stack from 'lib/stack'
1213

1314
import styles from 'styles/apps-menu.styl'
1415

16+
const useStyles = makeStyles(() => {
17+
return {
18+
text: {
19+
lineHeight: '22.5px',
20+
fontSize: '12px',
21+
fontWeight: 400
22+
}
23+
}
24+
})
25+
1526
export const AppItem = ({ app }) => {
1627
const appName = getAppDisplayName(app)
1728

29+
const classes = useStyles()
30+
1831
return (
1932
<AppLinker href={app.href || ''} app={app}>
2033
{({ onClick, href }) => {
@@ -36,7 +49,7 @@ export const AppItem = ({ app }) => {
3649
{...stack.get.iconProps()}
3750
/>
3851
</div>
39-
<Typography variant="subtitle1" noWrap>
52+
<Typography noWrap className={classes.text}>
4053
{appName}
4154
</Typography>
4255
</div>

src/components/AppsMenu/index.jsx

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ const AppsMenu = () => {
3030
open={isOpen}
3131
onClose={toggleMenu}
3232
content={<AppsMenuContent />}
33+
classes={{
34+
paper: 'u-bdrs-7'
35+
}}
3336
/>
3437
) : (
3538
<Menu
@@ -46,6 +49,9 @@ const AppsMenu = () => {
4649
vertical: -10,
4750
horizontal: 0
4851
}}
52+
classes={{
53+
paper: 'u-bdrs-7'
54+
}}
4955
>
5056
<AppsMenuContent />
5157
</Menu>

src/components/UserMenu/index.jsx

+6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ const UserMenu = ({ onLogOut }) => {
4343
diskUsage={diskUsage}
4444
/>
4545
}
46+
classes={{
47+
paper: 'u-bdrs-7'
48+
}}
4649
/>
4750
) : (
4851
<Menu
@@ -59,6 +62,9 @@ const UserMenu = ({ onLogOut }) => {
5962
vertical: -10,
6063
horizontal: 0
6164
}}
65+
classes={{
66+
paper: 'u-bdrs-7'
67+
}}
6268
>
6369
<UserMenuContent
6470
onLogOut={onLogOut}

src/styles/apps-menu.styl

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
+desktop()
99
width 15rem
10-
margin-left .5rem
11-
margin-right .5rem
10+
margin 6px 10px
1211

1312
.apps-menu-grid-item-wrapper
1413
width 33%
@@ -24,7 +23,7 @@
2423
justify-content center
2524
align-items center
2625
text-decoration none
27-
gap .2rem // @stylint ignore Property is valid but unknown by stylint which is old and should be replaced
26+
gap 4px // @stylint ignore Property is valid but unknown by stylint which is old and should be replaced
2827
width 100%
2928

3029
.apps-menu-grid-item-icon

0 commit comments

Comments
 (0)