@antscorp/antsomi-ui 1.3.5-beta.118 → 1.3.5-beta.119

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.
@@ -5,6 +5,7 @@ import { LayoutContent } from './components';
5
5
  import { shareAccessReducer } from './reducer';
6
6
  import { updateObjAccessInfo } from './actions';
7
7
  import { useDeepCompareEffect } from '@antscorp/antsomi-ui/es/hooks/useDeepCompareEffect';
8
+ import { formattedAccessInfo } from './utils';
8
9
  export const ShareAccess = (props) => {
9
10
  const { accessInfo, excludeUserAccess, userId, onChange, userPermission } = props;
10
11
  const [state, dispatch] = useReducer(shareAccessReducer(onChange), {
@@ -16,7 +17,7 @@ export const ShareAccess = (props) => {
16
17
  useDeepCompareEffect(() => {
17
18
  if (!accessInfo)
18
19
  return;
19
- dispatch(updateObjAccessInfo(accessInfo));
20
+ dispatch(updateObjAccessInfo(formattedAccessInfo(accessInfo)));
20
21
  }, [accessInfo]);
21
22
  return (React.createElement(ShareAccessStateContext.Provider, { value: Object.assign(Object.assign({}, state), { excludeUserAccess, accessUserId: userId, accessUserPermission: userPermission }) },
22
23
  React.createElement(ShareAccessDispatchContext.Provider, { value: dispatch },
@@ -37,3 +37,18 @@ export declare const getActionsByUser: (args: {
37
37
  readonly key: "remove_acess";
38
38
  })[];
39
39
  export declare const initAccessInfoDefault: (userInfo: Partial<UserInfo>) => ObjectAccessInfo;
40
+ export declare const formattedAccessInfo: (accessInfo: ObjectAccessInfo) => {
41
+ ownerId: number;
42
+ listAccess: {
43
+ userId: number;
44
+ fullName: string;
45
+ email: string;
46
+ avatar: string;
47
+ role: number;
48
+ allowView: number;
49
+ allowEdit: number;
50
+ allowComment: number;
51
+ }[];
52
+ isPublic: number;
53
+ publicRole: number | null;
54
+ };
@@ -64,3 +64,7 @@ export const initAccessInfoDefault = (userInfo) => ({
64
64
  publicRole: PUBLIC_ROLE.ONLY_VIEWER,
65
65
  isPublic: 0,
66
66
  });
67
+ export const formattedAccessInfo = (accessInfo) => {
68
+ var _a;
69
+ return (Object.assign(Object.assign({}, accessInfo), { ownerId: +((accessInfo === null || accessInfo === void 0 ? void 0 : accessInfo.ownerId) || -1), listAccess: (_a = accessInfo === null || accessInfo === void 0 ? void 0 : accessInfo.listAccess) === null || _a === void 0 ? void 0 : _a.map(user => (Object.assign(Object.assign({}, user), { userId: +user.userId }))) }));
70
+ };
@@ -4,18 +4,34 @@ import skeletonBackground from '../../../../../assets/images/background/skeleton
4
4
  const THUMBNAIL_CARD_RADIUS = 5;
5
5
  export const BannerWrapper = styled.div `
6
6
  width: 100%;
7
- height: 830px;
8
- max-height: 830px;
9
7
  overflow-y: hidden;
10
8
  display: flex;
11
9
  justify-content: center;
12
10
  align-items: center;
13
11
  background-color: #0000001a;
14
12
 
13
+ @media screen and (max-height: 1000px) {
14
+ height: 760px;
15
+ max-height: 760px;
16
+
17
+ .mobile-wrapper {
18
+ width: 359px;
19
+ height: 722.41px;
20
+ }
21
+ }
22
+
23
+ @media screen and (min-height: 1001px) {
24
+ height: 830px;
25
+ max-height: 830px;
26
+
27
+ .mobile-wrapper {
28
+ width: 380px;
29
+ height: 800px;
30
+ }
31
+ }
32
+
15
33
  .mobile-wrapper {
16
34
  position: relative;
17
- width: 380px;
18
- height: 800px;
19
35
  border-radius: 80px;
20
36
  animation-duration: 0.2s !important;
21
37
 
@@ -27,6 +27,6 @@ export const SimilarTemplate = memo(props => {
27
27
  const _b = similarCardProps || {}, { width = SIMILAR_CARD_WIDTH_DEFAULT, height = SIMILAR_CARD_HEIGHT_DEFAULT } = _b, restOfSimilarCardProps = __rest(_b, ["width", "height"]);
28
28
  return show ? (React.createElement(SimilarTemplateWrapper, { gap: 15, vertical: true },
29
29
  React.createElement("div", { className: "title" }, "Similar templates"),
30
- isEmpty(similarTemplates) ? (React.createElement(Flex, { justify: "center" },
30
+ isEmpty(similarTemplates) ? (React.createElement(Flex, { justify: "center", align: "center", style: { height } },
31
31
  React.createElement(Empty, null))) : (React.createElement(TemplateListWrapper, { templateQuantity: MAX_QUANTITY_TEMPLATES }, (_a = similarTemplates.slice(0, MAX_QUANTITY_TEMPLATES)) === null || _a === void 0 ? void 0 : _a.map(({ id, name, thumbnail }) => (React.createElement(ThumbnailCard, Object.assign({ key: id, id: id, name: name, width: width, height: height, thumbnail: thumbnail, actionAvailable: false }, restOfSimilarCardProps)))))))) : null;
32
32
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.118",
3
+ "version": "1.3.5-beta.119",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",