Browse Source

Add PostVoting contract to concordia-shared package

develop
Ezerous 4 years ago
parent
commit
4e8fc934b9
  1. 2
      packages/concordia-app/src/components/InitializationScreen/CustomLoader/index.jsx
  2. 6
      packages/concordia-app/src/redux/actions/contractEventActions.js
  3. 10
      packages/concordia-shared/src/constants/contracts/events/PostVotingContractEvents.js
  4. 6
      packages/concordia-shared/src/constants/contracts/events/index.js

2
packages/concordia-app/src/components/InitializationScreen/CustomLoader/index.jsx

@ -8,7 +8,7 @@ import metamaskLogo from '../../../assets/images/metamask_logo.svg';
import ethereumLogo from '../../../assets/images/ethereum_logo.svg'; import ethereumLogo from '../../../assets/images/ethereum_logo.svg';
import ipfsLogo from '../../../assets/images/ipfs_logo.svg'; import ipfsLogo from '../../../assets/images/ipfs_logo.svg';
import orbitdbLogo from '../../../assets/images/orbitdb_logo.svg'; import orbitdbLogo from '../../../assets/images/orbitdb_logo.svg';
import appLogo from '../../../assets/images/app_logo.svg'; import appLogo from '../../../assets/images/app_logo_circle.svg';
const LoadingComponent = (props) => { const LoadingComponent = (props) => {
useEffect(() => function cleanup() { useEffect(() => function cleanup() {

6
packages/concordia-app/src/redux/actions/contractEventActions.js

@ -4,17 +4,23 @@ import {
USER_SIGNED_UP_EVENT, USER_SIGNED_UP_EVENT,
USERNAME_UPDATED_EVENT, USERNAME_UPDATED_EVENT,
} from 'concordia-shared/src/constants/contracts/events/ForumContractEvents'; } from 'concordia-shared/src/constants/contracts/events/ForumContractEvents';
import {
USER_VOTED_POST_EVENT,
} from 'concordia-shared/src/constants/contracts/events/PostVotingContractEvents';
export const FORUM_EVENT_USER_SIGNED_UP = 'FORUM_EVENT_USER_SIGNED_UP'; export const FORUM_EVENT_USER_SIGNED_UP = 'FORUM_EVENT_USER_SIGNED_UP';
export const FORUM_EVENT_USERNAME_UPDATED = 'FORUM_EVENT_USERNAME_UPDATED'; export const FORUM_EVENT_USERNAME_UPDATED = 'FORUM_EVENT_USERNAME_UPDATED';
export const FORUM_EVENT_TOPIC_CREATED = 'FORUM_EVENT_TOPIC_CREATED'; export const FORUM_EVENT_TOPIC_CREATED = 'FORUM_EVENT_TOPIC_CREATED';
export const FORUM_EVENT_POST_CREATED = 'FORUM_EVENT_POST_CREATED'; export const FORUM_EVENT_POST_CREATED = 'FORUM_EVENT_POST_CREATED';
export const POST_VOTING_USER_VOTED_POST = 'POST_VOTING_USER_VOTED_POST';
const eventActionMap = { const eventActionMap = {
[USER_SIGNED_UP_EVENT]: FORUM_EVENT_USER_SIGNED_UP, [USER_SIGNED_UP_EVENT]: FORUM_EVENT_USER_SIGNED_UP,
[USERNAME_UPDATED_EVENT]: FORUM_EVENT_USERNAME_UPDATED, [USERNAME_UPDATED_EVENT]: FORUM_EVENT_USERNAME_UPDATED,
[TOPIC_CREATED_EVENT]: FORUM_EVENT_TOPIC_CREATED, [TOPIC_CREATED_EVENT]: FORUM_EVENT_TOPIC_CREATED,
[POST_CREATED_EVENT]: FORUM_EVENT_POST_CREATED, [POST_CREATED_EVENT]: FORUM_EVENT_POST_CREATED,
[USER_VOTED_POST_EVENT]: POST_VOTING_USER_VOTED_POST,
}; };
export default eventActionMap; export default eventActionMap;

10
packages/concordia-shared/src/constants/contracts/events/PostVotingContractEvents.js

@ -0,0 +1,10 @@
const USER_VOTED_POST_EVENT = 'UserVotedPost';
const postVotingContractEvents = Object.freeze([
USER_VOTED_POST_EVENT,
]);
module.exports = {
USER_VOTED_POST_EVENT,
postVotingContractEvents,
};

6
packages/concordia-shared/src/constants/contracts/events/index.js

@ -1,8 +1,10 @@
const forumContractEvents = require('./ForumContractEvents'); const { forumContractEvents } = require('./ForumContractEvents');
const { FORUM_CONTRACT } = require('../ContractNames'); const { postVotingContractEvents } = require('./PostVotingContractEvents');
const { FORUM_CONTRACT, POST_VOTING_CONTRACT } = require('../ContractNames');
const appEvents = Object.freeze({ const appEvents = Object.freeze({
[FORUM_CONTRACT]: forumContractEvents, [FORUM_CONTRACT]: forumContractEvents,
[POST_VOTING_CONTRACT]: postVotingContractEvents,
}); });
module.exports = appEvents; module.exports = appEvents;

Loading…
Cancel
Save