cozy-ui 90.6.0 → 90.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [90.7.1](https://github.com/cozy/cozy-ui/compare/v90.7.0...v90.7.1) (2023-08-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **ContactsList:** Avatar is no longer above list subheader ([a3310d3](https://github.com/cozy/cozy-ui/commit/a3310d3))
7
+
8
+ # [90.7.0](https://github.com/cozy/cozy-ui/compare/v90.6.0...v90.7.0) (2023-08-09)
9
+
10
+
11
+ ### Features
12
+
13
+ * **ListItemFile:** Use Filename to show the primary text ([38c2bd2](https://github.com/cozy/cozy-ui/commit/38c2bd2))
14
+
1
15
  # [90.6.0](https://github.com/cozy/cozy-ui/compare/v90.5.0...v90.6.0) (2023-08-08)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "90.6.0",
3
+ "version": "90.7.1",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -25,7 +25,11 @@ const ContactIdentity = ({ contact }) => {
25
25
  styles['contact-identity']
26
26
  } u-flex u-flex-items-center u-ellipsis`}
27
27
  >
28
- <Avatar text={getInitials(contact)} size="small" />
28
+ <Avatar
29
+ style={{ zIndex: 'auto' }}
30
+ text={getInitials(contact)}
31
+ size="small"
32
+ />
29
33
  <ContactName displayName={displayName} familyName={name.familyName} />
30
34
  {isMyself && <MyselfMarker />}
31
35
  </TableCell>
@@ -19,6 +19,7 @@ exports[`ContactRow should match the contact snapshot 1`] = `
19
19
  Object {
20
20
  "--circleSize": "32px",
21
21
  "backgroundColor": "#FFC644",
22
+ "zIndex": "auto",
22
23
  }
23
24
  }
24
25
  >
@@ -1,19 +1,34 @@
1
+ import React from 'react'
1
2
  import PropTypes from 'prop-types'
2
3
 
3
- import { useI18n } from '../../I18n'
4
+ import { splitFilename } from 'cozy-client/dist/models/file'
4
5
 
5
- import withListItemLocales from '../hoc/withListItemLocales'
6
+ import Filename from '../../Filename'
7
+ import useBreakpoints from '../../hooks/useBreakpoints'
6
8
 
7
9
  const PrimaryText = ({ primary, file }) => {
8
- const { t } = useI18n()
10
+ const { isMobile } = useBreakpoints()
9
11
 
10
12
  if (primary) return primary
11
13
 
12
- const pageQualification = file?.metadata?.qualification?.page
13
-
14
- return pageQualification === 'front' || pageQualification === 'back'
15
- ? t(`ListItem.file.page.${pageQualification}`)
16
- : file.name
14
+ return (
15
+ <Filename
16
+ variant="body1"
17
+ midEllipsis={isMobile}
18
+ filename={
19
+ splitFilename({
20
+ name: file.name,
21
+ type: 'file'
22
+ }).filename
23
+ }
24
+ extension={
25
+ splitFilename({
26
+ name: file.name,
27
+ type: 'file'
28
+ }).extension
29
+ }
30
+ />
31
+ )
17
32
  }
18
33
 
19
34
  PrimaryText.propTypes = {
@@ -21,4 +36,4 @@ PrimaryText.propTypes = {
21
36
  file: PropTypes.object
22
37
  }
23
38
 
24
- export default withListItemLocales(PrimaryText)
39
+ export default PrimaryText