From 4e8fc934b9d2f4d8942bf9aa339ac11c8fec3e23 Mon Sep 17 00:00:00 2001 From: Ezerous Date: Sun, 7 Feb 2021 20:53:17 +0200 Subject: [PATCH] Add PostVoting contract to concordia-shared package --- .../InitializationScreen/CustomLoader/index.jsx | 2 +- .../src/redux/actions/contractEventActions.js | 6 ++++++ .../contracts/events/PostVotingContractEvents.js | 10 ++++++++++ .../src/constants/contracts/events/index.js | 6 ++++-- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 packages/concordia-shared/src/constants/contracts/events/PostVotingContractEvents.js diff --git a/packages/concordia-app/src/components/InitializationScreen/CustomLoader/index.jsx b/packages/concordia-app/src/components/InitializationScreen/CustomLoader/index.jsx index e64aa29..d97d214 100644 --- a/packages/concordia-app/src/components/InitializationScreen/CustomLoader/index.jsx +++ b/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 ipfsLogo from '../../../assets/images/ipfs_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) => { useEffect(() => function cleanup() { diff --git a/packages/concordia-app/src/redux/actions/contractEventActions.js b/packages/concordia-app/src/redux/actions/contractEventActions.js index 36a7aea..b736e31 100644 --- a/packages/concordia-app/src/redux/actions/contractEventActions.js +++ b/packages/concordia-app/src/redux/actions/contractEventActions.js @@ -4,17 +4,23 @@ import { USER_SIGNED_UP_EVENT, USERNAME_UPDATED_EVENT, } 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_USERNAME_UPDATED = 'FORUM_EVENT_USERNAME_UPDATED'; export const FORUM_EVENT_TOPIC_CREATED = 'FORUM_EVENT_TOPIC_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 = { [USER_SIGNED_UP_EVENT]: FORUM_EVENT_USER_SIGNED_UP, [USERNAME_UPDATED_EVENT]: FORUM_EVENT_USERNAME_UPDATED, [TOPIC_CREATED_EVENT]: FORUM_EVENT_TOPIC_CREATED, [POST_CREATED_EVENT]: FORUM_EVENT_POST_CREATED, + [USER_VOTED_POST_EVENT]: POST_VOTING_USER_VOTED_POST, }; export default eventActionMap; diff --git a/packages/concordia-shared/src/constants/contracts/events/PostVotingContractEvents.js b/packages/concordia-shared/src/constants/contracts/events/PostVotingContractEvents.js new file mode 100644 index 0000000..17582ab --- /dev/null +++ b/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, +}; diff --git a/packages/concordia-shared/src/constants/contracts/events/index.js b/packages/concordia-shared/src/constants/contracts/events/index.js index 09e71a3..ddc86bd 100644 --- a/packages/concordia-shared/src/constants/contracts/events/index.js +++ b/packages/concordia-shared/src/constants/contracts/events/index.js @@ -1,8 +1,10 @@ -const forumContractEvents = require('./ForumContractEvents'); -const { FORUM_CONTRACT } = require('../ContractNames'); +const { forumContractEvents } = require('./ForumContractEvents'); +const { postVotingContractEvents } = require('./PostVotingContractEvents'); +const { FORUM_CONTRACT, POST_VOTING_CONTRACT } = require('../ContractNames'); const appEvents = Object.freeze({ [FORUM_CONTRACT]: forumContractEvents, + [POST_VOTING_CONTRACT]: postVotingContractEvents, }); module.exports = appEvents;