-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/5.5.0' into ruslan/feature-announcement-modal
- Loading branch information
Showing
6 changed files
with
146 additions
and
62 deletions.
There are no files selected for viewing
11 changes: 5 additions & 6 deletions
11
packages/yoroi-extension/app/UI/features/portfolio/common/components/HeaderPrice.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
import { Skeleton, Typography } from '@mui/material'; | ||
import { observer } from 'mobx-react'; | ||
import React from 'react'; | ||
import { usePortfolio } from '../../module/PortfolioContextProvider'; | ||
import { HiddenAmount } from './HiddenAmount'; | ||
|
||
export const HeaderPrice = ({ isLoading = false }) => { | ||
const { accountPair, isHiddenAmount } = usePortfolio(); | ||
export const HeaderPrice = observer(({ isLoading = false, isHiddenAmount }) => { | ||
const { accountPair } = usePortfolio(); | ||
|
||
if (isLoading) { | ||
return <Skeleton width="129px" height="16px" />; | ||
} | ||
|
||
return ( | ||
<Typography color="ds.text_gray_low" mr="12px"> | ||
<HiddenAmount isHidden={isHiddenAmount}> | ||
{accountPair?.to.value} | ||
</HiddenAmount> | ||
<HiddenAmount isHidden={isHiddenAmount}>{accountPair?.to.value}</HiddenAmount> | ||
<span> {accountPair?.to.name}</span> | ||
</Typography> | ||
); | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import { createPrimaryTokenInfo } from '@yoroi/portfolio'; | ||
import { Chain, Network } from '@yoroi/types'; | ||
import { freeze } from 'immer'; | ||
|
||
export const primaryTokenInfoMainnet = createPrimaryTokenInfo({ | ||
decimals: 6, | ||
name: 'ADA', | ||
ticker: 'ADA', | ||
symbol: '₳', | ||
reference: '', | ||
tag: '', | ||
website: 'https://www.cardano.org/', | ||
originalImage: '', | ||
description: 'Cardano', | ||
}); | ||
|
||
const primaryTokenInfoAnyTestnet = createPrimaryTokenInfo({ | ||
decimals: 6, | ||
name: 'TADA', | ||
ticker: 'TADA', | ||
symbol: '₳', | ||
reference: '', | ||
tag: '', | ||
website: 'https://www.cardano.org/', | ||
originalImage: '', | ||
description: 'Cardano', | ||
}); | ||
|
||
export const shelleyEraConfig: Readonly<Network.EraConfig> = freeze( | ||
{ | ||
name: 'shelley', | ||
start: new Date('2020-07-29T21:44:51.000Z'), | ||
end: undefined, | ||
slotInSeconds: 1, | ||
slotsPerEpoch: 432000, | ||
}, | ||
true | ||
); | ||
|
||
export const byronEraConfig: Readonly<Network.EraConfig> = freeze( | ||
{ | ||
name: 'byron', | ||
start: new Date('2017-09-23T21:44:51.000Z'), | ||
end: new Date('2020-07-29T21:44:51.000Z'), | ||
slotInSeconds: 20, | ||
slotsPerEpoch: 21600, | ||
}, | ||
true | ||
); | ||
|
||
export const shelleyPreprodEraConfig: Readonly<Network.EraConfig> = freeze( | ||
{ | ||
name: 'shelley', | ||
start: new Date('2022-06-01T01:00:00.000Z'), | ||
end: undefined, | ||
slotInSeconds: 1, | ||
slotsPerEpoch: 432000, | ||
}, | ||
true | ||
); | ||
|
||
export const networkConfigs = { | ||
0: { | ||
network: Chain.Network.Mainnet, | ||
primaryTokenInfo: primaryTokenInfoMainnet, | ||
chainId: 1, | ||
protocolMagic: 764_824_073, | ||
eras: [byronEraConfig, shelleyEraConfig], | ||
name: 'Mainnet', | ||
isMainnet: true, | ||
|
||
legacyApiBaseUrl: 'https://api.yoroiwallet.com/api', | ||
}, | ||
250: { | ||
network: Chain.Network.Preprod, | ||
primaryTokenInfo: primaryTokenInfoAnyTestnet, | ||
chainId: 0, | ||
protocolMagic: 1, | ||
eras: [shelleyPreprodEraConfig], | ||
name: 'Preprod', | ||
isMainnet: false, | ||
|
||
legacyApiBaseUrl: 'https://preprod-backend.yoroiwallet.com/api', | ||
}, | ||
350: { | ||
network: Chain.Network.Preview, | ||
primaryTokenInfo: primaryTokenInfoAnyTestnet, | ||
chainId: 0, | ||
protocolMagic: 2, | ||
eras: [shelleyEraConfig], | ||
name: 'Preview', | ||
isMainnet: false, | ||
legacyApiBaseUrl: 'https://preview-backend.emurgornd.com/api', | ||
}, | ||
}; |