Skip to content

Commit

Permalink
feat(app): bostrom launch
Browse files Browse the repository at this point in the history
  • Loading branch information
dimakorzhovnik committed Nov 5, 2021
1 parent bb4eb6c commit 452f066
Show file tree
Hide file tree
Showing 16 changed files with 308 additions and 170 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --config=webpack.config.dev.js --https -d --disable-host-check",
"build": "webpack --config=webpack.config.prod.js -p && ncp build/index.html build/404.html && echo 'cyb.ai' > build/CNAME",
"build": "webpack --config=webpack.config.prod.js -p && ncp build/index.html build/404.html && echo 'rebyc.cyber.page' > build/CNAME",
"devserver": "parcel serve src/index.html -p 8001 --no-cache",
"lint": "eslint src/"
},
Expand Down
18 changes: 18 additions & 0 deletions src/components/valueImg/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const hydrogen = require('../../image/hydrogen.svg');
const tocyb = require('../../image/boot.png');
const boot = require('../../image/large-green.png');
const downOutline = require('../../image/chevronDownOutline.svg');
const gol = require('../../image/seedling.png');
const atom = require('../../image/cosmos-2.svg');
const eth = require('../../image/Ethereum_logo_2014.svg');

const ValueImg = ({
text,
Expand Down Expand Up @@ -54,6 +57,21 @@ const ValueImg = ({
textCurency = 'choose';
break;

case 'GOL':
img = gol;
textCurency = 'GOL';
break;

case 'atom':
img = atom;
textCurency = 'ATOM';
break;

case 'eth':
img = eth;
textCurency = 'ETH';
break;

default:
if (text.includes('pool')) {
textCurency = trimString(text, 4, 3);
Expand Down
8 changes: 5 additions & 3 deletions src/containers/Wallet/card/PubkeyCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@ const CosmosAddressInfo = ({
value={
((totalCosmos.total / COSMOS.DIVISOR_ATOM) * 1000) / 1000
}
text="ATOM"
text="atom"
/>
</RowBalance>
{open && (
<DetailsBalance
total={totalCosmos}
paddingLeft={15}
divisor={COSMOS.DIVISOR_ATOM}
currency="ATOM"
currency="atom"
/>
)}
</>
Expand Down Expand Up @@ -411,6 +411,7 @@ const EULnetworkInfo = ({
.map((key) => {
return (
<BalanceToken
key={key}
onClickOpen={props[`onClickOpen${key}`]}
open={props[`open${key}`]}
balanceToken={balanceToken[key]}
Expand All @@ -424,6 +425,7 @@ const EULnetworkInfo = ({
Object.keys(balanceToken.pools).map((key) => {
return (
<FormatNumberTokens
key={key}
value={balanceToken.pools[key]}
text={key}
/>
Expand Down Expand Up @@ -514,7 +516,7 @@ const EthAddressInfo = ({
<Pane flexDirection="column" display="flex" alignItems="flex-end">
<FormatNumberTokens
value={exponentialToDecimal(parseFloat(eth).toPrecision(6))}
text="ETH"
text="eth"
/>
<FormatNumberTokens value={parseFloat(gol)} text="GOL" />
</Pane>
Expand Down
1 change: 0 additions & 1 deletion src/containers/Wallet/card/tweet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ function TweetCard({

const mapStateToProps = (store) => {
return {
mobile: store.settings.mobile,
node: store.ipfs.ipfs,
};
};
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Wallet/components/pocketCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const editOutline = require('../../../image/create-outline.svg');
const editDone = require('../../../image/ionicons_svg_ios-checkmark-circle.svg');
const deleteIcon = require('../../../image/trash-outline.svg');
const imgEth = require('../../../image/Ethereum_logo_2014.svg');
const imgCyber = require('../../../image/blue-circle.png');
const imgCyber = require('../../../image/large-green.png');
const imgCosmos = require('../../../image/cosmos-2.svg');

const imgData = {
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Wallet/hooks/pubkeyCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const useGetBalanceEth = (address) => {
setBalanceEth((item) => ({ ...item, gol: responseGol }));
}
};
feachData();
setTimeout(feachData, 100);
}, [address]);

return balanceEth;
Expand Down
18 changes: 15 additions & 3 deletions src/containers/account/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import GetLink from './tabs/link';
import { getIpfsHash, getTweet, chekFollow } from '../../utils/search/utils';
// import Balance fro./mainnce';
import Heroes from './tabs/heroes';
import { fromBech32, formatNumber, asyncForEach } from '../../utils/utils';
import { coinDecimals, formatNumber, asyncForEach } from '../../utils/utils';
import { Loading, Copy, ContainerCard, Card, Dots } from '../../components';
import ActionBarContainer from './actionBar';
import GetTxs from './tabs/txs';
Expand All @@ -18,7 +18,7 @@ import AvatarIpfs from './component/avatarIpfs';
import CyberLinkCount from './component/cyberLinkCount';
import { AppContext } from '../../context';
import { useGetCommunity, useGetBalance, useGetHeroes } from './hooks';
import { CYBER } from '../../utils/config';
import { CYBER, PATTERN_CYBER } from '../../utils/config';

const TabBtn = ({ text, isSelected, onSelect, to }) => (
<Link to={to}>
Expand Down Expand Up @@ -57,6 +57,7 @@ function AccountDetails({ node, mobile, defaultAccount }) {
const [tweets, setTweets] = useState(false);
const [follow, setFollow] = useState(false);
const [activeAddress, setActiveAddress] = useState(null);
const [karmaNeuron, setKarmaNeuron] = useState(0);

useEffect(() => {
const { pathname } = location;
Expand Down Expand Up @@ -107,6 +108,17 @@ function AccountDetails({ node, mobile, defaultAccount }) {
getFeeds();
}, [address, updateAddress]);

useEffect(() => {
const getKarma = async () => {
if (jsCyber !== null && address.match(PATTERN_CYBER)) {
const responseKarma = await jsCyber.karma(address);
const karma = parseFloat(responseKarma.karma);
setKarmaNeuron(karma);
}
};
getKarma();
}, [jsCyber, address]);

useEffect(() => {
const chekFollowAddress = async () => {
const addressFromIpfs = await getIpfsHash(address);
Expand Down Expand Up @@ -237,7 +249,7 @@ function AccountDetails({ node, mobile, defaultAccount }) {
<ContainerCard col={3}>
<Card
title="cyberlinks"
value={<CyberLinkCount accountUser={address} />}
value={formatNumber(karmaNeuron)}
stylesContainer={{
width: '100%',
maxWidth: 'unset',
Expand Down
Loading

0 comments on commit 452f066

Please sign in to comment.