Skip to content

Commit

Permalink
Merge branch 'main' into 1964-other-user-profileemail-api-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
corlard3y authored Dec 6, 2024
2 parents 5019452 + c395fcc commit 1e5cd07
Show file tree
Hide file tree
Showing 53 changed files with 849 additions and 105 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
"@metamask/eth-sig-util": "^4.0.0",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.5.0",
"@pushprotocol/restapi": "1.7.25",
"@pushprotocol/restapi": "1.7.29",
"@pushprotocol/socket": "0.5.3",
"@pushprotocol/uiweb": "1.7.1",
"@pushprotocol/uiweb": "1.7.2",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-switch": "^1.1.0",
Expand Down
25 changes: 21 additions & 4 deletions src/blocks/icons/components/Asterisk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,33 @@ const Asterisk: FC<IconProps> = (allProps) => {
componentName="Asterisk"
icon={
<svg
xmlns="http://www.w3.org/2000/svg"
width="inherit"
height="inherit"
viewBox="0 0 5 5"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 32 32"
fill="none"
{...props}
>
<path
d="M0.687978 4.28802L0.795978 4.14402L1.43198 3.32202L1.83998 2.84202C1.82798 2.81802 1.82198 2.79402 1.81598 2.76402L1.20998 2.62002L0.207978 2.33802L0.039978 2.28402L0.327978 1.40202L0.495978 1.45602L1.47398 1.81002L2.04398 2.04402C2.06798 2.02602 2.09198 2.00802 2.11598 1.99002L2.07398 1.39002L2.03798 0.346015V0.166016H2.96198V0.346015L2.92598 1.39002L2.87798 1.99002C2.90198 2.00802 2.92598 2.02602 2.94998 2.04402L3.51998 1.81002L4.50398 1.45602L4.67198 1.40202L4.95998 2.28402L4.78598 2.33802L3.78398 2.62002L3.17798 2.76402C3.17198 2.79402 3.16598 2.81802 3.15398 2.84202L3.56198 3.32202L4.20398 4.14402L4.30598 4.28802L3.55598 4.83402L3.45398 4.68402L2.87198 3.82002L2.54798 3.29202C2.52998 3.29202 2.51198 3.29202 2.49998 3.29202C2.48198 3.29202 2.46398 3.29202 2.44598 3.29202L2.12198 3.82002L1.53998 4.68402L1.43798 4.83402L0.687978 4.28802Z"
fill="currentColor"
d="M16 5V27"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M6 10L26 22"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M6 22L26 10"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
}
Expand Down
32 changes: 32 additions & 0 deletions src/blocks/icons/components/FillCircle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { FC } from 'react';
import { IconWrapper } from '../IconWrapper';
import { IconProps } from '../Icons.types';

const FillCircle: FC<IconProps> = (allProps) => {
const { svgProps: props, ...restProps } = allProps;
return (
<IconWrapper
componentName="FillCircle"
icon={
<svg
xmlns="http://www.w3.org/2000/svg"
width="inherit"
height="inherit"
viewBox="0 0 20 20"
fill="none"
{...props}
>
<circle
cx="10"
cy="10"
r="10"
fill="currentColor"
/>
</svg>
}
{...restProps}
/>
);
};

export default FillCircle;
55 changes: 55 additions & 0 deletions src/blocks/icons/components/Image.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { FC } from 'react';
import { IconWrapper } from '../IconWrapper';
import { IconProps } from '../Icons.types';

const Image: FC<IconProps> = (allProps) => {
const { svgProps: props, ...restProps } = allProps;
return (
<IconWrapper
componentName="Image"
icon={
<svg
xmlns="http://www.w3.org/2000/svg"
width="inherit"
height="inherit"
viewBox="0 0 24 22"
fill="none"
{...props}
>
<path
d="M15.2109 9.20528C15.97 9.20528 16.5854 8.58987 16.5854 7.83073C16.5854 7.07158 15.97 6.45618 15.2109 6.45618C14.4517 6.45618 13.8363 7.07158 13.8363 7.83073C13.8363 8.58987 14.4517 9.20528 15.2109 9.20528Z"
fill="currentColor"
/>
<path
d="M14.2155 15.1617L17.1581 12.2224C17.33 12.0507 17.563 11.9542 17.8059 11.9542C18.0488 11.9542 18.2818 12.0507 18.4537 12.2224L23 16.7722"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M1.0072 15.6989L7.23163 9.47329C7.31674 9.38809 7.41781 9.3205 7.52905 9.27438C7.6403 9.22827 7.75954 9.20453 7.87997 9.20453C8.00039 9.20453 8.11963 9.22827 8.23088 9.27438C8.34213 9.3205 8.44319 9.38809 8.5283 9.47329L19.2555 20.2017"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
<rect
x="1"
y="1.79828"
width="22"
height="18.4034"
rx="4"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
}
{...restProps}
/>
);
};

export default Image;
29 changes: 22 additions & 7 deletions src/blocks/icons/components/Lock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,38 @@ const Lock: FC<IconProps> = (allProps) => {
xmlns="http://www.w3.org/2000/svg"
width="inherit"
height="inherit"
viewBox="0 0 29 28"
viewBox="0 0 32 32"
fill="none"
{...props}
>
<g clip-path="url(#clip0_5205_40502)">
<g clip-path="url(#clip0_9875_5020)">
<path
d="M21.8657 8.75H19.3657V6.125C19.3657 4.73261 18.8126 3.39726 17.828 2.41269C16.8435 1.42812 15.5081 0.875 14.1157 0.875C12.7233 0.875 11.388 1.42812 10.4034 2.41269C9.41885 3.39726 8.86572 4.73261 8.86572 6.125V8.75H6.36572C5.90159 8.75 5.45647 8.93437 5.12829 9.26256C4.8001 9.59075 4.61572 10.0359 4.61572 10.5V22.75C4.61572 23.2141 4.8001 23.6592 5.12829 23.9874C5.45647 24.3156 5.90159 24.5 6.36572 24.5H21.8657C22.3299 24.5 22.775 24.3156 23.1032 23.9874C23.4313 23.6592 23.6157 23.2141 23.6157 22.75V10.5C23.6157 10.0359 23.4313 9.59075 23.1032 9.26256C22.775 8.93437 22.3299 8.75 21.8657 8.75ZM14.1157 17.9375C13.8561 17.9375 13.6024 17.8605 13.3865 17.7163C13.1707 17.5721 13.0025 17.3671 12.9031 17.1273C12.8038 16.8874 12.7778 16.6235 12.8284 16.3689C12.8791 16.1143 13.0041 15.8805 13.1876 15.6969C13.3712 15.5134 13.6051 15.3884 13.8597 15.3377C14.1143 15.2871 14.3782 15.3131 14.618 15.4124C14.8578 15.5117 15.0628 15.68 15.207 15.8958C15.3512 16.1117 15.4282 16.3654 15.4282 16.625C15.4282 16.9731 15.2899 17.3069 15.0438 17.5531C14.7977 17.7992 14.4638 17.9375 14.1157 17.9375ZM17.6157 8.75H10.6157V6.125C10.6157 5.19674 10.9845 4.3065 11.6408 3.65013C12.2972 2.99375 13.1875 2.625 14.1157 2.625C15.044 2.625 15.9342 2.99375 16.5906 3.65013C17.247 4.3065 17.6157 5.19674 17.6157 6.125V8.75Z"
d="M16 21.5638C16.8284 21.5638 17.5 20.8922 17.5 20.0638C17.5 19.2354 16.8284 18.5638 16 18.5638C15.1716 18.5638 14.5 19.2354 14.5 20.0638C14.5 20.8922 15.1716 21.5638 16 21.5638Z"
fill="currentColor"
/>
<path
d="M11 12.9362V8.93622C11 7.61014 11.5268 6.33837 12.4645 5.40068C13.4021 4.463 14.6739 3.93622 16 3.93622C17.3261 3.93622 18.5979 4.463 19.5355 5.40068C20.4732 6.33837 21 7.61014 21 8.93622V12.9362"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
<rect
x="5"
y="13"
width="22"
height="15"
rx="3"
stroke="currentColor"
stroke-width="2"
/>
</g>
<defs>
<clipPath id="clip0_5205_40502">
<clipPath id="clip0_9875_5020">
<rect
width="28"
height="28"
width="32"
height="32"
fill="white"
transform="translate(0.115723)"
/>
</clipPath>
</defs>
Expand Down
8 changes: 4 additions & 4 deletions src/blocks/icons/components/Logout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ const Logout: FC<IconProps> = (allProps) => {
xmlns="http://www.w3.org/2000/svg"
width="inherit"
height="inherit"
viewBox="0 0 24 24"
viewBox="0 0 32 32"
fill="none"
{...props}
>
<path
d="M10.0962 1H3.63464C2.53008 1 1.63464 1.89543 1.63464 3V21C1.63464 22.1046 2.53007 23 3.63464 23H10.0962"
d="M14.0962 5H7.63464C6.53008 5 5.63464 5.89543 5.63464 7V25C5.63464 26.1046 6.53007 27 7.63464 27H14.0962"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
/>
<path
d="M8.8269 11.5769H22.3654"
d="M12.8269 15.5769H26.3654"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
/>
<path
d="M17.7115 6.0769L22.3654 11.5769L17.7115 17.5"
d="M21.7115 10.0769L26.3654 15.5769L21.7115 21.5"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
Expand Down
2 changes: 2 additions & 0 deletions src/blocks/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ export { default as ErrorFilled } from './components/ErrorFilled';
export { default as ExternalLink } from './components/ExternalLink';

export { default as Front } from './components/Front';
export { default as FillCircle } from './components/FillCircle';

export { default as Gif } from './components/Gif';

export { default as InfoFilled } from './components/InfoFilled';
export { default as Image } from './components/Image';

export { default as Governance } from './components/Governance';
export { default as GovernanceFilled } from './components/GovernanceFilled';
Expand Down
6 changes: 4 additions & 2 deletions src/blocks/notification/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,14 @@ const toastIds: Array<string | number> = [];

// Export the notification object with show and hide methods
const notification = {
show: (config: NotificationProps) => {
show: (config: NotificationProps, id?: string) => {
const toastId = toast.custom(() => <NotificationItem {...config} />, {
id: id,
duration: config.duration || Infinity,
position: config.position || 'bottom-right',
onAutoClose: config.onAutoClose,
});
toastIds.push(toastId);
if (!toastIds.find((toastId) => toastId === id)) toastIds.push(toastId);
},
hide: () => {
if (toastIds.length > 0) {
Expand Down
2 changes: 2 additions & 0 deletions src/blocks/notification/Notification.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ export type NotificationProps = {
position?: 'bottom-right' | 'bottom-left' | 'top-center';
/* Optional duration of the notification component */
duration?: number;
/* Optional onAutoClose event for the notification called after it's timeout */
onAutoClose?: () => void;
};
34 changes: 29 additions & 5 deletions src/blocks/text/Text.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,19 @@ export const textVariants = {
letterSpacing: null,
textTransform: 'uppercase',
},
'c-regular': {
fontSize: '12px',
fontStyle: null,
fontWeight: '400',
lineHeight: '16px',
letterSpacing: null,
textTransform: null,
},
'c-semibold': {
fontSize: '10px',
fontSize: '12px',
fontStyle: null,
fontWeight: 500,
lineHeight: '14px',
lineHeight: '16px',
letterSpacing: null,
textTransform: null,
},
Expand All @@ -368,11 +376,27 @@ export const textVariants = {
letterSpacing: null,
textTransform: null,
},
'c-regular': {
fontSize: '12px',
'cs-regular': {
fontSize: '10px',
fontStyle: null,
fontWeight: '400',
lineHeight: '16px',
lineHeight: '14px',
letterSpacing: null,
textTransform: null,
},
'cs-semibold': {
fontSize: '10px',
fontStyle: null,
fontWeight: 500,
lineHeight: '14px',
letterSpacing: null,
textTransform: null,
},
'cs-bold': {
fontSize: '12px',
fontStyle: null,
fontWeight: '700',
lineHeight: '14px',
letterSpacing: null,
textTransform: null,
},
Expand Down
3 changes: 3 additions & 0 deletions src/common/Common.baseLogos.ts

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions src/common/Common.utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { appConfig } from 'config';
import { LOGO_ALIAS_CHAIN } from './Common.constants';
import { networkName } from 'helpers/UtilityHelper';
import { EnvType } from './Common.types';
import moment from 'moment';

export const allowedNetworks = appConfig.allowedNetworks.filter(
(chain: number) => chain != appConfig.coreContractChain
Expand Down Expand Up @@ -53,3 +54,19 @@ export const isValidURL = (str: string | undefined) => {
export const getCurrentEnv = (): EnvType => {
return appConfig.appEnv;
};

export function convertTimeStamp(timestamp: string) {
const date = moment.unix(Number(timestamp));
const now = moment();

const diffInSeconds = now.diff(date, 'seconds');
const diffInMinutes = now.diff(date, 'minutes');

if (diffInSeconds < 60) {
return 'now';
} else if (diffInMinutes < 60) {
return `${diffInMinutes} minutes ago`;
} else {
return date.format('hh:mm A');
}
}
Loading

0 comments on commit 1e5cd07

Please sign in to comment.