@coorpacademy/components 11.11.3-alpha.2 → 11.11.3-alpha.3

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.
@@ -19,7 +19,7 @@ const BattleOpponent = ({
19
19
  const translate = GetTranslateFromContext(legacyContext);
20
20
  const wrapperClassnames = useMemo(() => classnames(style.card, style['opponent-card'], isRandom ? style.random : null), [isRandom]);
21
21
  const displayNameClassnames = useMemo(() => classnames(style.name, isAlreadyEngaged ? style.alreadyEngaged : null), [isAlreadyEngaged]);
22
- return /*#__PURE__*/React.createElement("div", _extends({}, !isAlreadyEngaged && {
22
+ return /*#__PURE__*/React.createElement("li", _extends({}, !isAlreadyEngaged && {
23
23
  onClick
24
24
  }, {
25
25
  className: wrapperClassnames,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","classnames","NovaCompositionNavigationArrowRight","ArrowRight","ToolTip","Provider","GetTranslateFromContext","propTypes","style","BattleOpponent","isAlreadyEngaged","isRandom","userAvatarSrc","onClick","displayName","tooltipText","legacyContext","translate","wrapperClassnames","card","random","displayNameClassnames","name","alreadyEngaged","avatar","infoIconTooltip","rightArrow","contextTypes","childContextTypes"],"sources":["../../../src/atom/battle-opponent/index.tsx"],"sourcesContent":["import React, {useMemo} from 'react';\nimport classnames from 'classnames';\nimport {NovaCompositionNavigationArrowRight as ArrowRight} from '@coorpacademy/nova-icons';\nimport ToolTip from '../tooltip';\nimport Provider, {GetTranslateFromContext} from '../provider';\nimport {WebContextValues} from '../provider/web-context';\nimport propTypes, {BattleOpponentProps} from './prop-types';\nimport style from './style.css';\n\nconst BattleOpponent = (\n {\n isAlreadyEngaged,\n isRandom,\n userAvatarSrc,\n onClick,\n displayName,\n tooltipText\n }: BattleOpponentProps,\n legacyContext: WebContextValues\n) => {\n const translate: Required<WebContextValues>['translate'] = GetTranslateFromContext(legacyContext);\n const wrapperClassnames = useMemo(\n () => classnames(style.card, style['opponent-card'], isRandom ? style.random : null),\n [isRandom]\n );\n\n const displayNameClassnames = useMemo(\n () => classnames(style.name, isAlreadyEngaged ? style.alreadyEngaged : null),\n [isAlreadyEngaged]\n );\n\n return (\n <div\n {...(!isAlreadyEngaged && {onClick})}\n className={wrapperClassnames}\n data-testid=\"battle-opponent-wrapper\"\n >\n <div className={style.avatar}>\n {isRandom ? null : <img src={userAvatarSrc} aria-hidden=\"true\" />}\n </div>\n <p className={displayNameClassnames}> {displayName}</p>\n {isAlreadyEngaged ? (\n <ToolTip\n fontSize={12}\n iconSize=\"big\"\n TooltipContent={tooltipText}\n closeToolTipInformationTextAriaLabel={translate(\n 'Press the escape key to close the information text'\n )}\n iconContainerClassName={style.infoIconTooltip}\n />\n ) : (\n <ArrowRight className={style.rightArrow} width={16} height={16} />\n )}\n </div>\n );\n};\n\nBattleOpponent.propTypes = propTypes;\n\nBattleOpponent.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default BattleOpponent;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,mCAAmC,IAAIC,UAA/C,QAAgE,0BAAhE;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,OAAOC,QAAP,IAAkBC,uBAAlB,QAAgD,aAAhD;AAEA,OAAOC,SAAP,MAA6C,cAA7C;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cAAc,GAAG,CACrB;EACEC,gBADF;EAEEC,QAFF;EAGEC,aAHF;EAIEC,OAJF;EAKEC,WALF;EAMEC;AANF,CADqB,EASrBC,aATqB,KAUlB;EACH,MAAMC,SAAkD,GAAGX,uBAAuB,CAACU,aAAD,CAAlF;EACA,MAAME,iBAAiB,GAAGlB,OAAO,CAC/B,MAAMC,UAAU,CAACO,KAAK,CAACW,IAAP,EAAaX,KAAK,CAAC,eAAD,CAAlB,EAAqCG,QAAQ,GAAGH,KAAK,CAACY,MAAT,GAAkB,IAA/D,CADe,EAE/B,CAACT,QAAD,CAF+B,CAAjC;EAKA,MAAMU,qBAAqB,GAAGrB,OAAO,CACnC,MAAMC,UAAU,CAACO,KAAK,CAACc,IAAP,EAAaZ,gBAAgB,GAAGF,KAAK,CAACe,cAAT,GAA0B,IAAvD,CADmB,EAEnC,CAACb,gBAAD,CAFmC,CAArC;EAKA,oBACE,wCACO,CAACA,gBAAD,IAAqB;IAACG;EAAD,CAD5B;IAEE,SAAS,EAAEK,iBAFb;IAGE,eAAY;EAHd,iBAKE;IAAK,SAAS,EAAEV,KAAK,CAACgB;EAAtB,GACGb,QAAQ,GAAG,IAAH,gBAAU;IAAK,GAAG,EAAEC,aAAV;IAAyB,eAAY;EAArC,EADrB,CALF,eAQE;IAAG,SAAS,EAAES;EAAd,QAAuCP,WAAvC,CARF,EASGJ,gBAAgB,gBACf,oBAAC,OAAD;IACE,QAAQ,EAAE,EADZ;IAEE,QAAQ,EAAC,KAFX;IAGE,cAAc,EAAEK,WAHlB;IAIE,oCAAoC,EAAEE,SAAS,CAC7C,oDAD6C,CAJjD;IAOE,sBAAsB,EAAET,KAAK,CAACiB;EAPhC,EADe,gBAWf,oBAAC,UAAD;IAAY,SAAS,EAAEjB,KAAK,CAACkB,UAA7B;IAAyC,KAAK,EAAE,EAAhD;IAAoD,MAAM,EAAE;EAA5D,EApBJ,CADF;AAyBD,CA/CD;;AAiDAjB,cAAc,CAACF,SAAf,2CAA2BA,SAA3B;AAEAE,cAAc,CAACkB,YAAf,GAA8B;EAC5BV,SAAS,EAAEZ,QAAQ,CAACuB,iBAAT,CAA2BX;AADV,CAA9B;AAIA,eAAeR,cAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useMemo","classnames","NovaCompositionNavigationArrowRight","ArrowRight","ToolTip","Provider","GetTranslateFromContext","propTypes","style","BattleOpponent","isAlreadyEngaged","isRandom","userAvatarSrc","onClick","displayName","tooltipText","legacyContext","translate","wrapperClassnames","card","random","displayNameClassnames","name","alreadyEngaged","avatar","infoIconTooltip","rightArrow","contextTypes","childContextTypes"],"sources":["../../../src/atom/battle-opponent/index.tsx"],"sourcesContent":["import React, {useMemo} from 'react';\nimport classnames from 'classnames';\nimport {NovaCompositionNavigationArrowRight as ArrowRight} from '@coorpacademy/nova-icons';\nimport ToolTip from '../tooltip';\nimport Provider, {GetTranslateFromContext} from '../provider';\nimport {WebContextValues} from '../provider/web-context';\nimport propTypes, {BattleOpponentProps} from './prop-types';\nimport style from './style.css';\n\nconst BattleOpponent = (\n {\n isAlreadyEngaged,\n isRandom,\n userAvatarSrc,\n onClick,\n displayName,\n tooltipText\n }: BattleOpponentProps,\n legacyContext: WebContextValues\n) => {\n const translate: Required<WebContextValues>['translate'] = GetTranslateFromContext(legacyContext);\n const wrapperClassnames = useMemo(\n () => classnames(style.card, style['opponent-card'], isRandom ? style.random : null),\n [isRandom]\n );\n\n const displayNameClassnames = useMemo(\n () => classnames(style.name, isAlreadyEngaged ? style.alreadyEngaged : null),\n [isAlreadyEngaged]\n );\n\n return (\n <li\n {...(!isAlreadyEngaged && {onClick})}\n className={wrapperClassnames}\n data-testid=\"battle-opponent-wrapper\"\n >\n <div className={style.avatar}>\n {isRandom ? null : <img src={userAvatarSrc} aria-hidden=\"true\" />}\n </div>\n <p className={displayNameClassnames}> {displayName}</p>\n {isAlreadyEngaged ? (\n <ToolTip\n fontSize={12}\n iconSize=\"big\"\n TooltipContent={tooltipText}\n closeToolTipInformationTextAriaLabel={translate(\n 'Press the escape key to close the information text'\n )}\n iconContainerClassName={style.infoIconTooltip}\n />\n ) : (\n <ArrowRight className={style.rightArrow} width={16} height={16} />\n )}\n </li>\n );\n};\n\nBattleOpponent.propTypes = propTypes;\n\nBattleOpponent.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default BattleOpponent;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,mCAAmC,IAAIC,UAA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AWf,oBAAC,UAAD;IAAY,SAAS,EAAEjB,KAAK,CAACkB,UAA7B;IAAyC,KAAK,EAAE,EAAhD;IAAoD,MAAM,EAAE;EAA5D,EApBJ,CADF;AAyBD,CA/CD;;AAiDAjB,cAAc,CAACF,SAAf,2CAA2BA,SAA3B;AAEAE,cAAc,CAACkB,YAAf,GAA8B;EAC5BV,SAAS,EAAEZ,QAAQ,CAACuB,iBAAT,CAA2BX;AADV,CAA9B;AAIA,eAAeR,cAAf"}
@@ -50,7 +50,6 @@
50
50
  margin-left: 20px;
51
51
  }
52
52
 
53
- /* div:not(.random) */
54
53
  .avatar {
55
54
  width: 50px;
56
55
  height: 50px;
@@ -102,7 +101,6 @@
102
101
 
103
102
  .card .infoIconTooltip {
104
103
  background: transparent;
105
- /* height: 100%; */
106
104
  }
107
105
 
108
106
  @media mobile {
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { BattleOpponentListProps } from './prop-types';
3
3
  declare const BattleOpponentList: {
4
- ({ opponents }: BattleOpponentListProps): JSX.Element[];
4
+ ({ opponents }: BattleOpponentListProps): JSX.Element;
5
5
  propTypes: {
6
6
  opponents: import("prop-types").Requireable<(import("prop-types").InferProps<{
7
7
  isAlreadyEngaged: import("prop-types").Requireable<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/battle-opponent-list/index.tsx"],"names":[],"mappings":";AAIA,OAAkB,EAAC,uBAAuB,EAAC,MAAM,cAAc,CAAC;AAEhE,QAAA,MAAM,kBAAkB;oBAAiB,uBAAuB;;;;;;;;;;;;CAiB/D,CAAC;AAIF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/battle-opponent-list/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAC,uBAAuB,EAAC,MAAM,cAAc,CAAC;AAGhE,QAAA,MAAM,kBAAkB;oBAAiB,uBAAuB;;;;;;;;;;;;CAiB/D,CAAC;AAIF,eAAe,kBAAkB,CAAC"}
@@ -3,17 +3,21 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  import React, { useMemo } from 'react';
4
4
  import get from 'lodash/fp/get';
5
5
  import map from 'lodash/fp/map';
6
+ import { v5 as uuidV5 } from 'uuid';
6
7
  import BattleOpponent from '../../atom/battle-opponent';
7
8
  import propTypes from './prop-types';
9
+ import style from './style.css';
8
10
 
9
11
  const BattleOpponentList = ({
10
12
  opponents
11
13
  }) => {
12
14
  const opponentList = useMemo(() => map(opponent => /*#__PURE__*/React.createElement(BattleOpponent, _extends({}, opponent, {
13
- key: opponent.user_id,
15
+ key: uuidV5('battle-', uuidV5.URL),
14
16
  userAvatarSrc: get('photo', opponent)
15
17
  })), opponents), [opponents]);
16
- return opponentList;
18
+ return /*#__PURE__*/React.createElement("ul", {
19
+ className: style.opponentList
20
+ }, opponentList);
17
21
  };
18
22
 
19
23
  BattleOpponentList.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","get","map","BattleOpponent","propTypes","BattleOpponentList","opponents","opponentList","opponent","user_id"],"sources":["../../../src/molecule/battle-opponent-list/index.tsx"],"sourcesContent":["import React, {useMemo} from 'react';\nimport get from 'lodash/fp/get';\nimport map from 'lodash/fp/map';\nimport BattleOpponent from '../../atom/battle-opponent';\nimport propTypes, {BattleOpponentListProps} from './prop-types';\n\nconst BattleOpponentList = ({opponents}: BattleOpponentListProps) => {\n const opponentList = useMemo(\n () =>\n map(\n opponent => (\n <BattleOpponent\n {...opponent}\n key={opponent.user_id}\n userAvatarSrc={get('photo', opponent)}\n />\n ),\n opponents\n ),\n [opponents]\n );\n\n return opponentList;\n};\n\nBattleOpponentList.propTypes = propTypes;\n\nexport default BattleOpponentList;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,cAAP,MAA2B,4BAA3B;AACA,OAAOC,SAAP,MAAiD,cAAjD;;AAEA,MAAMC,kBAAkB,GAAG,CAAC;EAACC;AAAD,CAAD,KAA0C;EACnE,MAAMC,YAAY,GAAGP,OAAO,CAC1B,MACEE,GAAG,CACDM,QAAQ,iBACN,oBAAC,cAAD,eACMA,QADN;IAEE,GAAG,EAAEA,QAAQ,CAACC,OAFhB;IAGE,aAAa,EAAER,GAAG,CAAC,OAAD,EAAUO,QAAV;EAHpB,GAFD,EAQDF,SARC,CAFqB,EAY1B,CAACA,SAAD,CAZ0B,CAA5B;EAeA,OAAOC,YAAP;AACD,CAjBD;;AAmBAF,kBAAkB,CAACD,SAAnB,2CAA+BA,SAA/B;AAEA,eAAeC,kBAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useMemo","get","map","v5","uuidV5","BattleOpponent","propTypes","style","BattleOpponentList","opponents","opponentList","opponent","URL"],"sources":["../../../src/molecule/battle-opponent-list/index.tsx"],"sourcesContent":["import React, {useMemo} from 'react';\nimport get from 'lodash/fp/get';\nimport map from 'lodash/fp/map';\nimport {v5 as uuidV5} from 'uuid';\nimport BattleOpponent from '../../atom/battle-opponent';\nimport propTypes, {BattleOpponentListProps} from './prop-types';\nimport style from './style.css';\n\nconst BattleOpponentList = ({opponents}: BattleOpponentListProps) => {\n const opponentList = useMemo(\n () =>\n map(\n opponent => (\n <BattleOpponent\n {...opponent}\n key={uuidV5('battle-', uuidV5.URL)}\n userAvatarSrc={get('photo', opponent)}\n />\n ),\n opponents\n ),\n [opponents]\n );\n\n return <ul className={style.opponentList}>{opponentList}</ul>;\n};\n\nBattleOpponentList.propTypes = propTypes;\n\nexport default BattleOpponentList;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,SAAQC,EAAE,IAAIC,MAAd,QAA2B,MAA3B;AACA,OAAOC,cAAP,MAA2B,4BAA3B;AACA,OAAOC,SAAP,MAAiD,cAAjD;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,kBAAkB,GAAG,CAAC;EAACC;AAAD,CAAD,KAA0C;EACnE,MAAMC,YAAY,GAAGV,OAAO,CAC1B,MACEE,GAAG,CACDS,QAAQ,iBACN,oBAAC,cAAD,eACMA,QADN;IAEE,GAAG,EAAEP,MAAM,CAAC,SAAD,EAAYA,MAAM,CAACQ,GAAnB,CAFb;IAGE,aAAa,EAAEX,GAAG,CAAC,OAAD,EAAUU,QAAV;EAHpB,GAFD,EAQDF,SARC,CAFqB,EAY1B,CAACA,SAAD,CAZ0B,CAA5B;EAeA,oBAAO;IAAI,SAAS,EAAEF,KAAK,CAACG;EAArB,GAAoCA,YAApC,CAAP;AACD,CAjBD;;AAmBAF,kBAAkB,CAACF,SAAnB,2CAA+BA,SAA/B;AAEA,eAAeE,kBAAf"}
@@ -0,0 +1,5 @@
1
+ .opponentList {
2
+ margin: 0;
3
+ padding: 0;
4
+ display: contents;
5
+ }
@@ -36,7 +36,7 @@ const BattleOpponent = ({
36
36
  const translate = (0, _provider.GetTranslateFromContext)(legacyContext);
37
37
  const wrapperClassnames = (0, _react.useMemo)(() => (0, _classnames.default)(_style.default.card, _style.default['opponent-card'], isRandom ? _style.default.random : null), [isRandom]);
38
38
  const displayNameClassnames = (0, _react.useMemo)(() => (0, _classnames.default)(_style.default.name, isAlreadyEngaged ? _style.default.alreadyEngaged : null), [isAlreadyEngaged]);
39
- return /*#__PURE__*/_react.default.createElement("div", _extends({}, !isAlreadyEngaged && {
39
+ return /*#__PURE__*/_react.default.createElement("li", _extends({}, !isAlreadyEngaged && {
40
40
  onClick
41
41
  }, {
42
42
  className: wrapperClassnames,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["BattleOpponent","isAlreadyEngaged","isRandom","userAvatarSrc","onClick","displayName","tooltipText","legacyContext","translate","GetTranslateFromContext","wrapperClassnames","useMemo","classnames","style","card","random","displayNameClassnames","name","alreadyEngaged","avatar","infoIconTooltip","rightArrow","propTypes","contextTypes","Provider","childContextTypes"],"sources":["../../../src/atom/battle-opponent/index.tsx"],"sourcesContent":["import React, {useMemo} from 'react';\nimport classnames from 'classnames';\nimport {NovaCompositionNavigationArrowRight as ArrowRight} from '@coorpacademy/nova-icons';\nimport ToolTip from '../tooltip';\nimport Provider, {GetTranslateFromContext} from '../provider';\nimport {WebContextValues} from '../provider/web-context';\nimport propTypes, {BattleOpponentProps} from './prop-types';\nimport style from './style.css';\n\nconst BattleOpponent = (\n {\n isAlreadyEngaged,\n isRandom,\n userAvatarSrc,\n onClick,\n displayName,\n tooltipText\n }: BattleOpponentProps,\n legacyContext: WebContextValues\n) => {\n const translate: Required<WebContextValues>['translate'] = GetTranslateFromContext(legacyContext);\n const wrapperClassnames = useMemo(\n () => classnames(style.card, style['opponent-card'], isRandom ? style.random : null),\n [isRandom]\n );\n\n const displayNameClassnames = useMemo(\n () => classnames(style.name, isAlreadyEngaged ? style.alreadyEngaged : null),\n [isAlreadyEngaged]\n );\n\n return (\n <div\n {...(!isAlreadyEngaged && {onClick})}\n className={wrapperClassnames}\n data-testid=\"battle-opponent-wrapper\"\n >\n <div className={style.avatar}>\n {isRandom ? null : <img src={userAvatarSrc} aria-hidden=\"true\" />}\n </div>\n <p className={displayNameClassnames}> {displayName}</p>\n {isAlreadyEngaged ? (\n <ToolTip\n fontSize={12}\n iconSize=\"big\"\n TooltipContent={tooltipText}\n closeToolTipInformationTextAriaLabel={translate(\n 'Press the escape key to close the information text'\n )}\n iconContainerClassName={style.infoIconTooltip}\n />\n ) : (\n <ArrowRight className={style.rightArrow} width={16} height={16} />\n )}\n </div>\n );\n};\n\nBattleOpponent.propTypes = propTypes;\n\nBattleOpponent.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default BattleOpponent;\n"],"mappings":";;;;;AAAA;;AACA;;AACA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,EAAhD;IAAoD,MAAM,EAAE;EAA5D,EApBJ,CADF;AAyBD,CA/CD;;AAiDArB,cAAc,CAACsB,SAAf,2CAA2BA,kBAA3B;AAEAtB,cAAc,CAACuB,YAAf,GAA8B;EAC5Bf,SAAS,EAAEgB,iBAAA,CAASC,iBAAT,CAA2BjB;AADV,CAA9B;eAIeR,c"}
1
+ {"version":3,"file":"index.js","names":["BattleOpponent","isAlreadyEngaged","isRandom","userAvatarSrc","onClick","displayName","tooltipText","legacyContext","translate","GetTranslateFromContext","wrapperClassnames","useMemo","classnames","style","card","random","displayNameClassnames","name","alreadyEngaged","avatar","infoIconTooltip","rightArrow","propTypes","contextTypes","Provider","childContextTypes"],"sources":["../../../src/atom/battle-opponent/index.tsx"],"sourcesContent":["import React, {useMemo} from 'react';\nimport classnames from 'classnames';\nimport {NovaCompositionNavigationArrowRight as ArrowRight} from '@coorpacademy/nova-icons';\nimport ToolTip from '../tooltip';\nimport Provider, {GetTranslateFromContext} from '../provider';\nimport {WebContextValues} from '../provider/web-context';\nimport propTypes, {BattleOpponentProps} from './prop-types';\nimport style from './style.css';\n\nconst BattleOpponent = (\n {\n isAlreadyEngaged,\n isRandom,\n userAvatarSrc,\n onClick,\n displayName,\n tooltipText\n }: BattleOpponentProps,\n legacyContext: WebContextValues\n) => {\n const translate: Required<WebContextValues>['translate'] = GetTranslateFromContext(legacyContext);\n const wrapperClassnames = useMemo(\n () => classnames(style.card, style['opponent-card'], isRandom ? style.random : null),\n [isRandom]\n );\n\n const displayNameClassnames = useMemo(\n () => classnames(style.name, isAlreadyEngaged ? style.alreadyEngaged : null),\n [isAlreadyEngaged]\n );\n\n return (\n <li\n {...(!isAlreadyEngaged && {onClick})}\n className={wrapperClassnames}\n data-testid=\"battle-opponent-wrapper\"\n >\n <div className={style.avatar}>\n {isRandom ? null : <img src={userAvatarSrc} aria-hidden=\"true\" />}\n </div>\n <p className={displayNameClassnames}> {displayName}</p>\n {isAlreadyEngaged ? (\n <ToolTip\n fontSize={12}\n iconSize=\"big\"\n TooltipContent={tooltipText}\n closeToolTipInformationTextAriaLabel={translate(\n 'Press the escape key to close the information text'\n )}\n iconContainerClassName={style.infoIconTooltip}\n />\n ) : (\n <ArrowRight className={style.rightArrow} width={16} height={16} />\n )}\n </li>\n );\n};\n\nBattleOpponent.propTypes = propTypes;\n\nBattleOpponent.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default BattleOpponent;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEA,MAAMA,cAAc,GAAG,CACrB;EACEC,gBADF;EAEEC,QAFF;EAGEC,aAHF;EAIEC,OAJF;EAKEC,WALF;EAMEC;AANF,CADqB,EASrBC,aATqB,KAUlB;EACH,MAAMC,SAAkD,GAAG,IAAAC,iCAAA,EAAwBF,aAAxB,CAA3D;EACA,MAAMG,iBAAiB,GAAG,IAAAC,cAAA,EACxB,MAAM,IAAAC,mBAAA,EAAWC,cAAA,CAAMC,IAAjB,EAAuBD,cAAA,CAAM,eAAN,CAAvB,EAA+CX,QAAQ,GAAGW,cAAA,CAAME,MAAT,GAAkB,IAAzE,CADkB,EAExB,CAACb,QAAD,CAFwB,CAA1B;EAKA,MAAMc,qBAAqB,GAAG,IAAAL,cAAA,EAC5B,MAAM,IAAAC,mBAAA,EAAWC,cAAA,CAAMI,IAAjB,EAAuBhB,gBAAgB,GAAGY,cAAA,CAAMK,cAAT,GAA0B,IAAjE,CADsB,EAE5B,CAACjB,gBAAD,CAF4B,CAA9B;EAKA,oBACE,gDACO,CAACA,gBAAD,IAAqB;IAACG;EAAD,CAD5B;IAEE,SAAS,EAAEM,iBAFb;IAGE,eAAY;EAHd,iBAKE;IAAK,SAAS,EAAEG,cAAA,CAAMM;EAAtB,GACGjB,QAAQ,GAAG,IAAH,gBAAU;IAAK,GAAG,EAAEC,aAAV;IAAyB,eAAY;EAArC,EADrB,CALF,eAQE;IAAG,SAAS,EAAEa;EAAd,QAAuCX,WAAvC,CARF,EASGJ,gBAAgB,gBACf,6BAAC,gBAAD;IACE,QAAQ,EAAE,EADZ;IAEE,QAAQ,EAAC,KAFX;IAGE,cAAc,EAAEK,WAHlB;IAIE,oCAAoC,EAAEE,SAAS,CAC7C,oDAD6C,CAJjD;IAOE,sBAAsB,EAAEK,cAAA,CAAMO;EAPhC,EADe,gBAWf,6BAAC,8CAAD;IAAY,SAAS,EAAEP,cAAA,CAAMQ,UAA7B;IAAyC,KAAK,EAAE,EAAhD;IAAoD,MAAM,EAAE;EAA5D,EApBJ,CADF;AAyBD,CA/CD;;AAiDArB,cAAc,CAACsB,SAAf,2CAA2BA,kBAA3B;AAEAtB,cAAc,CAACuB,YAAf,GAA8B;EAC5Bf,SAAS,EAAEgB,iBAAA,CAASC,iBAAT,CAA2BjB;AADV,CAA9B;eAIeR,c"}
@@ -50,7 +50,6 @@
50
50
  margin-left: 20px;
51
51
  }
52
52
 
53
- /* div:not(.random) */
54
53
  .avatar {
55
54
  width: 50px;
56
55
  height: 50px;
@@ -102,7 +101,6 @@
102
101
 
103
102
  .card .infoIconTooltip {
104
103
  background: transparent;
105
- /* height: 100%; */
106
104
  }
107
105
 
108
106
  @media mobile {
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { BattleOpponentListProps } from './prop-types';
3
3
  declare const BattleOpponentList: {
4
- ({ opponents }: BattleOpponentListProps): JSX.Element[];
4
+ ({ opponents }: BattleOpponentListProps): JSX.Element;
5
5
  propTypes: {
6
6
  opponents: import("prop-types").Requireable<(import("prop-types").InferProps<{
7
7
  isAlreadyEngaged: import("prop-types").Requireable<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/battle-opponent-list/index.tsx"],"names":[],"mappings":";AAIA,OAAkB,EAAC,uBAAuB,EAAC,MAAM,cAAc,CAAC;AAEhE,QAAA,MAAM,kBAAkB;oBAAiB,uBAAuB;;;;;;;;;;;;CAiB/D,CAAC;AAIF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/battle-opponent-list/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAC,uBAAuB,EAAC,MAAM,cAAc,CAAC;AAGhE,QAAA,MAAM,kBAAkB;oBAAiB,uBAAuB;;;;;;;;;;;;CAiB/D,CAAC;AAIF,eAAe,kBAAkB,CAAC"}
@@ -9,10 +9,14 @@ var _get = _interopRequireDefault(require("lodash/fp/get"));
9
9
 
10
10
  var _map = _interopRequireDefault(require("lodash/fp/map"));
11
11
 
12
+ var _uuid = require("uuid");
13
+
12
14
  var _battleOpponent = _interopRequireDefault(require("../../atom/battle-opponent"));
13
15
 
14
16
  var _propTypes = _interopRequireDefault(require("./prop-types"));
15
17
 
18
+ var _style = _interopRequireDefault(require("./style.css"));
19
+
16
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
21
 
18
22
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -25,10 +29,12 @@ const BattleOpponentList = ({
25
29
  opponents
26
30
  }) => {
27
31
  const opponentList = (0, _react.useMemo)(() => (0, _map.default)(opponent => /*#__PURE__*/_react.default.createElement(_battleOpponent.default, _extends({}, opponent, {
28
- key: opponent.user_id,
32
+ key: (0, _uuid.v5)('battle-', _uuid.v5.URL),
29
33
  userAvatarSrc: (0, _get.default)('photo', opponent)
30
34
  })), opponents), [opponents]);
31
- return opponentList;
35
+ return /*#__PURE__*/_react.default.createElement("ul", {
36
+ className: _style.default.opponentList
37
+ }, opponentList);
32
38
  };
33
39
 
34
40
  BattleOpponentList.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["BattleOpponentList","opponents","opponentList","useMemo","map","opponent","user_id","get","propTypes"],"sources":["../../../src/molecule/battle-opponent-list/index.tsx"],"sourcesContent":["import React, {useMemo} from 'react';\nimport get from 'lodash/fp/get';\nimport map from 'lodash/fp/map';\nimport BattleOpponent from '../../atom/battle-opponent';\nimport propTypes, {BattleOpponentListProps} from './prop-types';\n\nconst BattleOpponentList = ({opponents}: BattleOpponentListProps) => {\n const opponentList = useMemo(\n () =>\n map(\n opponent => (\n <BattleOpponent\n {...opponent}\n key={opponent.user_id}\n userAvatarSrc={get('photo', opponent)}\n />\n ),\n opponents\n ),\n [opponents]\n );\n\n return opponentList;\n};\n\nBattleOpponentList.propTypes = propTypes;\n\nexport default BattleOpponentList;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,kBAAkB,GAAG,CAAC;EAACC;AAAD,CAAD,KAA0C;EACnE,MAAMC,YAAY,GAAG,IAAAC,cAAA,EACnB,MACE,IAAAC,YAAA,EACEC,QAAQ,iBACN,6BAAC,uBAAD,eACMA,QADN;IAEE,GAAG,EAAEA,QAAQ,CAACC,OAFhB;IAGE,aAAa,EAAE,IAAAC,YAAA,EAAI,OAAJ,EAAaF,QAAb;EAHjB,GAFJ,EAQEJ,SARF,CAFiB,EAYnB,CAACA,SAAD,CAZmB,CAArB;EAeA,OAAOC,YAAP;AACD,CAjBD;;AAmBAF,kBAAkB,CAACQ,SAAnB,2CAA+BA,kBAA/B;eAEeR,kB"}
1
+ {"version":3,"file":"index.js","names":["BattleOpponentList","opponents","opponentList","useMemo","map","opponent","uuidV5","URL","get","style","propTypes"],"sources":["../../../src/molecule/battle-opponent-list/index.tsx"],"sourcesContent":["import React, {useMemo} from 'react';\nimport get from 'lodash/fp/get';\nimport map from 'lodash/fp/map';\nimport {v5 as uuidV5} from 'uuid';\nimport BattleOpponent from '../../atom/battle-opponent';\nimport propTypes, {BattleOpponentListProps} from './prop-types';\nimport style from './style.css';\n\nconst BattleOpponentList = ({opponents}: BattleOpponentListProps) => {\n const opponentList = useMemo(\n () =>\n map(\n opponent => (\n <BattleOpponent\n {...opponent}\n key={uuidV5('battle-', uuidV5.URL)}\n userAvatarSrc={get('photo', opponent)}\n />\n ),\n opponents\n ),\n [opponents]\n );\n\n return <ul className={style.opponentList}>{opponentList}</ul>;\n};\n\nBattleOpponentList.propTypes = propTypes;\n\nexport default BattleOpponentList;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,kBAAkB,GAAG,CAAC;EAACC;AAAD,CAAD,KAA0C;EACnE,MAAMC,YAAY,GAAG,IAAAC,cAAA,EACnB,MACE,IAAAC,YAAA,EACEC,QAAQ,iBACN,6BAAC,uBAAD,eACMA,QADN;IAEE,GAAG,EAAE,IAAAC,QAAA,EAAO,SAAP,EAAkBA,QAAA,CAAOC,GAAzB,CAFP;IAGE,aAAa,EAAE,IAAAC,YAAA,EAAI,OAAJ,EAAaH,QAAb;EAHjB,GAFJ,EAQEJ,SARF,CAFiB,EAYnB,CAACA,SAAD,CAZmB,CAArB;EAeA,oBAAO;IAAI,SAAS,EAAEQ,cAAA,CAAMP;EAArB,GAAoCA,YAApC,CAAP;AACD,CAjBD;;AAmBAF,kBAAkB,CAACU,SAAnB,2CAA+BA,kBAA/B;eAEeV,kB"}
@@ -0,0 +1,5 @@
1
+ .opponentList {
2
+ margin: 0;
3
+ padding: 0;
4
+ display: contents;
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/components",
3
- "version": "11.11.3-alpha.2+4c6a31bd7",
3
+ "version": "11.11.3-alpha.3+7f44d5afd",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -120,6 +120,7 @@
120
120
  "@testing-library/react": "12.1.5",
121
121
  "@testing-library/react-native": "^10.1.1",
122
122
  "@types/react-native": "~0.68.7",
123
+ "@types/uuid": "^9.0.0",
123
124
  "@typescript-eslint/eslint-plugin": "^5.39.0",
124
125
  "@typescript-eslint/parser": "^5.39.0",
125
126
  "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
@@ -164,5 +165,5 @@
164
165
  "last 2 versions",
165
166
  "IE 11"
166
167
  ],
167
- "gitHead": "4c6a31bd713a7da67689ceb2c5264264ede89d70"
168
+ "gitHead": "7f44d5afd0d9b6331d8adccf2509d4e21905a8b4"
168
169
  }