Conversation
src/common/api/hive-engine.ts
Outdated
There was a problem hiding this comment.
You may leave just url instead of url: url
There was a problem hiding this comment.
oh, that's true,
Thanks🙏
There was a problem hiding this comment.
Do you use this function?
There was a problem hiding this comment.
Yeah, I haven't used it yet, I'll use it, I'm not done with issue yet, I want to be sure all actions/logic works then I will refactor where necessary
| const initiateOnElectron = (username: string) => { | ||
| if (!isMounted && global.isElectron) { | ||
| let getPoints = new Promise((res) => fetchPoints(username)); | ||
| console.log(getPoints) |
| const [showPurchaseDialog, setShowPurchaseDialog] = useState(false); | ||
|
|
||
| const { global, activeUser, account, points, history, fetchPoints, updateActiveUser } = props; | ||
| console.log(points) |
There was a problem hiding this comment.
Thanks @dkildar, all console.log( ) would be removed, I'm still working on this issue, would clean all and refactor once I'm done
…into feat/redesign-wallet-page
| const url = `https://api.coingecko.com/api/v3/coins/${token}/market_chart?vs_currency=usd&days=30`; | ||
| const data = await axios.get(url) | ||
| .then((r: any) => r.data) | ||
| return data; |
There was a problem hiding this comment.
Please, do not use async/await and then constructions together.
It should be:
const { data } = await axis.get(url);
return data;
…into feat/redesign-wallet-page
| const [transactions, setTransactions] = useState([]) | ||
| const [otherTransactions, setOtherTransactions] = useState([]) | ||
| const [loading, setLoading] = useState(false); | ||
| const [loadLimit, setLoadLimit] = useState(10) |
| } from "../../api/hive-engine"; | ||
| import LinearProgress from '../linear-progress'; | ||
|
|
||
| export const EngineTransactionList = (props: any) => { |
There was a problem hiding this comment.
It's not an any. Please, specify types
| return ( | ||
| <div className="transaction-list"> | ||
| <div className="transaction-list-header"> | ||
| <h2>{_t("transactions.title")} </h2> |
There was a problem hiding this comment.
Extra space at the end of tag content
| </div> | ||
| {loading && <LinearProgress />} | ||
| {otherTransactions?.slice(0, loadLimit).map((t: any) => { | ||
| return ( |
There was a problem hiding this comment.
Tip: You can replace
foo() => {
return bar;
}
with
foo() => (bar)
No need to use extra return
| <div className="transaction-list-item" key={t?.id}> | ||
| <div className="transaction-icon"> | ||
| {t?.operation === "tokens_transfer" || t?.operation === "tokens_stake" || t?.operation === "tokens_delegate" ? | ||
| TwoUserAvatar({ global: global, from: t?.from, to: t?.to, size: "small" }) : |
There was a problem hiding this comment.
Its a component, use as element please
| <span> | ||
| <strong>{`Txn Id: ${t.transactionId}`}</strong> | ||
| <p className='mt-2'> | ||
| <strong>{`Block Id: ${t.blockNumber}`}</strong> |
There was a problem hiding this comment.
These texts should be translated
| import { marketChart } from '../../api/misc' | ||
| import moment from "moment"; | ||
|
|
||
| export const HiveWalletPortfolioChart = (props: any) => { |
|
|
||
| const { global, account, params } = props | ||
|
|
||
| const [transactions, setTransactions] = useState([]) |
| const { global, account, params } = props | ||
|
|
||
| const [transactions, setTransactions] = useState([]) | ||
| const [otherTransactions, setOtherTransactions] = useState([]) |
| estimatedPointsValueLoading: boolean; | ||
| } | ||
|
|
||
| export class WalletPortfolio extends BaseComponent<Props, State> { |
There was a problem hiding this comment.
Use functional component instead of class based please
…into feat/redesign-wallet-page
…into feat/redesign-wallet-page
What does this PR?
New wallet view
Shows overall(estimated) wallet value
User can hide or show charts
Users can add or remove hive engine tokens
User can navigate to each token separately (https://ecency.com/@username/wallet/token) to see more transaction info or token info
How to use this feature
Navigate to user profile,
click on wallets then you will see your assets (hive, hive-power, hbd, engine tokens and spk tokens) listed, you can click on each one for more info.
To add more tokens click on add token button, select the token you want to add and confirm. You can also add more than one token. To remove a token from list, you will follow the same procedure and uncheck token.
Screenshot

See video on loom