Skip to content

Commit

Permalink
chore: cleanups and fixed #41
Browse files Browse the repository at this point in the history
  • Loading branch information
ohager committed Oct 6, 2022
2 parents 97eadcc + f61b9c4 commit 7c3e4ad
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 489 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 1.3.0 (TBR)

- Added Token Support
- Removed automatic Hex detection for P2P messages (#50)

### Bugfixes
Expand Down
20 changes: 15 additions & 5 deletions src/app/templates/SignumActivity/TxItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { memo } from 'react';

import classNames from 'clsx';

import { useAppEnv } from 'app/env';
import { T, TProps } from 'lib/i18n/react';
import { TransactionItem, TransactionItemType } from 'lib/temple/activity';

Expand All @@ -13,9 +14,10 @@ type TxItemProps = {
};

const TxItem = memo<TxItemProps>(({ item, className }) => {
const { fullPage } = useAppEnv();
return (
<div className={classNames('flex flex-col', className)}>
<TxItemComponent item={item} />
<TxItemComponent item={item} isFullPage={fullPage} />
</div>
);
});
Expand All @@ -24,9 +26,10 @@ export default TxItem;

type TxItemComponentProps = {
item: TransactionItem;
isFullPage: boolean;
};

const TxItemComponent = memo<TxItemComponentProps>(({ item }) => {
const TxItemComponent = memo<TxItemComponentProps>(({ item, isFullPage }) => {
const toRender = (() => {
switch (item.type) {
case TransactionItemType.Origination:
Expand Down Expand Up @@ -128,7 +131,9 @@ const TxItemComponent = memo<TxItemComponentProps>(({ item }) => {
<div className="flex flex-wrap items-center">
<div className={classNames('flex items-center', 'text-xs text-blue-600 opacity-75')}>{toRender.base}</div>

{toRender.argsI18nKey && <TxItemArgs i18nKey={toRender.argsI18nKey} args={toRender.args} className="ml-1" />}
{toRender.argsI18nKey && (
<TxItemArgs i18nKey={toRender.argsI18nKey} args={toRender.args} className="ml-1" isFullPage={isFullPage} />
)}
</div>
);
});
Expand All @@ -137,15 +142,20 @@ type TxItemArgsProps = {
i18nKey: TProps['id'];
args: string[];
className?: string;
isFullPage: boolean;
};

const TxItemArgs = memo<TxItemArgsProps>(({ i18nKey, args, className }) => (
const TxItemArgs = memo<TxItemArgsProps>(({ i18nKey, args, className, isFullPage }) => (
<span className={classNames('font-light text-gray-700 text-xs', className)}>
<T
id={i18nKey}
substitutions={args.map((value, index) => (
<span key={index}>
<HashChip className="text-blue-600 opacity-75" key={index} hash={value} trimAfter={20} type="link" />
{isFullPage ? (
<HashChip className="text-blue-600 opacity-75" key={index} hash={value} type="link" />
) : (
<HashChip className="text-blue-600 opacity-75" key={index} hash={value} trimAfter={20} type="link" />
)}
{index === args.length - 1 ? null : ', '}
</span>
))}
Expand Down
89 changes: 0 additions & 89 deletions src/lib/better-call-dev/account.ts

This file was deleted.

17 changes: 0 additions & 17 deletions src/lib/better-call-dev/base.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/lib/better-call-dev/index.ts

This file was deleted.

66 changes: 0 additions & 66 deletions src/lib/better-call-dev/tokens.ts

This file was deleted.

30 changes: 0 additions & 30 deletions src/lib/temple/activity/fetch.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/lib/temple/activity/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './types';
export * from './helpers';
export * from './fetch';
export * from './parseTransaction';
export * from './parseAmountDiffs';
18 changes: 14 additions & 4 deletions src/lib/temple/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,24 @@ export const NETWORKS: Network[] = [
color: '#00A0A0',
disabled: false
},
{
id: 'signum-us-central',
networkName: NetworkName.Mainnet,
name: 'US Central',
description: 'Featured Node from the US',
type: 'main',
rpcBaseURL: 'https://us-central.signum.network',
color: '#009186',
disabled: false
},
{
id: 'signum-canada',
networkName: NetworkName.Mainnet,
name: 'Canada',
description: 'Featured Node from Canada',
type: 'main',
rpcBaseURL: 'https://canada.signum.network',
color: '#009186',
color: '#00B7AE',
disabled: false
},
{
Expand All @@ -74,7 +84,7 @@ export const NETWORKS: Network[] = [
description: 'Featured Node from Latin America',
type: 'main',
rpcBaseURL: 'https://latam.signum.network',
color: '#00B7AE',
color: '#0090A2',
disabled: false
},
{
Expand All @@ -84,7 +94,7 @@ export const NETWORKS: Network[] = [
description: 'Featured Node from South America',
type: 'main',
rpcBaseURL: 'https://brazil.signum.network',
color: '#0090A2',
color: '#0070A2',
disabled: false
},
{
Expand All @@ -94,7 +104,7 @@ export const NETWORKS: Network[] = [
description: 'Featured Node from Australia',
type: 'main',
rpcBaseURL: 'https://australia.signum.network',
color: '#001b69',
color: '#005669',
disabled: false
},
{
Expand Down
Loading

0 comments on commit 7c3e4ad

Please sign in to comment.