cozy-sharing 10.4.0 → 11.0.0

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.
Files changed (90) hide show
  1. package/.storybook/fixtures/recipients.js +30 -0
  2. package/.storybook/main.js +18 -0
  3. package/.storybook/manager.js +6 -0
  4. package/.storybook/preview-head.html +21 -0
  5. package/.storybook/preview.jsx +64 -0
  6. package/.storybook/public/Lato-Bold.immutable.woff2 +0 -0
  7. package/.storybook/public/Lato-Regular.immutable.woff2 +0 -0
  8. package/CHANGELOG.md +38 -0
  9. package/dist/SharedRecipients.js +2 -2
  10. package/dist/SharedStatus.js +2 -2
  11. package/dist/SharingOwnerAvatar.js +2 -2
  12. package/dist/components/{Recipient/RecipientsAvatars.js → Avatar/AvatarList.js} +11 -11
  13. package/dist/components/{Recipient/RecipientsAvatars.spec.js → Avatar/AvatarList.spec.js} +10 -10
  14. package/dist/components/Avatar/AvatarList.stories.js +14 -0
  15. package/dist/components/{Recipient/AvatarPlusX.js → Avatar/ExtraAvatar.js} +4 -4
  16. package/dist/components/Avatar/ExtraAvatar.stories.js +10 -0
  17. package/dist/components/{Recipient/RecipientAvatar.js → Avatar/MemberAvatar.js} +2 -2
  18. package/dist/components/Avatar/MemberAvatar.stories.js +15 -0
  19. package/dist/components/ConfirmTrustedRecipientsDialog.js +2 -2
  20. package/dist/components/{Recipient/RecipientPlusX.js → Identity/ExtraIdentity.js} +5 -5
  21. package/dist/components/Identity/ExtraIdentity.stories.js +13 -0
  22. package/dist/components/Identity/Identity.stories.js +13 -0
  23. package/dist/components/{Recipient/RecipientWithoutStatus.js → Identity/MemberIdentity.js} +2 -2
  24. package/dist/components/Identity/MemberIdentity.stories.js +10 -0
  25. package/dist/components/Identity/OwnerIdentity.stories.js +10 -0
  26. package/dist/components/Recipient/LinkRecipient.stories.js +16 -0
  27. package/dist/components/Recipient/LinkRecipientPermissions.stories.js +10 -0
  28. package/dist/components/Recipient/{Recipient.js → MemberRecipient.js} +9 -9
  29. package/dist/components/Recipient/{Recipient.spec.js → MemberRecipient.spec.js} +3 -3
  30. package/dist/components/Recipient/MemberRecipient.stories.js +39 -0
  31. package/dist/components/Recipient/{RecipientPermissions.js → MemberRecipientPermissions.js} +2 -2
  32. package/dist/components/Recipient/MemberRecipientPermissions.stories.js +10 -0
  33. package/dist/components/Recipient/{RecipientStatus.js → MemberRecipientStatus.js} +2 -2
  34. package/dist/components/Recipient/MemberRecipientStatus.stories.js +10 -0
  35. package/dist/components/Recipient/OwnerRecipient.js +2 -2
  36. package/dist/components/Recipient/OwnerRecipient.stories.js +13 -0
  37. package/dist/components/Recipient/OwnerRecipientDefault.js +2 -2
  38. package/dist/components/Recipient/OwnerRecipientDefault.stories.js +10 -0
  39. package/dist/components/Recipient/RecipientConfirm.js +2 -2
  40. package/dist/components/Recipient/RecipientConfirm.stories.js +10 -0
  41. package/dist/components/Recipient/RecipientList.js +2 -2
  42. package/dist/components/Recipient/RecipientList.stories.js +26 -0
  43. package/dist/components/ShareModal/SharingDetailsModal.js +1 -1
  44. package/dist/components/WhoHasAccessLight.js +4 -4
  45. package/dist/helpers/files.js +10 -0
  46. package/dist/hooks/useFetchDocumentPath.js +18 -8
  47. package/dist/stylesheet.css +10 -10
  48. package/package.json +16 -5
  49. package/src/SharedRecipients.jsx +2 -2
  50. package/src/SharedStatus.jsx +2 -2
  51. package/src/SharingOwnerAvatar.jsx +2 -2
  52. package/src/components/{Recipient/RecipientsAvatars.jsx → Avatar/AvatarList.jsx} +12 -11
  53. package/src/components/{Recipient/RecipientsAvatars.spec.jsx → Avatar/AvatarList.spec.jsx} +12 -11
  54. package/src/components/Avatar/AvatarList.stories.jsx +16 -0
  55. package/src/components/{Recipient/AvatarPlusX.jsx → Avatar/ExtraAvatar.jsx} +4 -4
  56. package/src/components/Avatar/ExtraAvatar.stories.jsx +13 -0
  57. package/src/components/{Recipient/RecipientAvatar.jsx → Avatar/MemberAvatar.jsx} +2 -2
  58. package/src/components/Avatar/MemberAvatar.stories.jsx +18 -0
  59. package/src/components/ConfirmTrustedRecipientsDialog.jsx +2 -2
  60. package/src/components/{Recipient/RecipientPlusX.jsx → Identity/ExtraIdentity.jsx} +5 -5
  61. package/src/components/Identity/ExtraIdentity.stories.jsx +16 -0
  62. package/src/components/Identity/Identity.stories.jsx +16 -0
  63. package/src/components/{Recipient/RecipientWithoutStatus.jsx → Identity/MemberIdentity.jsx} +2 -2
  64. package/src/components/Identity/MemberIdentity.stories.jsx +13 -0
  65. package/src/components/Identity/OwnerIdentity.stories.jsx +13 -0
  66. package/src/components/Recipient/LinkRecipient.stories.jsx +17 -0
  67. package/src/components/Recipient/LinkRecipientPermissions.stories.jsx +13 -0
  68. package/src/components/Recipient/{Recipient.jsx → MemberRecipient.jsx} +14 -10
  69. package/src/components/Recipient/{Recipient.spec.jsx → MemberRecipient.spec.jsx} +3 -3
  70. package/src/components/Recipient/MemberRecipient.stories.jsx +44 -0
  71. package/src/components/Recipient/{RecipientPermissions.jsx → MemberRecipientPermissions.jsx} +2 -2
  72. package/src/components/Recipient/MemberRecipientPermissions.stories.jsx +13 -0
  73. package/src/components/Recipient/{RecipientStatus.jsx → MemberRecipientStatus.jsx} +2 -2
  74. package/src/components/Recipient/MemberRecipientStatus.stories.jsx +13 -0
  75. package/src/components/Recipient/OwnerRecipient.jsx +2 -2
  76. package/src/components/Recipient/OwnerRecipient.stories.jsx +16 -0
  77. package/src/components/Recipient/OwnerRecipientDefault.jsx +2 -2
  78. package/src/components/Recipient/OwnerRecipientDefault.stories.jsx +13 -0
  79. package/src/components/Recipient/RecipientConfirm.jsx +7 -9
  80. package/src/components/Recipient/RecipientConfirm.stories.jsx +13 -0
  81. package/src/components/Recipient/RecipientList.jsx +2 -2
  82. package/src/components/Recipient/RecipientList.stories.jsx +28 -0
  83. package/src/components/ShareModal/SharingDetailsModal.jsx +1 -1
  84. package/src/components/WhoHasAccessLight.jsx +4 -4
  85. package/src/helpers/files.js +9 -0
  86. package/src/hooks/useFetchDocumentPath.jsx +4 -0
  87. /package/dist/components/{Recipient → Identity}/Identity.js +0 -0
  88. /package/dist/components/{Recipient → Identity}/OwnerIdentity.js +0 -0
  89. /package/src/components/{Recipient → Identity}/Identity.jsx +0 -0
  90. /package/src/components/{Recipient → Identity}/OwnerIdentity.jsx +0 -0
@@ -3,10 +3,11 @@ import React from 'react'
3
3
 
4
4
  import { createMockClient } from 'cozy-client'
5
5
 
6
- import RecipientsAvatars, {
6
+ import {
7
+ AvatarList,
7
8
  MAX_DISPLAYED_RECIPIENTS,
8
9
  excludeMeAsOwnerFromRecipients
9
- } from './RecipientsAvatars'
10
+ } from './AvatarList'
10
11
  import AppLike from '../../../test/AppLike'
11
12
 
12
13
  const mockRecipients = new Array(MAX_DISPLAYED_RECIPIENTS - 1)
@@ -42,7 +43,7 @@ const mockMoreRecipientsThanMaxDisplayed = [
42
43
  }
43
44
  ]
44
45
 
45
- describe('RecipientsAvatars', () => {
46
+ describe('AvatarList', () => {
46
47
  const client = createMockClient({})
47
48
 
48
49
  const setup = ({
@@ -54,7 +55,7 @@ describe('RecipientsAvatars', () => {
54
55
  }) => {
55
56
  return render(
56
57
  <AppLike client={client}>
57
- <RecipientsAvatars
58
+ <AvatarList
58
59
  recipients={recipients}
59
60
  onClick={onClick}
60
61
  isOwner={isOwner}
@@ -70,19 +71,19 @@ describe('RecipientsAvatars', () => {
70
71
  link: true
71
72
  })
72
73
 
73
- expect(getByTestId('recipientsAvatars-link')).toBeTruthy()
74
+ expect(getByTestId('AvatarList-link')).toBeTruthy()
74
75
  })
75
76
 
76
77
  it('should not render link icon if a link is not generated', () => {
77
78
  const { queryByTestId } = setup({})
78
79
 
79
- expect(queryByTestId('recipientsAvatars-link')).toBeNull()
80
+ expect(queryByTestId('AvatarList-link')).toBeNull()
80
81
  })
81
82
 
82
83
  it('should hide me as owner by default', () => {
83
84
  const { queryByTestId } = setup({})
84
85
 
85
- expect(queryByTestId('recipientsAvatars-avatar-owner')).toBeNull()
86
+ expect(queryByTestId('AvatarList-avatar-owner')).toBeNull()
86
87
  })
87
88
 
88
89
  it('should show me as owner if required', () => {
@@ -90,7 +91,7 @@ describe('RecipientsAvatars', () => {
90
91
  showMeAsOwner: true
91
92
  })
92
93
 
93
- expect(getByTestId('recipientsAvatars-avatar-owner')).toBeTruthy()
94
+ expect(getByTestId('AvatarList-avatar-owner')).toBeTruthy()
94
95
  })
95
96
 
96
97
  it('should show a +X icon with the correct number if there is more avatars than expected', () => {
@@ -102,7 +103,7 @@ describe('RecipientsAvatars', () => {
102
103
  const delta =
103
104
  mockMoreRecipientsThanMaxDisplayed.length - MAX_DISPLAYED_RECIPIENTS
104
105
 
105
- expect(getByTestId('recipientsAvatars-plusX')).toBeTruthy()
106
+ expect(getByTestId('AvatarList-plusX')).toBeTruthy()
106
107
  expect(getByText(`+${delta}`)).toBeTruthy()
107
108
  })
108
109
 
@@ -113,8 +114,8 @@ describe('RecipientsAvatars', () => {
113
114
  link: true
114
115
  })
115
116
 
116
- expect(getByTestId('recipientsAvatars-plusX')).toBeTruthy()
117
- expect(getByTestId('recipientsAvatars-link')).toBeTruthy()
117
+ expect(getByTestId('AvatarList-plusX')).toBeTruthy()
118
+ expect(getByTestId('AvatarList-link')).toBeTruthy()
118
119
  })
119
120
  })
120
121
 
@@ -0,0 +1,16 @@
1
+ import { AvatarList } from './AvatarList'
2
+ import { recipients } from '../../../.storybook/fixtures/recipients'
3
+
4
+ const meta = {
5
+ component: AvatarList,
6
+ args: {
7
+ recipients: [...recipients, ...recipients]
8
+ }
9
+ }
10
+
11
+ export default meta
12
+
13
+ export const Default = {
14
+ name: 'Default',
15
+ args: {}
16
+ }
@@ -6,7 +6,7 @@ import Avatar from 'cozy-ui/transpiled/react/Avatar'
6
6
 
7
7
  import { SharingTooltip, TooltipRecipientList } from '../Tooltip'
8
8
 
9
- const AvatarPlusX = ({ className, size, extraRecipients = [] }) => {
9
+ const ExtraAvatar = ({ className, size, extraRecipients = [] }) => {
10
10
  const sharingTooltipId = uniqueId('extra-recipients-avatar-')
11
11
 
12
12
  return (
@@ -27,15 +27,15 @@ const AvatarPlusX = ({ className, size, extraRecipients = [] }) => {
27
27
  )
28
28
  }
29
29
 
30
- AvatarPlusX.propTypes = {
30
+ ExtraAvatar.propTypes = {
31
31
  extraRecipients: PropTypes.arrayOf(PropTypes.string),
32
32
  size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
33
33
  className: PropTypes.string
34
34
  }
35
35
 
36
- AvatarPlusX.defaultProps = {
36
+ ExtraAvatar.defaultProps = {
37
37
  extraRecipients: [],
38
38
  size: 'medium'
39
39
  }
40
40
 
41
- export default AvatarPlusX
41
+ export { ExtraAvatar }
@@ -0,0 +1,13 @@
1
+ import { ExtraAvatar } from './ExtraAvatar'
2
+
3
+ const meta = {
4
+ component: ExtraAvatar,
5
+ args: {}
6
+ }
7
+
8
+ export default meta
9
+
10
+ export const Default = {
11
+ name: 'Default',
12
+ args: {}
13
+ }
@@ -5,7 +5,7 @@ import Avatar from 'cozy-ui/transpiled/react/Avatar'
5
5
 
6
6
  import { getDisplayName, getInitials } from '../../models'
7
7
 
8
- const RecipientAvatar = ({ recipient, ...rest }) => {
8
+ const MemberAvatar = ({ recipient, ...rest }) => {
9
9
  const client = useClient()
10
10
 
11
11
  /**
@@ -35,4 +35,4 @@ const RecipientAvatar = ({ recipient, ...rest }) => {
35
35
  )
36
36
  }
37
37
 
38
- export default RecipientAvatar
38
+ export { MemberAvatar }
@@ -0,0 +1,18 @@
1
+ import { MemberAvatar } from './MemberAvatar'
2
+
3
+ const meta = {
4
+ component: MemberAvatar,
5
+ args: {
6
+ recipient: {
7
+ avatarPath: null,
8
+ name: 'John Doe'
9
+ }
10
+ }
11
+ }
12
+
13
+ export default meta
14
+
15
+ export const Default = {
16
+ name: 'Default',
17
+ args: {}
18
+ }
@@ -3,7 +3,7 @@ import React from 'react'
3
3
  import Typography from 'cozy-ui/transpiled/react/Typography'
4
4
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
5
5
 
6
- import Recipient from './Recipient/Recipient'
6
+ import MemberRecipient from './Recipient/MemberRecipient'
7
7
  import ShareDialogTwoStepsConfirmationContainer from './ShareDialogTwoStepsConfirmationContainer'
8
8
 
9
9
  /**
@@ -20,7 +20,7 @@ const SharingContent = ({ recipientsToBeConfirmed, verifyRecipient }) => {
20
20
 
21
21
  {recipientsToBeConfirmed.map(recipientConfirmationData => {
22
22
  return (
23
- <Recipient
23
+ <MemberRecipient
24
24
  {...recipientConfirmationData}
25
25
  key={`key_r_${recipientConfirmationData.id}`}
26
26
  isOwner={false}
@@ -1,14 +1,14 @@
1
1
  import PropTypes from 'prop-types'
2
2
  import React from 'react'
3
3
 
4
- import AvatarPlusX from './AvatarPlusX'
5
4
  import Identity from './Identity'
6
5
  import { getDisplayName } from '../../models'
7
6
  import styles from '../../styles/recipient.styl'
7
+ import { ExtraAvatar } from '../Avatar/ExtraAvatar'
8
8
 
9
- const RecipientPlusX = ({ extraRecipients }, { t }) => (
9
+ const ExtraIdentity = ({ extraRecipients }, { t }) => (
10
10
  <div className={styles['recipient']}>
11
- <AvatarPlusX
11
+ <ExtraAvatar
12
12
  extraRecipients={extraRecipients.map(recipient =>
13
13
  getDisplayName(recipient)
14
14
  )}
@@ -21,8 +21,8 @@ const RecipientPlusX = ({ extraRecipients }, { t }) => (
21
21
  </div>
22
22
  )
23
23
 
24
- RecipientPlusX.contextTypes = {
24
+ ExtraIdentity.contextTypes = {
25
25
  t: PropTypes.func.isRequired
26
26
  }
27
27
 
28
- export default RecipientPlusX
28
+ export { ExtraIdentity }
@@ -0,0 +1,16 @@
1
+ import { ExtraIdentity } from './ExtraIdentity'
2
+ import { recipients } from '../../../.storybook/fixtures/recipients'
3
+
4
+ const meta = {
5
+ component: ExtraIdentity,
6
+ args: {
7
+ extraRecipients: recipients
8
+ }
9
+ }
10
+
11
+ export default meta
12
+
13
+ export const Default = {
14
+ name: 'Default',
15
+ args: {}
16
+ }
@@ -0,0 +1,16 @@
1
+ import Identity from './Identity'
2
+
3
+ const meta = {
4
+ title: 'Components/Identity/Identity',
5
+ component: Identity,
6
+ args: {}
7
+ }
8
+
9
+ export default meta
10
+
11
+ export const Default = {
12
+ name: 'Default',
13
+ args: {
14
+ name: 'John Doe'
15
+ }
16
+ }
@@ -6,7 +6,7 @@ import Identity from './Identity'
6
6
  import { getDisplayName, getInitials } from '../../models'
7
7
  import styles from '../../styles/recipient.styl'
8
8
 
9
- const RecipientWithoutStatus = ({ instance, ...rest }) => {
9
+ const MemberIdentity = ({ instance, ...rest }) => {
10
10
  const name = getDisplayName(rest)
11
11
  return (
12
12
  <div className={styles['recipient']}>
@@ -18,4 +18,4 @@ const RecipientWithoutStatus = ({ instance, ...rest }) => {
18
18
  )
19
19
  }
20
20
 
21
- export default RecipientWithoutStatus
21
+ export { MemberIdentity }
@@ -0,0 +1,13 @@
1
+ import { MemberIdentity } from './MemberIdentity'
2
+
3
+ const meta = {
4
+ component: MemberIdentity,
5
+ args: {}
6
+ }
7
+
8
+ export default meta
9
+
10
+ export const Default = {
11
+ name: 'Default',
12
+ args: {}
13
+ }
@@ -0,0 +1,13 @@
1
+ import OwnerIdentity from './OwnerIdentity'
2
+
3
+ const meta = {
4
+ component: OwnerIdentity,
5
+ args: {}
6
+ }
7
+
8
+ export default meta
9
+
10
+ export const Default = {
11
+ name: 'Default',
12
+ args: {}
13
+ }
@@ -0,0 +1,17 @@
1
+ import LinkRecipient from './LinkRecipient'
2
+
3
+ const meta = {
4
+ component: LinkRecipient,
5
+ args: {
6
+ recipientConfirmationData: false,
7
+ verifyRecipient: () => true,
8
+ link: 'test',
9
+ fadeIn: false
10
+ }
11
+ }
12
+
13
+ export default meta
14
+
15
+ export const Default = {
16
+ name: 'Default'
17
+ }
@@ -0,0 +1,13 @@
1
+ import LinkRecipientPermissions from './LinkRecipientPermissions'
2
+
3
+ const meta = {
4
+ component: LinkRecipientPermissions,
5
+ args: {}
6
+ }
7
+
8
+ export default meta
9
+
10
+ export const Default = {
11
+ name: 'Default',
12
+ args: {}
13
+ }
@@ -9,16 +9,16 @@ import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
9
9
  import Typography from 'cozy-ui/transpiled/react/Typography'
10
10
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
11
11
 
12
- import RecipientAvatar from './RecipientAvatar'
12
+ import MemberRecipientPermissions from './MemberRecipientPermissions'
13
+ import MemberRecipientStatus from './MemberRecipientStatus'
13
14
  import RecipientConfirm from './RecipientConfirm'
14
- import RecipientPermissions from './RecipientPermissions'
15
- import RecipientStatus from './RecipientStatus'
16
15
  import { FADE_IN_DURATION } from '../../helpers/recipients'
17
16
  import { getDisplayName } from '../../models'
17
+ import { MemberAvatar } from '../Avatar/MemberAvatar'
18
18
 
19
19
  const DEFAULT_DISPLAY_NAME = 'Share.contacts.defaultDisplayName'
20
20
 
21
- const Recipient = props => {
21
+ const MemberRecipient = props => {
22
22
  const { t } = useI18n()
23
23
  const client = useClient()
24
24
 
@@ -41,16 +41,16 @@ const Recipient = props => {
41
41
  <RecipientConfirm
42
42
  recipientConfirmationData={recipientConfirmationData}
43
43
  verifyRecipient={verifyRecipient}
44
- ></RecipientConfirm>
44
+ />
45
45
  ) : (
46
- <RecipientPermissions {...props} className="u-flex-shrink-0" />
46
+ <MemberRecipientPermissions {...props} className="u-flex-shrink-0" />
47
47
  )
48
48
 
49
49
  return (
50
50
  <Fade in timeout={fadeIn ? FADE_IN_DURATION : 0}>
51
51
  <ListItem disableGutters>
52
52
  <ListItemIcon>
53
- <RecipientAvatar size="small" recipient={props} />
53
+ <MemberAvatar size="small" recipient={props} />
54
54
  </ListItemIcon>
55
55
  <ListItemText
56
56
  primary={
@@ -59,7 +59,11 @@ const Recipient = props => {
59
59
  </Typography>
60
60
  }
61
61
  secondary={
62
- <RecipientStatus status={status} isMe={isMe} instance={instance} />
62
+ <MemberRecipientStatus
63
+ status={status}
64
+ isMe={isMe}
65
+ instance={instance}
66
+ />
63
67
  }
64
68
  />
65
69
  {RightPart}
@@ -68,7 +72,7 @@ const Recipient = props => {
68
72
  )
69
73
  }
70
74
 
71
- Recipient.propTypes = {
75
+ MemberRecipient.propTypes = {
72
76
  instance: PropTypes.string,
73
77
  isOwner: PropTypes.bool,
74
78
  status: PropTypes.string,
@@ -76,4 +80,4 @@ Recipient.propTypes = {
76
80
  verifyRecipient: PropTypes.func
77
81
  }
78
82
 
79
- export default Recipient
83
+ export default MemberRecipient
@@ -3,10 +3,10 @@ import React from 'react'
3
3
 
4
4
  import { createMockClient } from 'cozy-client'
5
5
 
6
- import Recipient from './Recipient'
6
+ import MemberRecipient from './MemberRecipient'
7
7
  import AppLike from '../../../test/AppLike'
8
8
 
9
- describe('Recipient component', () => {
9
+ describe('MemberRecipient component', () => {
10
10
  const client = createMockClient({})
11
11
  client.options = {
12
12
  uri: 'foo.mycozy.cloud'
@@ -15,7 +15,7 @@ describe('Recipient component', () => {
15
15
  const setup = props => {
16
16
  return render(
17
17
  <AppLike client={client}>
18
- <Recipient {...props} />
18
+ <MemberRecipient {...props} />
19
19
  </AppLike>
20
20
  )
21
21
  }
@@ -0,0 +1,44 @@
1
+ import MemberRecipient from './MemberRecipient'
2
+
3
+ const meta = {
4
+ component: MemberRecipient,
5
+ args: {
6
+ instance: 'https://example.com',
7
+ isOwner: false,
8
+ status: 'ready',
9
+ recipientConfirmationData: null,
10
+ verifyRecipient: () => {},
11
+ fadeIn: true
12
+ },
13
+ argTypes: {
14
+ status: {
15
+ control: 'select',
16
+ options: ['ready', 'mail-not-sent', 'pending', 'seen', 'owner'],
17
+ defaultValue: 'ready'
18
+ }
19
+ }
20
+ }
21
+
22
+ export default meta
23
+
24
+ export const Default = {
25
+ name: 'Default',
26
+ args: {}
27
+ }
28
+
29
+ export const Owner = {
30
+ name: 'Owner',
31
+ args: {
32
+ isOwner: true,
33
+ status: 'owner'
34
+ }
35
+ }
36
+
37
+ export const RecipientConfirm = {
38
+ name: 'RecipientConfirm',
39
+ args: {
40
+ recipientConfirmationData: {
41
+ email: 'test'
42
+ }
43
+ }
44
+ }
@@ -13,7 +13,7 @@ import ActionMenu, {
13
13
  } from 'cozy-ui/transpiled/react/deprecated/ActionMenu'
14
14
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
15
15
 
16
- const RecipientPermissions = ({
16
+ const MemberRecipientPermissions = ({
17
17
  isOwner,
18
18
  status,
19
19
  instance,
@@ -113,4 +113,4 @@ const RecipientPermissions = ({
113
113
  )
114
114
  }
115
115
 
116
- export default RecipientPermissions
116
+ export default MemberRecipientPermissions
@@ -0,0 +1,13 @@
1
+ import MemberRecipientPermissions from './MemberRecipientPermissions'
2
+
3
+ const meta = {
4
+ component: MemberRecipientPermissions,
5
+ args: {}
6
+ }
7
+
8
+ export default meta
9
+
10
+ export const Default = {
11
+ name: 'Default',
12
+ args: {}
13
+ }
@@ -10,7 +10,7 @@ import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
10
10
 
11
11
  import styles from '../../styles/recipient.styl'
12
12
 
13
- const RecipientStatus = ({ status, isMe, instance }) => {
13
+ const MemberRecipientStatus = ({ status, isMe, instance }) => {
14
14
  const { t } = useI18n()
15
15
 
16
16
  const isSendingEmail = !isMe && status === 'mail-not-sent'
@@ -45,4 +45,4 @@ const RecipientStatus = ({ status, isMe, instance }) => {
45
45
  )
46
46
  }
47
47
 
48
- export default RecipientStatus
48
+ export default MemberRecipientStatus
@@ -0,0 +1,13 @@
1
+ import MemberRecipientStatus from './MemberRecipientStatus'
2
+
3
+ const meta = {
4
+ component: MemberRecipientStatus,
5
+ args: {}
6
+ }
7
+
8
+ export default meta
9
+
10
+ export const Default = {
11
+ name: 'Default',
12
+ args: {}
13
+ }
@@ -1,8 +1,8 @@
1
1
  import PropTypes from 'prop-types'
2
2
  import React from 'react'
3
3
 
4
+ import MemberRecipient from './MemberRecipient'
4
5
  import OwnerRecipientDefault from './OwnerRecipientDefault'
5
- import Recipient from './Recipient'
6
6
 
7
7
  const OwnerRecipient = ({ recipients }) => {
8
8
  const ownerRecipient = recipients.find(
@@ -10,7 +10,7 @@ const OwnerRecipient = ({ recipients }) => {
10
10
  )
11
11
 
12
12
  if (ownerRecipient) {
13
- return <Recipient {...ownerRecipient} />
13
+ return <MemberRecipient {...ownerRecipient} />
14
14
  }
15
15
 
16
16
  return <OwnerRecipientDefault />
@@ -0,0 +1,16 @@
1
+ import OwnerRecipient from './OwnerRecipient'
2
+ import { recipients } from '../../../.storybook/fixtures/recipients'
3
+
4
+ const meta = {
5
+ component: OwnerRecipient,
6
+ args: {
7
+ recipients
8
+ }
9
+ }
10
+
11
+ export default meta
12
+
13
+ export const Default = {
14
+ name: 'Default',
15
+ args: {}
16
+ }
@@ -2,7 +2,7 @@ import React from 'react'
2
2
 
3
3
  import { useClient, useQuery, hasQueryBeenLoaded } from 'cozy-client'
4
4
 
5
- import Recipient from './Recipient'
5
+ import MemberRecipient from './MemberRecipient'
6
6
  import { buildInstanceSettingsQuery } from '../../queries/queries'
7
7
 
8
8
  const OwnerRecipientDefault = () => {
@@ -16,7 +16,7 @@ const OwnerRecipientDefault = () => {
16
16
 
17
17
  return (
18
18
  hasQueryBeenLoaded(instanceSettingsResult) && (
19
- <Recipient
19
+ <MemberRecipient
20
20
  isOwner={true}
21
21
  status="owner"
22
22
  instance={client.options.uri}
@@ -0,0 +1,13 @@
1
+ import OwnerRecipientDefault from './OwnerRecipientDefault'
2
+
3
+ const meta = {
4
+ component: OwnerRecipientDefault,
5
+ args: {}
6
+ }
7
+
8
+ export default meta
9
+
10
+ export const Default = {
11
+ name: 'Default',
12
+ args: {}
13
+ }
@@ -17,15 +17,13 @@ const RecipientConfirm = ({ recipientConfirmationData, verifyRecipient }) => {
17
17
  }
18
18
 
19
19
  return (
20
- <>
21
- <Button
22
- style={{ position: 'initial' }} // fix z-index bug on iOS when under a BottomDrawer due to relative position
23
- theme="text"
24
- className={modalStyles['aligned-dropdown-button']}
25
- onClick={verify}
26
- label={t(`Share.twoStepsConfirmation.verify`)}
27
- />
28
- </>
20
+ <Button
21
+ style={{ position: 'initial' }} // fix z-index bug on iOS when under a BottomDrawer due to relative position
22
+ theme="text"
23
+ className={modalStyles['aligned-dropdown-button']}
24
+ onClick={verify}
25
+ label={t(`Share.twoStepsConfirmation.verify`)}
26
+ />
29
27
  )
30
28
  }
31
29
 
@@ -0,0 +1,13 @@
1
+ import RecipientConfirm from './RecipientConfirm'
2
+
3
+ const meta = {
4
+ component: RecipientConfirm,
5
+ args: {}
6
+ }
7
+
8
+ export default meta
9
+
10
+ export const Default = {
11
+ name: 'Default',
12
+ args: {}
13
+ }
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
 
3
- import Recipient from './Recipient'
3
+ import MemberRecipient from './MemberRecipient'
4
4
  import { usePrevious } from '../../helpers/hooks'
5
5
  import { filterAndReworkRecipients } from '../../helpers/recipients'
6
6
 
@@ -26,7 +26,7 @@ const RecipientList = ({
26
26
  )
27
27
 
28
28
  return (
29
- <Recipient
29
+ <MemberRecipient
30
30
  {...recipient}
31
31
  key={`key_r_${recipient.index}`}
32
32
  isOwner={isOwner}