Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show calculated reward rate #324

Merged
merged 2 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/components/UserAccount/AccountDetail/AccountDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import QRCode from 'react-qr-code';
import CopyText from 'components/common/NE_CopyText';
import TYPES from 'types';
import { useRouter } from 'next/router';
import { CARD_TYPES } from 'types/ConstantsTypes';

export const AccountDetail = ({ data }) => {
export const AccountDetail = ({ type, data }) => {
const router = useRouter();
return (
<>
Expand All @@ -27,6 +28,13 @@ export const AccountDetail = ({ data }) => {
<div>Stake Rate: {data.rate}</div>
<div>Token Name: {data.token}</div>
<div>Ticker: {data.ticker}</div>
{type == CARD_TYPES.TRUST && (
<div>
Average Reward Rate:{' '}
{((data.stake * data.rate) / 100 / 365).toFixed(2)} {data.ticker}
/Day
</div>
)}
</section>
<section className={styles.qrConatiner}>
<div className={styles.qrCode}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/UserAccount/UserAccount.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function UserAccount({ type, data }) {

{/* Account detials */}
<h3>{toTitleCase(type)} Details</h3>
<AccountDetail data={data} />
<AccountDetail type={type} data={data} />

{/* Transection detail table */}
<h3>Transaction Details</h3>
Expand Down