This repository was archived by the owner on Jan 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Feat/account activities #1437
Open
Adesojisouljay
wants to merge
17
commits into
development
Choose a base branch
from
feat/account-activities
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feat/account activities #1437
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0e39e7d
initiate activities page
Adesojisouljay 2e345f8
load activities
Adesojisouljay 04bf238
sort activities
Adesojisouljay fc3bef9
flow changes
Adesojisouljay 253dddf
background theme
Adesojisouljay 9b3a11f
Add filters
Adesojisouljay 6b124e2
fix key
Adesojisouljay 37b2256
new files and folder
Adesojisouljay efe7b99
changed operations fetching logic
Adesojisouljay feaf9ea
handled load more
Adesojisouljay 1b9f763
fix comment and reply render logic
Adesojisouljay f6a38b4
added donwvote svg
Adesojisouljay 0518b06
added proposal and witness link
Adesojisouljay 94bbfc0
fixed filtering activities
Adesojisouljay ccc9e03
set mobile view
Adesojisouljay 10e5a66
added text to translation file
Adesojisouljay 3738409
update setfilter type
Adesojisouljay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
102 changes: 102 additions & 0 deletions
102
src/common/components/profile-activities/activities-dropdown.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| import React, { useState } from 'react' | ||
| import DropDown from "../dropdown" | ||
| import { ActivitiesGroup } from "./types/activities-group" | ||
|
|
||
| interface Props { | ||
| setFilter: React.Dispatch<React.SetStateAction<"" | ActivitiesGroup>> | ||
| } | ||
|
|
||
| const ActivitiesDropdown = (props: Props) => { | ||
|
|
||
| const { setFilter } = props; | ||
|
|
||
| const [label, setLabel] = useState("") | ||
|
|
||
| const dropDown = ( | ||
| <div className="mb-2"> | ||
| <div> | ||
| {(() => { | ||
| let dropDownConfig: any; | ||
| dropDownConfig = { | ||
| history: "", | ||
| label: label ? label : "All", | ||
| items: [ | ||
| { | ||
| label: <span>All</span>, | ||
| onClick: () => { | ||
| setLabel("All"); | ||
| setFilter(""); | ||
| } | ||
| }, | ||
| { | ||
| label: <span>Comments</span>, | ||
| onClick: () => { | ||
| setLabel("Comments"); | ||
| setFilter("comment"); | ||
| } | ||
| }, | ||
| { | ||
| label: <span>Replies</span>, | ||
| onClick: () => { | ||
| setLabel("Replies"); | ||
| setFilter("comment"); | ||
| } | ||
| }, | ||
| { | ||
| label: <span>Custom json</span>, | ||
| onClick: () => { | ||
| setLabel("Follows"); | ||
| setFilter("custom_json"); | ||
| } | ||
| }, | ||
| // { | ||
| // label: <span>Likes</span>, | ||
| // onClick: () => { | ||
| // setLabel("Likes"); | ||
| // setFilter("custom_json"); | ||
| // } | ||
| // }, | ||
| // { | ||
| // label: <span>Communities</span>, | ||
| // onClick: () => { | ||
| // setLabel("Communities"); | ||
| // setFilter("custom_json"); | ||
| // } | ||
| // }, | ||
| { | ||
| label: <span>Witness votes</span>, | ||
| onClick: () => { | ||
| setLabel("Witness votes"); | ||
| setFilter("account_witness_vote"); | ||
| } | ||
| }, | ||
| { | ||
| label: <span>Proposal votes</span>, | ||
| onClick: () => { | ||
| setLabel("Proposal votes"); | ||
| setFilter("update_proposal_votes"); | ||
| } | ||
| } | ||
| ] | ||
| }; | ||
| return ( | ||
| <div className="dropdown-wrapper"> | ||
| <DropDown {...dropDownConfig} float="top" /> | ||
| </div> | ||
| ); | ||
| })()} | ||
| </div> | ||
| </div> | ||
| ); | ||
|
|
||
| return ( | ||
| <> | ||
| <div className="dropdown-header"> | ||
| <h5>Filter activities</h5> | ||
| </div> | ||
| {dropDown} | ||
| </> | ||
| ) | ||
| } | ||
|
|
||
| export default ActivitiesDropdown | ||
35 changes: 35 additions & 0 deletions
35
src/common/components/profile-activities/activities-types.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import React from 'react' | ||
| import { Link } from 'react-router-dom' | ||
| import { Account } from "../../store/accounts/types" | ||
| import { Global } from '../../store/global/types' | ||
|
|
||
| interface Props { | ||
| account: Account; | ||
| global: Global; | ||
| } | ||
|
|
||
| const ActivitiesTypes = (props: Props) => { | ||
|
|
||
| const { account, global } = props; | ||
| return ( | ||
| <div> | ||
| <div className="d-flex justify-content-center"> | ||
| <h5 className="types-header">Activity Types</h5> | ||
| </div> | ||
| <div className={`types-wrapper`}> | ||
| <div className={`${global.isMobile ? "flex-row" : "flex-column"} filter-types`}> | ||
| <Link to={`/@${account?.name}/comments`}>Comments</Link> | ||
| <Link to={`/@${account?.name}/replies`}>Replies</Link> | ||
| <Link to={`/@${account?.name}/trail`}>Votes</Link> | ||
| <Link to={`/@${account?.name}/communities`}>Communities</Link> | ||
| </div> | ||
| <div className={`${global.isMobile ? "flex-row" : "flex-column"} filter-types`}> | ||
| <Link to={`/witnesses?voter=${account.name}`}>Witness votes</Link> | ||
| <Link to={`/proposals?voter=${account.name}`}>Proposal votes</Link> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| export default ActivitiesTypes |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just means
setFilter: (v: string) => voidThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, I'll handle that