Skip to content

Commit

Permalink
yarn lock
Browse files Browse the repository at this point in the history
  • Loading branch information
andreigiura committed Nov 28, 2023
2 parents a74b557 + 2efa001 commit 8928849
Show file tree
Hide file tree
Showing 139 changed files with 3,444 additions and 2,125 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [[v2.24.1]](https://github.com/multiversx/mx-sdk-dapp/pull/973)] - 2023-11-28
- [Fixed logout redirect loop](https://github.com/multiversx/mx-sdk-dapp/pull/973)

## [[v2.24.0]](https://github.com/multiversx/mx-sdk-dapp/pull/972)] - 2023-11-24
- [Full SSR support](https://github.com/multiversx/mx-sdk-dapp/pull/971)

## [[v2.23.1]](https://github.com/multiversx/mx-sdk-dapp/pull/970)] - 2023-11-20
- [Changed transaction sender validation](https://github.com/multiversx/mx-sdk-dapp/pull/969)

## [[v2.23.0]](https://github.com/multiversx/mx-sdk-dapp/pull/956)] - 2023-10-13
- [Added xAlias login methods](https://github.com/multiversx/mx-sdk-dapp/pull/966)
- [Added `sdk-dapp-version` to web wallet communication](https://github.com/multiversx/mx-sdk-dapp/pull/964)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@multiversx/sdk-dapp",
"version": "2.24.2-alpha.0",
"version": "2.24.2-alpha.1",
"description": "A library to hold the main logic for a dapp on the MultiversX blockchain",
"author": "MultiversX",
"license": "GPL-3.0-or-later",
Expand Down
16 changes: 10 additions & 6 deletions src/UI/CopyButton/CopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import React, { useState, MouseEvent } from 'react';
import { IconProp } from '@fortawesome/fontawesome-svg-core';
import { faCheck, faCopy } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

import classNames from 'classnames';
import { withStyles, WithStylesImportType } from 'hocs/withStyles';
import { WithClassnameType } from '../types';
import styles from './copyButton.styles.scss';
import { copyTextToClipboard } from './helpers/copyToClipboard';

export interface CopyButtonPropsType extends WithClassnameType {
Expand All @@ -14,12 +13,13 @@ export interface CopyButtonPropsType extends WithClassnameType {
successIcon?: IconProp;
}

export const CopyButton = ({
const CopyButtonComponent = ({
text,
className = 'dapp-copy-button',
copyIcon = faCopy,
successIcon = faCheck
}: CopyButtonPropsType) => {
successIcon = faCheck,
styles
}: CopyButtonPropsType & WithStylesImportType) => {
const [copyResult, setCopyResut] = useState({
default: true,
success: false
Expand Down Expand Up @@ -48,7 +48,7 @@ export const CopyButton = ({
<a
href='/#'
onClick={handleCopyToClipboard}
className={classNames(styles.copy, className)}
className={classNames(styles?.copy, className)}
>
{copyResult.default || !copyResult.success ? (
<FontAwesomeIcon icon={copyIcon} />
Expand All @@ -58,3 +58,7 @@ export const CopyButton = ({
</a>
);
};

export const CopyButton = withStyles(CopyButtonComponent, {
local: () => import('UI/CopyButton/copyButton.styles.scss')
});
18 changes: 11 additions & 7 deletions src/UI/DappModal/components/DappModal.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React, { ReactNode } from 'react';
import classNames from 'classnames';
import ReactDOM from 'react-dom';

import { DataTestIdsEnum } from 'constants/index';
import { withStyles, WithStylesImportType } from 'hocs/withStyles';
import { WithClassnameType } from '../../types';
import { DappModalConfig } from '../dappModal.types';
import styles from '../dappModalStyles.scss';
import { DappModalBody } from './DappModalBody';
import { DappModalFooter } from './DappModalFooter';
import { DappModalHeader } from './DappModalHeader';
Expand All @@ -26,16 +25,17 @@ const defaultConfig: DappModalConfig = {
footerText: ''
};

export const DappModal = ({
const DappModalComponent = ({
'data-testid': dataTestId = DataTestIdsEnum.dappModal,
children,
className = 'dapp-modal-dialog-wrapper',
config = defaultConfig,
id = 'dapp-modal',
onHide,
parentElement,
visible
}: DappModalPropsType) => {
visible,
styles
}: DappModalPropsType & WithStylesImportType) => {
if (!visible) {
return null;
}
Expand All @@ -61,11 +61,11 @@ export const DappModal = ({
id={id}
role='dialog'
aria-modal='true'
className={classNames(modalDialogClassName, styles.dappModal, className)}
className={classNames(modalDialogClassName, styles?.dappModal, className)}
data-testid={dataTestId}
>
<div
className={classNames(styles.dappModalContent, modalContentClassName)}
className={classNames(styles?.dappModalContent, modalContentClassName)}
>
<DappModalHeader
visible={showHeader}
Expand All @@ -90,3 +90,7 @@ export const DappModal = ({
parentElement ?? document?.body
);
};

export const DappModal = withStyles(DappModalComponent, {
local: () => import('UI/DappModal/dappModalStyles.scss')
});
17 changes: 10 additions & 7 deletions src/UI/DappModal/components/DappModalBody.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import React, { ReactNode } from 'react';
import classNames from 'classnames';

import { withStyles, WithStylesImportType } from 'hocs/withStyles';
import { WithClassnameType } from '../../types';

import styles from '../dappModalStyles.scss';

export interface DappModalBodyPropsType extends WithClassnameType {
children?: ReactNode;
}

export const DappModalBody = ({
const DappModalBodyComponent = ({
className,
children
}: DappModalBodyPropsType) => {
children,
styles
}: DappModalBodyPropsType & WithStylesImportType) => {
return (
<div className={classNames(styles.dappModalBody, className)}>
<div className={classNames(styles?.dappModalBody, className)}>
{children}
</div>
);
};

export const DappModalBody = withStyles(DappModalBodyComponent, {
local: () => import('UI/DappModal/dappModalStyles.scss')
});
17 changes: 10 additions & 7 deletions src/UI/DappModal/components/DappModalFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
import React from 'react';
import classNames from 'classnames';

import { withStyles, WithStylesImportType } from 'hocs/withStyles';
import { WithClassnameType } from '../../types';

import styles from '../dappModalStyles.scss';

export interface DappModalFooterPropsType extends WithClassnameType {
visible?: boolean;
footerText?: string;
customFooter?: JSX.Element;
}

export const DappModalFooter = ({
const DappModalFooterComponent = ({
visible,
customFooter,
className,
footerText
}: DappModalFooterPropsType) => {
footerText,
styles
}: DappModalFooterPropsType & WithStylesImportType) => {
if (!visible) {
return null;
}

return (
<div className={classNames(styles.dappModalFooter, className)}>
<div className={classNames(styles?.dappModalFooter, className)}>
{customFooter ?? <div>{footerText}</div>}
</div>
);
};

export const DappModalFooter = withStyles(DappModalFooterComponent, {
local: () => import('UI/DappModal/dappModalStyles.scss')
});
29 changes: 16 additions & 13 deletions src/UI/DappModal/components/DappModalHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ import React from 'react';
import { faTimes } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import classNames from 'classnames';

import globalStyles from 'assets/sass/main.scss';
import { withStyles, WithStylesImportType } from 'hocs/withStyles';
import { WithClassnameType } from '../../types';

import styles from '../dappModalStyles.scss';

export interface DappModalHeaderPropsType extends WithClassnameType {
visible?: boolean;
headerText?: string;
Expand All @@ -17,37 +14,39 @@ export interface DappModalHeaderPropsType extends WithClassnameType {
onHide?: () => void;
}

export const DappModalHeader = ({
const DappModalHeaderComponent = ({
visible,
headerText,
customHeader,
className,
closeButtonClassName,
headerTextClassName,
onHide
}: DappModalHeaderPropsType) => {
onHide,
globalStyles,
styles
}: DappModalHeaderPropsType & WithStylesImportType) => {
if (!visible) {
return null;
}

return customHeader ? (
<div className={classNames(styles.dappModalHeader, className)}>
<div className={classNames(styles?.dappModalHeader, className)}>
{customHeader}
</div>
) : (
<div className={classNames(styles.dappModalHeader, className)}>
<div className={classNames(styles?.dappModalHeader, className)}>
<div
className={classNames(styles.dappModalHeaderText, headerTextClassName)}
className={classNames(styles?.dappModalHeaderText, headerTextClassName)}
>
{headerText}
</div>

<button
onClick={onHide}
className={classNames(
styles.dappModalCloseButton,
globalStyles.btn,
globalStyles.btnLight,
styles?.dappModalCloseButton,
globalStyles?.btn,
globalStyles?.btnLight,
closeButtonClassName
)}
>
Expand All @@ -56,3 +55,7 @@ export const DappModalHeader = ({
</div>
);
};

export const DappModalHeader = withStyles(DappModalHeaderComponent, {
local: () => import('UI/DappModal/dappModalStyles.scss')
});
20 changes: 11 additions & 9 deletions src/UI/ExplorerLink/ExplorerLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ import React, { PropsWithChildren } from 'react';
import { faArrowUpRightFromSquare } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import classNames from 'classnames';
import globalStyles from 'assets/sass/main.scss';

import { withStyles, WithStylesImportType } from 'hocs/withStyles';
import { useGetNetworkConfig } from 'hooks/useGetNetworkConfig';
import { getExplorerLink } from 'utils/transactions/getInterpretedTransaction/helpers/getExplorerLink';

import { WithClassnameType } from '../types';

import styles from './explorerLinkStyles.scss';

export interface ExplorerLinkPropsType
extends PropsWithChildren,
WithClassnameType {
Expand All @@ -21,21 +17,23 @@ export interface ExplorerLinkPropsType
'data-testid'?: string;
}

export const ExplorerLink = ({
const ExplorerLinkComponent = ({
page,
text,
className = 'dapp-explorer-link',
children,
globalStyles,
styles,
...rest
}: ExplorerLinkPropsType) => {
}: ExplorerLinkPropsType & WithStylesImportType) => {
const {
network: { explorerAddress }
} = useGetNetworkConfig();

const defaultContent = text ?? (
<FontAwesomeIcon
icon={faArrowUpRightFromSquare}
className={styles.search}
className={styles?.search}
/>
);

Expand All @@ -48,11 +46,15 @@ export const ExplorerLink = ({
<a
href={link}
target='_blank'
className={classNames(styles.link, globalStyles.ml2, className)}
className={classNames(styles?.link, globalStyles?.ml2, className)}
rel='noreferrer'
{...rest}
>
{children ?? defaultContent}
</a>
);
};

export const ExplorerLink = withStyles(ExplorerLinkComponent, {
local: () => import('UI/ExplorerLink/explorerLinkStyles.scss')
});
Loading

0 comments on commit 8928849

Please sign in to comment.