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

test redisign conflicts #1155

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
4764770
feat(sense): cozo op transaction to teleport send
dasein108 Mar 11, 2024
a86ed87
feat(sense): cozo op transaction teleport as cid
dasein108 Mar 11, 2024
e35c252
refactor(sense): move logic out of componet
dasein108 Mar 11, 2024
f7d252b
improve button
happylolonly Mar 13, 2024
a01577c
lock sense filters
happylolonly Mar 13, 2024
f305d7a
send and follow buttons
happylolonly Mar 13, 2024
63e1346
fix logic
happylolonly Mar 13, 2024
13abc0f
fix sorting
happylolonly Mar 13, 2024
b9b95e7
add initial load data
happylolonly Mar 13, 2024
428f2bf
refactor(sense): split user actions from components
dasein108 Mar 13, 2024
8822b79
feat(sense): neuronApi to handle cozo op links
dasein108 Mar 14, 2024
df55586
feat(sense 🧬): improvements/fixes (#1121)
dasein108 Mar 15, 2024
b464335
add following ui
happylolonly Mar 15, 2024
8011232
add message sender
happylolonly Mar 15, 2024
e099fe8
Merge branch 'master' into feat/sense-teleport
dasein108 Mar 15, 2024
a78edc2
fix(robot): actionBar (#1126)
dimakorzhovnik Mar 16, 2024
70555c1
fix(sync): notification fixes, op cozo links
dasein108 Mar 16, 2024
5d757b8
Revert "fix(robot): actionBar " (#1128)
happylolonly Mar 16, 2024
2683f05
fix(robot): fix action bar (#1127)
happylolonly Mar 16, 2024
8611217
Merge branch 'master' into feat/sense-teleport
dasein108 Mar 16, 2024
c15ef49
fix(sense): last item when update
dasein108 Mar 16, 2024
e30c8e5
fix(community): remove dublicates for other users
dasein108 Mar 16, 2024
182d86d
fix logic
happylolonly Mar 16, 2024
e391340
refactor(general): refact neuronApi layer
dasein108 Mar 16, 2024
29751ae
Merge branch 'feat/sense-teleport' of github.com:cybercongress/cyb in…
dasein108 Mar 16, 2024
6d006c5
fix(sense): date sorting of local cozo op msg bug
dasein108 Mar 18, 2024
4cc9a76
feat(sense 🧬): improvements (#1123)
dasein108 Mar 18, 2024
9f976cc
Revert "feat(sense 🧬): improvements" (#1132)
dasein108 Mar 18, 2024
5a040ae
feat(sense): cozo op transaction to teleport send (#1119)
dasein108 Mar 18, 2024
ceba439
build(deps): bump ip from 2.0.0 to 2.0.1 (#1100)
dependabot[bot] Mar 19, 2024
ed1f2c8
build(deps): bump es5-ext from 0.10.62 to 0.10.64 (#1107)
dependabot[bot] Mar 19, 2024
7f62af1
build(deps): bump follow-redirects from 1.15.4 to 1.15.6 (#1131)
dependabot[bot] Mar 19, 2024
575a72a
feat(sense 🧬): improvements (#1134)
happylolonly Mar 20, 2024
bf59d62
fix(storybook): fix crash while build (#1137)
happylolonly Mar 20, 2024
92fe171
fix(sense): scroll messages in viewer bugfix (#1141)
dasein108 Mar 26, 2024
44fd917
fix(backend): multitab service statuses (#1143)
dasein108 Mar 26, 2024
d8f8160
feat(community): add proposals comments (#1136)
OggyKUN Apr 10, 2024
abe3e3a
fix(senate): fix imports (#1150)
OggyKUN Apr 10, 2024
69d64bb
build(deps): bump webpack-dev-middleware from 5.3.3 to 5.3.4 (#1138)
dependabot[bot] Apr 14, 2024
d0ea8e9
build(deps): bump web3-utils from 1.9.0 to 4.2.1 (#1142)
dependabot[bot] Apr 14, 2024
d70a976
fix(senate): fix unable to add comments (#1151)
OggyKUN Apr 15, 2024
c1950f6
build(deps): bump express from 4.18.2 to 4.19.2 (#1144)
dependabot[bot] Apr 15, 2024
60febe1
build(deps): bump undici from 5.28.3 to 5.28.4 (#1147)
dependabot[bot] Apr 15, 2024
dfd1583
build(deps): bump axios from 0.21.4 to 1.6.8 (#1152)
dependabot[bot] Apr 19, 2024
e78e65f
fix(app): sync acc in tabs (#1122)
dimakorzhovnik Apr 19, 2024
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
"ts-jest-resolver": "^2.0.1",
"videostream": "^3.2.2",
"web3": "1.2.4",
"web3-utils": "^1.2.4",
"web3-utils": "^4.2.1",
"worker-url": "^1.1.0"
},
"prec-commit": [
Expand Down
5 changes: 3 additions & 2 deletions src/components/account/account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,16 @@ function Account({
}}
>
{avatar && (
<div
<Link
to={linkAddress}
className={cx(styles.avatar, avatarClassName)}
style={{
width: sizeAvatar,
height: sizeAvatar,
}}
>
<AvataImgIpfs addressCyber={address} cidAvatar={cidAvatar} />
</div>
</Link>
)}
{!onlyAvatar && (
<Link
Expand Down
1 change: 1 addition & 0 deletions src/constants/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export const PATTERN_CYBER = new RegExp(
`^${BECH32_PREFIX_ACC_ADDR_CYBER}[a-zA-Z0-9]{39}$`,
'g'
);
export const PATTERN_IPFS_HASH = /^Qm[a-zA-Z0-9]{44}$/g;
59 changes: 22 additions & 37 deletions src/containers/Search/ActionBarContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable */
import React, { Component } from 'react';
import { Link as LinkRoute } from 'react-router-dom';
import { Pane, ActionBar } from '@cybercongress/gravity';
import { connect } from 'react-redux';
import {
Expand All @@ -15,16 +14,14 @@ import {

import { getTxs } from '../../utils/search/utils';

import {
LEDGER,
CYBER,
PATTERN_IPFS_HASH,
DEFAULT_GAS_LIMITS,
} from '../../utils/config';
import { LEDGER } from '../../utils/config';
import { PATTERN_IPFS_HASH } from 'src/constants/app';
import { trimString } from '../../utils/utils';
import withIpfsAndKeplr from 'src/hocs/withIpfsAndKeplr';
import { DefaultAccount } from 'src/types/defaultAccount';
import { BackgroundWorker } from 'src/services/backend/workers/background/worker';
import { SenseApi } from 'src/contexts/backend/services/senseApi';
import { sendCyberlink } from 'src/services/neuron/neuronApi';

const imgKeplr = require('../../image/keplr-icon.svg');
const imgLedger = require('../../image/ledger.svg');
Expand Down Expand Up @@ -52,6 +49,7 @@ interface Props {
update: () => void;
signer: any;
ipfsApi: BackgroundWorker['ipfsApi'];
senseApi: SenseApi;
signingClient: any;
keywordHash: string;
}
Expand Down Expand Up @@ -164,7 +162,7 @@ class ActionBarContainer extends Component<Props, any> {

generateTx = async () => {
try {
const { signer, signingClient } = this.props;
const { signer, signingClient, senseApi } = this.props;
const { fromCid, toCid, addressLocalStor } = this.state;

this.setState({
Expand All @@ -175,36 +173,23 @@ class ActionBarContainer extends Component<Props, any> {

console.log('address', address);
if (addressLocalStor !== null && addressLocalStor.address === address) {
const fee = {
amount: [],
gas: DEFAULT_GAS_LIMITS.toString(),
};
const result = await signingClient.cyberlink(
address,
fromCid,
toCid,
fee
);
if (result.code === 0) {
const hash = result.transactionHash;
console.log('hash :>> ', hash);
this.setState({ stage: STAGE_SUBMITTED, txHash: hash });
this.timeOut = setTimeout(this.confirmTx, 1500);
} else if (result.code === 4) {
this.setState({
txHash: null,
stage: STAGE_ERROR,
errorMessage:
'Cyberlinking and investmint are not working. Wait for updates.',
});
} else {
this.setState({
txHash: null,
stage: STAGE_ERROR,
errorMessage: result.rawLog.toString(),
const txHash = await sendCyberlink(address, fromCid, toCid, {
signingClient,
senseApi,
})
.then((txHash) => {
console.log('hash :>> ', txHash);
this.setState({ stage: STAGE_SUBMITTED, txHash });
this.timeOut = setTimeout(this.confirmTx, 1500);
})
.catch((e) => {
this.setState({
txHash: null,
stage: STAGE_ERROR,
errorMessage: e.message,
});
console.log('result: ', e.message, e);
});
}
console.log('result: ', result);
} else {
this.setState({
stage: STAGE_ERROR,
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Search/SearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getIpfsHash } from 'src/utils/ipfs/helpers';
import { encodeSlash } from '../../utils/utils';
import { NoItems } from '../../components';
import ActionBarContainer from './ActionBarContainer';
import { PATTERN_IPFS_HASH } from '../../utils/config';
import { PATTERN_IPFS_HASH } from 'src/constants/app';
import { MainContainer } from '../portal/components';
import FirstItems from './_FirstItems.refactor';
import useSearchData from './hooks/useSearchData';
Expand Down
2 changes: 1 addition & 1 deletion src/containers/application/Header/Commander/Commander.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useNavigate, useParams } from 'react-router-dom';
import { Color } from 'src/components/LinearGradientContainer/LinearGradientContainer';
import { routes } from 'src/routes';
import { getIpfsHash } from 'src/utils/ipfs/helpers';
import { PATTERN_IPFS_HASH } from 'src/utils/config';
import { PATTERN_IPFS_HASH } from 'src/constants/app';
import { useAppDispatch, useAppSelector } from 'src/redux/hooks';
import { setFocus, setValue } from './commander.redux';
import styles from './Commander.module.scss';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import useOnClickOutside from 'src/hooks/useOnClickOutside';
import { routes } from 'src/routes';
import usePassportByAddress from 'src/features/passport/hooks/usePassportByAddress';

import { useAppDispatch, useAppSelector } from 'src/redux/hooks';
import { useAppSelector } from 'src/redux/hooks';
import Pill from 'src/components/Pill/Pill';
import { useSigningClient } from 'src/contexts/signerClient';
import BroadcastChannelSender from 'src/services/backend/channels/BroadcastChannelSender';
import { useBackend } from 'src/contexts/backend/backend';
import { AvataImgIpfs } from '../../../portal/components/avataIpfs';
import styles from './SwitchAccount.module.scss';
import networkStyles from '../SwitchNetwork/SwitchNetwork.module.scss';
import useMediaQuery from '../../../../hooks/useMediaQuery';
import robot from '../../../../image/temple/robot.png';
import Karma from '../../Karma/Karma';
import { setDefaultAccount } from '../../../../redux/features/pocket';
import { useBackend } from 'src/contexts/backend/backend';

// should be refactored
function AccountItem({
Expand Down Expand Up @@ -96,7 +96,6 @@ function SwitchAccount() {
const [controlledVisible, setControlledVisible] = React.useState(false);

const { defaultAccount, accounts } = useAppSelector((state) => state.pocket);
const dispatch = useAppDispatch();

const useGetAddress = defaultAccount?.account?.cyber?.bech32 || null;

Expand All @@ -121,11 +120,8 @@ function SwitchAccount() {
const isReadOnly = defaultAccount.account?.cyber.keys === 'read-only';

const onClickChangeActiveAcc = async (key: string) => {
dispatch(
setDefaultAccount({
name: key,
})
);
const broadcastChannel = new BroadcastChannelSender();
broadcastChannel.postSetDefaultAccount(key);
setControlledVisible(false);
};

Expand Down
49 changes: 25 additions & 24 deletions src/containers/governance/proposalsDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import ActionBarDetail from './actionBarDatail';

import { formatNumber } from '../../utils/utils';

import ProposalsIdDetail from './proposalsIdDetail';
import ProposalsDetailProgressBar from './proposalsDetailProgressBar';
import ProposalsIdDetailTableVoters from './proposalsDetailTableVoters';
import { PROPOSAL_STATUS } from '../../utils/config';
import useSetActiveAddress from '../../hooks/useSetActiveAddress';
import { MainContainer } from '../portal/components';
import ProposalsRoutes from './proposalsRoutes';
import { useLocation, useNavigate } from 'react-router-dom';

const finalTallyResult = (item) => {
const finalVotes = {
Expand Down Expand Up @@ -181,8 +181,14 @@ function ProposalsDetail({ defaultAccount }) {
return string;
};

console.log(`proposals`, proposals);
console.log(`addressActive`, addressActive);
const location = useLocation();
const navigate = useNavigate();

useEffect(() => {
if (location.pathname === `/senate/${proposalId}`) {
navigate(`/senate/${proposalId}/comments`);
}
}, [location.pathname]);

return (
<>
Expand All @@ -192,7 +198,6 @@ function ProposalsDetail({ defaultAccount }) {
{proposals.title && ` #${proposalId} ${proposals.title}`}
</Text>
</Pane>

{proposals.status && (
<Pane>
<IconStatus status={proposals.status} text marginRight={8} />
Expand Down Expand Up @@ -275,31 +280,27 @@ function ProposalsDetail({ defaultAccount }) {
/>
)}
</ContainerGradientText>

<ProposalsIdDetail
<ProposalsDetailProgressBar
proposals={proposals}
totalDeposit={totalDeposit}
minDeposit={minDeposit}
tallying={tallying}
tally={tally}
totalDeposit={totalDeposit}
marginBottom={20}
/>

<ProposalsDetailProgressBar
<ProposalsRoutes
proposalId={proposalId}
proposals={proposals}
totalDeposit={totalDeposit}
minDeposit={minDeposit}
tallying={tallying}
tally={tally}
totalDeposit={totalDeposit}
updateFunc={updateFunc}
proposalStatus={PROPOSAL_STATUS}
/>

{proposals.status > PROPOSAL_STATUS.PROPOSAL_STATUS_DEPOSIT_PERIOD && (
<ProposalsIdDetailTableVoters
proposalId={proposalId}
updateFunc={updateFunc}
/>
)}
</MainContainer>
{addressActive !== null && addressActive.keys === 'keplr' ? (
{addressActive !== null &&
addressActive.keys === 'keplr' &&
location.pathname === `/senate/${proposalId}/voters` ? (
<ActionBarDetail
id={proposalId}
proposals={proposals}
Expand All @@ -308,7 +309,7 @@ function ProposalsDetail({ defaultAccount }) {
update={() => setUpdateFunc((item) => item + 1)}
addressActive={addressActive}
/>
) : (
) : addressActive === null ? (
<ActionBar>
<Pane>
<Link
Expand All @@ -318,13 +319,13 @@ function ProposalsDetail({ defaultAccount }) {
display: 'block',
}}
className="btn"
to="/"
to="/keys"
>
add address to your pocket from keplr
connect
</Link>
</Pane>
</ActionBar>
)}
) : null}
</>
);
}
Expand Down
Loading
Loading