Skip to content

Commit ef50eea

Browse files
arhtudormorarmgavrilaiuliacimpeanuMiroMargineanu
authored
Resolve main conflicts (#257)
* 0.0.36 (#251) * Storybook Deployment Setup (#248) * Added Storybook deployment workflow * Added secrets references * Added workflow dependency to run the GitHub action * Fixed workflow build * Fixed workflow build * Fixed workflow build * Fixed workflow build * Fixed workflow build * Fixed storybook build rendering on server * Fixed type in main * Added comments to converter * Updated CHANGELOG.md * Updated deployment branch * Fixed build * Removed lit * Fixed build * Updated deployment branch * Updated deployment branch * Remove lit --------- Co-authored-by: Tudor Morar <tudor.morar@multiversx.com> * Refactor components in transactions table (#243) * Updated styles * Removed unused styles * Removed unused styles * Updated styles * Updated CHANGELOG.md * Updated icons * Removed unused icons * Updated styles * Updated styles * Updated styles * Updated styles * Updated shards arrow styles * Added icons to replace Fontawesome * Updated styles * Fixed tests * Updated styles on transactions table * Refactored FontAwesome icons * Fixed test * Updated scrollbar styles * Fixes after review. * Removed FontAwesome packages * Updated icons * Fixed tests * Fixes * Fixes. * Fixes * Refactored transaction-age * Updated changelog * Fixed path * Removed transaction-direction-badge component not used * Refactored transaction-hash comp * Refactored components from transactions-table * Refactored classNames * Updated changelog * Fixed tests * Fixed tests * Updated TransactionIcon * Updated TransactionIcon * Updated default icon * Fixes * Fixes --------- Co-authored-by: Miro Mărgineanu <miro.margineanu@multiversx.com> * Updated icons type (#250) * Fixed icon name * Fixed name * Updated truncate * Updated changelog * Updated icons * Fixed tests * Fixes * Fixed casts * Fixed errors * v0.0.36 --------- Co-authored-by: Miro <miro.margineanu@multiversx.com> Co-authored-by: Tudor Morar <tudor.morar@multiversx.com> * 0.0.36 (#251) * Storybook Deployment Setup (#248) * Added Storybook deployment workflow * Added secrets references * Added workflow dependency to run the GitHub action * Fixed workflow build * Fixed workflow build * Fixed workflow build * Fixed workflow build * Fixed workflow build * Fixed storybook build rendering on server * Fixed type in main * Added comments to converter * Updated CHANGELOG.md * Updated deployment branch * Fixed build * Removed lit * Fixed build * Updated deployment branch * Updated deployment branch * Remove lit --------- Co-authored-by: Tudor Morar <tudor.morar@multiversx.com> * Refactor components in transactions table (#243) * Updated styles * Removed unused styles * Removed unused styles * Updated styles * Updated CHANGELOG.md * Updated icons * Removed unused icons * Updated styles * Updated styles * Updated styles * Updated styles * Updated shards arrow styles * Added icons to replace Fontawesome * Updated styles * Fixed tests * Updated styles on transactions table * Refactored FontAwesome icons * Fixed test * Updated scrollbar styles * Fixes after review. * Removed FontAwesome packages * Updated icons * Fixed tests * Fixes * Fixes. * Fixes * Refactored transaction-age * Updated changelog * Fixed path * Removed transaction-direction-badge component not used * Refactored transaction-hash comp * Refactored components from transactions-table * Refactored classNames * Updated changelog * Fixed tests * Fixed tests * Updated TransactionIcon * Updated TransactionIcon * Updated default icon * Fixes * Fixes --------- Co-authored-by: Miro Mărgineanu <miro.margineanu@multiversx.com> * Updated icons type (#250) * Fixed icon name * Fixed name * Updated truncate * Updated changelog * Updated icons * Fixed tests * Fixes * Fixed casts * Fixed errors * v0.0.36 --------- Co-authored-by: Miro <miro.margineanu@multiversx.com> Co-authored-by: Tudor Morar <tudor.morar@multiversx.com> * Update CHANGELOG * Build and test * Lint project * redo components * Update changelog with recent pull request links * Update CHANGELOG.md --------- Co-authored-by: Gavrila Andrei <andrei.gavrila@multiversx.com> Co-authored-by: Iulia Cimpeanu <72752718+iuliacimpeanu@users.noreply.github.com> Co-authored-by: Miro <miro.margineanu@multiversx.com>
1 parent fa65f28 commit ef50eea

File tree

26 files changed

+216
-248
lines changed

26 files changed

+216
-248
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
- [Fixed main conflicts with main branch](https://github.com/multiversx/mx-sdk-dapp-ui/pull/257)
11+
1012
- [Added enum for transaction status](https://github.com/multiversx/mx-sdk-dapp-ui/pull/254)
1113

1214
- [Fixed icons on batch transactions toast](https://github.com/multiversx/mx-sdk-dapp-ui/pull/253)

src/common/Icon/Icon.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ import { AngleRightIcon } from './components/AngleRightIcon';
66
import { AnglesLeftIcon } from './components/AnglesLeftIcon';
77
import { AnglesRightIcon } from './components/AnglesRightIcon';
88
import { AngleUpIcon } from './components/AngleUpIcon';
9+
import { ArrowsRotateIcon } from './components/ArrowsRotateIcon';
910
import { ArrowUpRightFromSquareIcon } from './components/ArrowUpRightFromSquare';
1011
import { ArrowUpRightIcon } from './components/ArrowUpRightIcon';
1112
import { BackArrowIcon } from './components/BackArrowIcon';
13+
import { BanIcon } from './components/BanIcon';
1214
import { CheckIcon } from './components/CheckIcon';
15+
import { CircleCheckIcon } from './components/CircleCheckIcon';
1316
import { CircleExclamationIcon } from './components/CircleExclamationIcon';
17+
import { CircleInfoIcon } from './components/CircleInfoIcon';
1418
import { CloseIcon } from './components/CloseIcon';
19+
import { CoinsIcon } from './components/CoinsIcon';
1520
import { ContractIcon } from './components/ContractIcon';
1621
import { CopyIcon } from './components/CopyIcon';
22+
import { HourglassIcon } from './components/HourglassIcon';
1723
import { LayersIcon } from './components/LayersIcon';
1824
import { LockIcon } from './components/LockIcon';
1925
import { PencilIcon } from './components/PencilIcon';
2026
import { TriangularWarningIcon } from './components/TriangularWarningIcon';
2127
import type { IconPropsType } from './icon.types';
22-
import { HourglassIcon } from './components/HourglassIcon';
23-
import { BanIcon } from './components/BanIcon';
24-
import { CircleCheckIcon } from './components/CircleCheckIcon';
25-
import { CircleInfoIcon } from './components/CircleInfoIcon';
26-
import { CoinsIcon } from './components/CoinsIcon';
27-
import { ArrowsRotateIcon } from './components/ArrowsRotateIcon';
2828

2929
export const Icon = ({ name, ...properties }: IconPropsType) => {
3030
if (!name) {

src/common/Trim/Trim.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { h } from '@stencil/core';
22
import { DataTestIdsEnum } from 'constants/dataTestIds.enum';
33
import { ELLIPSIS } from 'constants/htmlStrings';
4+
45
import styles from './trim.styles'
56

67
interface TrimPropsType {

src/components/common/trim/trim.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, h, Prop, State } from '@stencil/core';
2+
import { Trim as TrimComponent } from 'common/Trim/Trim';
23
import { DataTestIdsEnum } from 'constants/dataTestIds.enum';
34
import { safeWindow } from 'constants/window.constants';
4-
import { Trim as TrimComponent } from 'common/Trim/Trim';
55

66
@Component({
77
tag: 'mvx-trim',
@@ -66,14 +66,16 @@ export class Trim {
6666
};
6767

6868
render() {
69-
return <TrimComponent
70-
class={this.class}
71-
dataTestId={this.dataTestId}
72-
text={this.text}
73-
shouldTrim={this.shouldTrim}
74-
trimFontSize={this.trimFontSize}
75-
onTrimElementReference={this.handleTrimElementReference.bind(this)}
76-
onFullWidthTrimElementReference={this.handleFullWidthTrimElementReference.bind(this)}
77-
/>;
69+
return (
70+
<TrimComponent
71+
class={this.class}
72+
dataTestId={this.dataTestId}
73+
text={this.text}
74+
shouldTrim={this.shouldTrim}
75+
trimFontSize={this.trimFontSize}
76+
onTrimElementReference={this.handleTrimElementReference.bind(this)}
77+
onFullWidthTrimElementReference={this.handleFullWidthTrimElementReference.bind(this)}
78+
/>
79+
);
7880
}
79-
}
81+
}
Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { h } from '@stencil/core';
2+
import { ExplorerLink } from 'common/ExplorerLink/ExplorerLink';
23
import { Icon } from 'common/Icon';
34
import { DataTestIdsEnum } from 'constants/dataTestIds.enum';
45

56
import type { TransactionAccountType } from '../../transactions-table.type';
67
import { TransactionAccountName } from './components';
7-
import { ExplorerLink } from 'common/ExplorerLink/ExplorerLink';
88

99
// prettier-ignore
1010
const styles = {
@@ -13,41 +13,38 @@ const styles = {
1313
} satisfies Record<string, string>;
1414

1515
interface TransactionAccountPropsType {
16-
account: TransactionAccountType;
17-
class?: string;
18-
dataTestId?: string;
19-
scope: 'receiver' | 'sender';
20-
showLockedAccounts: boolean;
16+
account: TransactionAccountType;
17+
class?: string;
18+
dataTestId?: string;
19+
scope: 'receiver' | 'sender';
20+
showLockedAccounts: boolean;
2121
}
2222

23-
export function TransactionAccount({ account, dataTestId, scope, showLockedAccounts = false, class: className }: TransactionAccountPropsType) {
24-
const explorerLinkDataTestId =
25-
scope === 'receiver' ? DataTestIdsEnum.receiverLink : DataTestIdsEnum.senderLink;
23+
export function TransactionAccount({
24+
account,
25+
dataTestId,
26+
scope,
27+
showLockedAccounts = false,
28+
class: className,
29+
}: TransactionAccountPropsType) {
30+
const explorerLinkDataTestId = scope === 'receiver' ? DataTestIdsEnum.receiverLink : DataTestIdsEnum.senderLink;
2631

27-
return (
28-
<div
29-
data-testid={dataTestId}
30-
class={{ [styles.transactionAccount]: true, [className]: Boolean(className) }}
31-
>
32-
{showLockedAccounts && account.isTokenLocked && <Icon name="lock" />}
33-
{account.isContract && <Icon name="contract" />}
32+
return (
33+
<div data-testid={dataTestId} class={{ [styles.transactionAccount]: true, [className]: Boolean(className) }}>
34+
{showLockedAccounts && account.isTokenLocked && <Icon name="lock" />}
35+
{account.isContract && <Icon name="contract" />}
3436

35-
{account.showLink ? (
36-
<ExplorerLink
37-
link={account.link}
38-
data-testid={explorerLinkDataTestId}
39-
class={styles.transactionAccountExplorerLink}
40-
>
41-
<span>{account.address}</span>
42-
</ExplorerLink>
43-
) : (
44-
<TransactionAccountName
45-
name={account.name}
46-
description={account.description}
47-
address={account.address}
48-
/>
49-
)}
50-
</div>
51-
);
37+
{account.showLink ? (
38+
<ExplorerLink
39+
link={account.link}
40+
data-testid={explorerLinkDataTestId}
41+
class={styles.transactionAccountExplorerLink}
42+
>
43+
<span>{account.address}</span>
44+
</ExplorerLink>
45+
) : (
46+
<TransactionAccountName name={account.name} description={account.description} address={account.address} />
47+
)}
48+
</div>
49+
);
5250
}
53-

src/components/controlled/transactions-table/components/TransactionAccount/components/TransactionAccountName/TransactionAccountName.tsx

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,31 @@ const styles = {
88
} satisfies Record<string, string>;
99

1010
interface TransactionAccountNamePropsType {
11-
address: string;
12-
class?: string;
13-
dataTestId?: string;
14-
description: string;
15-
name?: string;
11+
address: string;
12+
class?: string;
13+
dataTestId?: string;
14+
description: string;
15+
name?: string;
1616
}
1717

18-
export function TransactionAccountName({ address, dataTestId, description, name, class: className }: TransactionAccountNamePropsType) {
19-
if (name) {
20-
return (
21-
<div
22-
class={{ [className]: Boolean(className), [styles.transactionAccountName]: true }}
23-
data-testid={dataTestId}
24-
title={description}
25-
>
26-
{name}
27-
</div>
28-
);
29-
}
30-
18+
export function TransactionAccountName({
19+
address,
20+
dataTestId,
21+
description,
22+
name,
23+
class: className,
24+
}: TransactionAccountNamePropsType) {
25+
if (name) {
3126
return (
32-
<Trim
33-
text={address}
34-
class={classNames(className, styles.transactionAccountName)}
35-
dataTestId={dataTestId}
36-
/>
27+
<div
28+
class={{ [className]: Boolean(className), [styles.transactionAccountName]: true }}
29+
data-testid={dataTestId}
30+
title={description}
31+
>
32+
{name}
33+
</div>
3734
);
35+
}
3836

37+
return <Trim text={address} class={classNames(className, styles.transactionAccountName)} dataTestId={dataTestId} />;
3938
}

src/components/controlled/transactions-table/components/TransactionAccount/components/TransactionAccountName/tests/transaction-account-name.spec.tsx

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { h } from '@stencil/core';
22
import { newSpecPage } from '@stencil/core/testing';
33
import { DataTestIdsEnum } from 'constants/dataTestIds.enum';
4+
45
import { TransactionAccountName } from '../TransactionAccountName';
56

67
describe('TransactionAccountName tests', () => {
@@ -27,12 +28,7 @@ describe('TransactionAccountName tests', () => {
2728
it('uses trim component when name is missing', async () => {
2829
const page = await newSpecPage({
2930
components: [],
30-
template: () => (
31-
<TransactionAccountName
32-
address="erd1q..."
33-
description=""
34-
/>
35-
)
31+
template: () => <TransactionAccountName address="erd1q..." description="" />,
3632
});
3733

3834
expect(page.root).toEqualHtml(`
@@ -64,13 +60,7 @@ describe('TransactionAccountName tests', () => {
6460
it('handles empty name string', async () => {
6561
const page = await newSpecPage({
6662
components: [],
67-
template: () => (
68-
<TransactionAccountName
69-
address="erd1q..."
70-
name=""
71-
description=""
72-
/>
73-
)
63+
template: () => <TransactionAccountName address="erd1q..." name="" description="" />,
7464
});
7565

7666
expect(page.root).toEqualHtml(`
@@ -102,14 +92,7 @@ describe('TransactionAccountName tests', () => {
10292
it('applies correct class names', async () => {
10393
const page = await newSpecPage({
10494
components: [],
105-
template: () => (
106-
<TransactionAccountName
107-
address="erd1q..."
108-
name="Bob"
109-
class="custom-class"
110-
description=""
111-
/>
112-
)
95+
template: () => <TransactionAccountName address="erd1q..." name="Bob" class="custom-class" description="" />,
11396
});
11497

11598
expect(page.root).toEqualHtml(`
@@ -122,13 +105,7 @@ describe('TransactionAccountName tests', () => {
122105
it('handles missing dataTestId', async () => {
123106
const page = await newSpecPage({
124107
components: [],
125-
template: () => (
126-
<TransactionAccountName
127-
address="erd1q..."
128-
name="Charlie"
129-
description=""
130-
/>
131-
)
108+
template: () => <TransactionAccountName address="erd1q..." name="Charlie" description="" />,
132109
});
133110

134111
expect(page.root).toEqualHtml(`
@@ -141,19 +118,13 @@ describe('TransactionAccountName tests', () => {
141118
it('uses description as title when name exists', async () => {
142119
const page = await newSpecPage({
143120
components: [TransactionAccountName],
144-
template: () => (
145-
<TransactionAccountName
146-
address="erd1q..."
147-
name="Dave"
148-
description="Dave's Savings"
149-
/>
150-
)
121+
template: () => <TransactionAccountName address="erd1q..." name="Dave" description="Dave's Savings" />,
151122
});
152123

153124
expect(page.root).toEqualHtml(`
154125
<div class="transaction-account-name mvx:w-max mvx:truncate" title="Dave's Savings">
155126
Dave
156127
</div>
157128
`);
158-
})
129+
});
159130
});

src/components/controlled/transactions-table/components/TransactionAge/tests/transaction-age.spec.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { h } from '@stencil/core';
22
import { newSpecPage } from '@stencil/core/testing';
33
import { DataTestIdsEnum } from 'constants/dataTestIds.enum';
4+
45
import { TransactionAge } from '../TransactionAge';
56

67

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { h } from '@stencil/core';
2+
import { ExplorerLink } from 'common/ExplorerLink/ExplorerLink';
3+
import { Trim } from 'common/Trim/Trim';
24
import { DataTestIdsEnum } from 'constants/dataTestIds.enum';
35

46
import type { TransactionRowType } from '../../transactions-table.type';
57
import { TransactionIcon } from '../TransactionIcon';
6-
import { Trim } from 'common/Trim/Trim';
7-
import { ExplorerLink } from 'common/ExplorerLink/ExplorerLink';
88

99
// prettier-ignore
1010
const styles = {
@@ -14,32 +14,31 @@ const styles = {
1414
} satisfies Record<string, string>;
1515

1616
interface TransactionHashPropsType {
17-
class?: string;
18-
transaction: TransactionRowType;
17+
class?: string;
18+
transaction: TransactionRowType;
1919
}
2020

2121
export function TransactionHash({ transaction, class: className }: TransactionHashPropsType) {
22-
if (!transaction) {
23-
return null;
24-
}
25-
26-
return (
27-
<div
28-
class={{
29-
[styles.transactionHash]: true,
30-
[className]: Boolean(className),
31-
}}
32-
>
33-
<TransactionIcon iconInfo={transaction.iconInfo} class={styles.transactionHashIcon} />
22+
if (!transaction) {
23+
return null;
24+
}
3425

35-
<ExplorerLink
36-
dataTestId={DataTestIdsEnum.transactionLink}
37-
link={transaction.link}
38-
class={styles.transactionHashExplorerLink}
39-
>
40-
<Trim text={transaction.txHash} />
41-
</ExplorerLink>
42-
</div>
43-
);
26+
return (
27+
<div
28+
class={{
29+
[styles.transactionHash]: true,
30+
[className]: Boolean(className),
31+
}}
32+
>
33+
<TransactionIcon iconInfo={transaction.iconInfo} class={styles.transactionHashIcon} />
4434

35+
<ExplorerLink
36+
dataTestId={DataTestIdsEnum.transactionLink}
37+
link={transaction.link}
38+
class={styles.transactionHashExplorerLink}
39+
>
40+
<Trim text={transaction.txHash} />
41+
</ExplorerLink>
42+
</div>
43+
);
4544
}

0 commit comments

Comments
 (0)