Skip to content

Commit

Permalink
Merge pull request #1103 from spacemeshos/tweak-remove-est-rewards
Browse files Browse the repository at this point in the history
Get rid of incorrect estimated rewards on PoS size selection screen
  • Loading branch information
brusherru authored Jan 27, 2023
2 parents 7aee9f1 + 58ca634 commit 3bbaa39
Showing 1 changed file with 1 addition and 55 deletions.
56 changes: 1 addition & 55 deletions app/components/node/PoSSize.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import styled from 'styled-components';
import { Tooltip, DropDown, Input } from '../../basicComponents';
import { posSpace, posRewardEst } from '../../assets/images';
import { posSpace } from '../../assets/images';
import { smColors } from '../../vars';
import {
DEFAULT_POS_MAX_FILE_SIZE,
Expand Down Expand Up @@ -35,12 +35,6 @@ const Icon1 = styled.img`
margin-right: 5px;
`;

const Icon2 = styled.img`
width: 15px;
height: 20px;
margin-right: 10px;
`;

const Icon3 = styled.img.attrs(({ theme: { icons: { posDirectory } } }) => ({
src: posDirectory,
}))`
Expand Down Expand Up @@ -69,21 +63,6 @@ const Dots = styled.div`
color: ${({ theme: { color } }) => color.primary};
`;

const RewardText = styled(Text)<{ selected: boolean }>`
color: ${({ selected }) => (selected ? smColors.orange : smColors.orange)};
`;

const ErrorText = styled.div`
height: 20px;
font-size: 15px;
line-height: 17px;
color: ${smColors.orange};
position: absolute;
left: 15px;
bottom: -15px;
width: 100%;
`;

const Link = styled.div`
text-transform: uppercase;
text-decoration: none;
Expand Down Expand Up @@ -135,22 +114,6 @@ const PoSSize = ({
const [selectedCommitmentIndex, setSelectedCommitmentIndex] = useState(
numUnits ? commitments.findIndex((com) => com.numUnits === numUnits) : 0
);
const [hasErrorFetchingEstimatedRewards] = useState(false);

// const [loadedEstimatedRewards, setLoadedEstimatedRewards] = useState({ amount: 0 });

// useEffect(() => { // TODO: uncomment when api endpoint implemented in node
// const loadEstimatedRewards = async () => {
// const { error, estimatedRewards } = await eventsService.getEstimatedRewards();
// if (error) {
// setHasErrorFetchingEstimatedRewards(true);
// } else {
// setLoadedEstimatedRewards(estimatedRewards);
// setHasErrorFetchingEstimatedRewards(false);
// }
// };
// loadEstimatedRewards();
// }, [setHasErrorFetchingEstimatedRewards, setLoadedEstimatedRewards]);

const selectCommitment = ({ index }: { index: number }) => {
setSelectedCommitmentIndex(index);
Expand Down Expand Up @@ -216,23 +179,6 @@ const PoSSize = ({
/>
</InputWrapper>
</Row>
<Row>
<Icon2 src={posRewardEst} />
<Text>Estimated coin reward</Text>
<Tooltip width={200} text="Some text" />
<Dots>.....................................................</Dots>
{hasErrorFetchingEstimatedRewards ? (
<ErrorText>
Failed to load estimated rewards. Please return to previous step
</ErrorText>
) : (
<RewardText selected={selectedCommitmentIndex !== -1}>
{selectedCommitmentIndex !== -1
? '10 SMESH / EPOCH'
: '0 SMESH / EPOCH'}
</RewardText>
)}
</Row>
<BottomRow>
<Icon3 />
<Text>PoS data folder</Text>
Expand Down

0 comments on commit 3bbaa39

Please sign in to comment.