Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
neuodev committed Jan 16, 2022
1 parent a6850e5 commit 7b9c56c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 30 deletions.
Expand Up @@ -17,7 +17,7 @@ import type { ConceptualWalletSettingsCache } from '../../../stores/toplevel/Wal
type Props = {|
+whitelistEntries: ?Array<WhitelistEntry>,
+activeSites: Array<string>,
+wallets: ?Array<PublicDeriverCache>,
+wallets: ?Array<PublicDeriver<>>,
+onRemoveWallet: {| url: ?string, protocol: ?string |} => void,
+getTokenInfo: $ReadOnly<Inexact<TokenLookupKey>> => $ReadOnly<TokenRow>,
+shouldHideBalance: boolean,
Expand Down Expand Up @@ -71,14 +71,12 @@ export default class ConnectedWebsitesPage extends Component<Props> {
if (wallet == null) {
return [null, null]
}

const { balance, plate } = this.props.getWalletInfo(wallet)
return [isErgo(wallet.getParent().getNetworkInfo()), (
<WalletRow
key={url}
url={url}
protocol={protocol}
wallet={wallet}
websiteIcon={image}
isActiveSite={this.props.activeSites.includes(url)}
onRemoveWallet={this.props.onRemoveWallet}
Expand Down
Expand Up @@ -29,7 +29,6 @@ type Props = {|
+url: ?string,
+protocol: ?string,
+isActiveSite: boolean,
+wallet: PublicDeriverCache,
+shouldHideBalance: boolean,
+onRemoveWallet: {| url: ?string, protocol: ?string |} => void,
+getTokenInfo: $ReadOnly<Inexact<TokenLookupKey>> => $ReadOnly<TokenRow>,
Expand All @@ -41,22 +40,6 @@ type State = {|
showDeleteIcon: boolean,
|}

function constructPlate(
plate: WalletChecksum,
saturationFactor: number,
divClass: string
): [string, React$Element<'div'>] {
return [
plate.TextPart,
<div className={divClass}>
<WalletAccountIcon
iconSeed={plate.ImagePart}
saturationFactor={saturationFactor}
scalePx={6}
/>
</div>,
];
}

export default class WalletRow extends Component<Props, State> {
static contextTypes: {| intl: $npm$ReactIntl$IntlFormat |} = {
Expand All @@ -80,7 +63,6 @@ export default class WalletRow extends Component<Props, State> {
isActiveSite,
url,
protocol,
wallet,
plate,
onRemoveWallet,
balance,
Expand All @@ -91,11 +73,6 @@ export default class WalletRow extends Component<Props, State> {
} = this.props;
const { showDeleteIcon } = this.state
const { intl } = this.context;
// eslint-disable-next-line no-unused-vars
// const [_, iconComponent] = wallet.checksum
// ? constructPlate(wallet.checksum, 0, styles.icon)
// : [];

const defaultEntry = balance.getDefaultEntry();
const tokenInfo = getTokenInfo(defaultEntry);
const shiftedAmount = defaultEntry.amount
Expand Down
Expand Up @@ -29,6 +29,11 @@ import { PublicDeriver } from '../../api/ada/lib/storage/models/PublicDeriver'
import { asGetPublicKey } from '../../api/ada/lib/storage/models/PublicDeriver/traits';
import environment from '../../environment'
import { ROUTES } from '../../routes-config'
import type { TxRequests } from '../../stores/toplevel/TransactionsStore';
import type { PublicKeyCache } from '../../stores/toplevel/WalletStore';
import type { IGetPublic } from '../../api/ada/lib/storage/models/PublicDeriver/interfaces';



export type GeneratedData = typeof ConnectedWebsitesPageContainer.prototype.generated;

Expand Down Expand Up @@ -92,9 +97,7 @@ class ConnectedWebsitesPageContainer extends Component<AllProps> {
render (): Node {
const { stores } = this.generated;
const sidebarContainer = <SidebarContainer {...this.generated.SidebarContainerProps} />
const _wallets = this.generated.stores.wallets.publicDerivers;
console.log({_wallets})
const wallets = stores.connector.allWallets;
const wallets = this.generated.stores.wallets.publicDerivers;
const loadingWallets = stores.connector.loadingWallets;
const error = stores.connector.errorWallets;
const isLoading = (
Expand All @@ -120,7 +123,7 @@ class ConnectedWebsitesPageContainer extends Component<AllProps> {
componentToRender = (
<ConnectedWebsitesPage
whitelistEntries={this.generated.stores.connector.currentConnectorWhitelist}
wallets={_wallets}
wallets={wallets}
onRemoveWallet={this.onRemoveWallet}
activeSites={this.generated.stores.connector.activeSites.sites}
getTokenInfo={genLookupOrFail(this.generated.stores.tokenInfoStore.tokenInfo)}
Expand Down

0 comments on commit 7b9c56c

Please sign in to comment.