From f54f5689eeeb4a2b0e999e534313ac05c10c0360 Mon Sep 17 00:00:00 2001 From: reyhubcom <94319232+reyhubcom@users.noreply.github.com> Date: Sun, 10 Sep 2023 21:18:53 -0400 Subject: [PATCH 1/3] Create index copy.tsx --- src/components/basic/View/index copy.tsx | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/components/basic/View/index copy.tsx diff --git a/src/components/basic/View/index copy.tsx b/src/components/basic/View/index copy.tsx new file mode 100644 index 000000000..28ff34146 --- /dev/null +++ b/src/components/basic/View/index copy.tsx @@ -0,0 +1 @@ +export { View } from './View'; From 08c0f91f1ee3879f263eadf4c1247d0578a1d618 Mon Sep 17 00:00:00 2001 From: reyhubcom <94319232+reyhubcom@users.noreply.github.com> Date: Sun, 17 Sep 2023 12:13:05 -0400 Subject: [PATCH 2/3] Create qr copy.png --- img/qr copy.png | Bin 0 -> 2933 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 img/qr copy.png diff --git a/img/qr copy.png b/img/qr copy.png new file mode 100644 index 0000000000000000000000000000000000000000..91b0d5c24853108e5a6dd2c024fa5e75a1635aac GIT binary patch literal 2933 zcmaJ@2{_x?7XMqG!J|`3)%HnaDK!mKBBZ2KLYmQ3BC*WSu`fXql4wj@#JrgnV;Q@O zprMxN(}tlHx=>47L&uWV1VuwtT6{XRr8Mu)^mV*9?|b>an|sc^_jk^@zjM#|{%QD= z7|lyK`?Kx2IFPhG<~qxiGO*kiq? zIu4EWVmj{rz>dBTnAT~VLc|WYD;mvhoGQ^B8vDMiQ!V@U{u!jIo08jkHMI)s3$^dh zDHs%H1RE#|oGXm}>8QJ}n6445BB!Qy1jTMo-%S(+1x`5(+=+#>Km_I*i$D+Uvu<*a z+itrzr`e+-3I&Q5Z@#KWCn6J=e z3P=y=1NFJBz2o-zzwG?!aR<_OC(>aja>vepBfS`5bQc;0bjd{hnVApZotqzkj#gVY z-@(KmG;gnhJfl<{tv==qr7B1XBm=-Fby)N>-(D9qo zEZ5dAx-PZn6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SRS>0>*EXSdJ^5>9QfV804c>CJOBUy literal 0 HcmV?d00001 From 1365951a800d44e29577de8e79db60451ae33e0f Mon Sep 17 00:00:00 2001 From: reyhubcom <94319232+reyhubcom@users.noreply.github.com> Date: Sun, 17 Sep 2023 12:14:13 -0400 Subject: [PATCH 3/3] Create Avatar copy.tsx --- .../composites/Avatar/Avatar copy.tsx | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/components/composites/Avatar/Avatar copy.tsx diff --git a/src/components/composites/Avatar/Avatar copy.tsx b/src/components/composites/Avatar/Avatar copy.tsx new file mode 100644 index 000000000..adb54ccc6 --- /dev/null +++ b/src/components/composites/Avatar/Avatar copy.tsx @@ -0,0 +1,72 @@ +import React, { memo, forwardRef } from 'react'; +import { Box, Image } from '../../primitives'; +import { usePropsResolution } from '../../../hooks/useThemeProps'; +import type { IAvatarProps } from './types'; +import { useHasResponsiveProps } from '../../../hooks/useHasResponsiveProps'; +import isNil from 'lodash.isnil'; +import has from 'lodash.has'; + +const Avatar = ({ children, ...props }: IAvatarProps, ref: any) => { + const [error, setError] = React.useState(false); + const { _image, _badgeSize, source, ...resolvedProps } = usePropsResolution( + 'Avatar', + props + ); + + let Badge = <>; + const remainingChildren: JSX.Element[] = []; + // Pop Badge from children + React.Children.map(children, (child) => { + if ( + typeof child?.type === 'object' && + child?.type.displayName === 'AvatarBadge' + ) { + Badge = React.cloneElement(child, { + size: child?.props?.size + ? child?.props?.size + : _badgeSize + ? _badgeSize[0] + : undefined, + }); + } else { + remainingChildren.push(child); + } + }); + + //TODO: refactor for responsive prop + if (useHasResponsiveProps(props)) { + return null; + } + + const getSource = () => { + if (source) { + if (has(source, 'uri') && !isNil(source.uri)) { + return source; + } else if (!has(source, 'uri')) { + return source; + } + } + return null; + }; + const imageSource = getSource(); + + return ( + + {imageSource && !error ? ( + { + setError(true); + }} + {..._image} + ref={ref} + /> + ) : ( + remainingChildren.length !== 0 && remainingChildren + )} + {Badge} + + ); +}; + +export default memo(forwardRef(Avatar));