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

Transactions table on Treasury tab #842

Open
wants to merge 76 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
52e7770
user page initial commit, font changed, tabs & cards updated
fabiolalombardim Dec 7, 2023
d661c18
Merge branch 'develop' into user-page
fabiolalombardim Dec 13, 2023
c15cacd
upgrades on user page
fabiolalombardim Jan 5, 2024
a7136aa
merge staging
fabiolalombardim Jan 5, 2024
61570aa
Merge branch 'staging' into user-page
fabiolalombardim Jan 5, 2024
1e8646a
Merge branch 'staging' into user-page
fabiolalombardim Jan 5, 2024
56434b8
user movements component
fabiolalombardim Jan 5, 2024
735146f
user page - voting and proposals list item updated
fabiolalombardim Jan 6, 2024
b0edc65
user transactions finished - pagination & responsiveness
fabiolalombardim Jan 7, 2024
028d94f
clean up
fabiolalombardim Jan 7, 2024
70e00e0
votes component logic fixed
fabiolalombardim Jan 10, 2024
a90726c
tabs updated and pagination added to all tabs
fabiolalombardim Jan 13, 2024
0760da0
merge develop chances and fix user tab when no items showed
fabiolalombardim Jan 13, 2024
ea5bced
multiple ui fixes
fabiolalombardim Jan 14, 2024
c8fb478
clean up
fabiolalombardim Jan 14, 2024
4c510a9
fix padding
fabiolalombardim Jan 14, 2024
a40a88f
fix quorum values on summary
fabiolalombardim Jan 16, 2024
82cda9f
fix card paddings
fabiolalombardim Jan 30, 2024
d933e66
initial commit
fabiolalombardim Feb 9, 2024
2fea703
responsive header & readable date for history component
fabiolalombardim Feb 9, 2024
534f448
last UI changes
fabiolalombardim Feb 10, 2024
f87f740
nft transfer component
fabiolalombardim Feb 11, 2024
e4809c1
removed thershold label since not needed
fabiolalombardim Feb 12, 2024
e327c09
merge develop
fabiolalombardim Feb 16, 2024
a193668
merge develop
fabiolalombardim Feb 25, 2024
80424fc
validation for downloading votes & label for when no votes on dialog
fabiolalombardim Feb 25, 2024
396b2db
layout
fabiolalombardim Feb 25, 2024
1f1cd07
selected filters logic
fabiolalombardim Mar 3, 2024
ae45ec1
Merge branch 'master' into develop
fabiolalombardim Mar 7, 2024
20fe80f
update branch with master and develop and added try catch
fabiolalombardim Mar 7, 2024
c28579c
Merge branch 'develop' into filtering-proposals
fabiolalombardim Mar 7, 2024
c428010
remove switch from dialogs, new modal for actions & new modal reorgan…
fabiolalombardim Mar 7, 2024
52d7f3d
proposal dialog
fabiolalombardim Mar 19, 2024
f95a7b4
Merge branch 'develop' of https://github.com/dOrgTech/homebase-app in…
fabiolalombardim Mar 24, 2024
2914dc9
Merge branch 'develop' into proposal-details
fabiolalombardim Mar 24, 2024
8325be2
add constant
fabiolalombardim Mar 24, 2024
b19fa59
Merge branch 'develop' into multiple-fixes
fabiolalombardim Mar 24, 2024
46a05da
actions modal ready
fabiolalombardim Mar 24, 2024
3a87dd2
clean up & css fix user tab
fabiolalombardim Mar 24, 2024
7071843
Merge branch 'master' into develop
fabiolalombardim Mar 28, 2024
850eaca
Merge pull request #772 from dOrgTech/proposal-details
fabiolalombardim Mar 29, 2024
9823bdc
Merge branch 'develop' of https://github.com/dOrgTech/homebase-app in…
fabiolalombardim Mar 29, 2024
b5d50c3
merge develop & fix dependencies
fabiolalombardim Mar 29, 2024
c768447
Merge pull request #798 from dOrgTech/multiple-fixes
fabiolalombardim Mar 29, 2024
5d0f26a
fix small css
fabiolalombardim Mar 29, 2024
eec31ea
top members component brought back
fabiolalombardim Mar 29, 2024
02de3a8
user tab - activity section new layout
fabiolalombardim Mar 30, 2024
7cdbb4b
Merge pull request #814 from dOrgTech/card-padding
fabiolalombardim Apr 6, 2024
5db0bfe
Merge pull request #815 from dOrgTech/top-members
fabiolalombardim Apr 6, 2024
93c1f30
Merge branch 'develop' into user-activity
fabiolalombardim Apr 6, 2024
b5d5a75
activity logic
fabiolalombardim Apr 6, 2024
897fcf8
Merge branch 'develop' into filtering-proposals
fabiolalombardim Apr 6, 2024
d018deb
Merge branch 'filtering-proposals' into user-activity
fabiolalombardim Apr 6, 2024
082540e
filter dialog layout & logic working
fabiolalombardim Apr 6, 2024
b88c202
logic
fabiolalombardim Apr 6, 2024
9500699
filters for proposals & votes
fabiolalombardim Apr 12, 2024
68f610e
logic improved
fabiolalombardim Apr 12, 2024
839ab70
proposal tab filter dialog
fabiolalombardim Apr 12, 2024
9237c89
Merge branch 'master' into develop
fabiolalombardim Apr 13, 2024
4aae9e0
Ipfs lite (#813)
fabiolalombardim Apr 23, 2024
2303b54
Merge branch 'develop' of https://github.com/dOrgTech/homebase-app in…
fabiolalombardim Apr 27, 2024
9aba95b
Merge branch 'develop' into user-activity
fabiolalombardim Apr 27, 2024
d02562c
new ui implemented
fabiolalombardim Apr 30, 2024
4285c9e
fix initial filtering
fabiolalombardim May 13, 2024
10f5195
implemented new design
fabiolalombardim May 13, 2024
c4a6a9d
Merge pull request #841 from dOrgTech/cards-update
fabiolalombardim May 19, 2024
3794822
merge develop
fabiolalombardim May 19, 2024
c459fc1
Merge pull request #825 from dOrgTech/user-activity
fabiolalombardim May 19, 2024
32024b4
Merge branch 'develop' into offchain-polls
fabiolalombardim May 25, 2024
769a301
rpc node updated & loading for casting vote
fabiolalombardim May 25, 2024
350d952
desktop update
fabiolalombardim May 25, 2024
ccc06d2
responsive tables
fabiolalombardim May 26, 2024
12ae5c0
no items + scroll on other tabs
fabiolalombardim May 26, 2024
40318e7
requested change
fabiolalombardim May 28, 2024
c040f6e
Merge pull request #837 from dOrgTech/offchain-polls
fabiolalombardim May 28, 2024
9fbbbb5
Merge branch 'develop' into treasury-tables
fabiolalombardim May 28, 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 .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
npx lint-staged
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.15.1
v18.20.0
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"svg.preview.background": "black"
}
"svg.preview.background": "black",
"cSpell.words": [
"offchain"
]
}
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"blockies-ts": "^1.0.0",
"crypto-browserify": "^3.12.0",
"dayjs": "^1.10.4",
"export-to-csv": "^1.2.4",
"formik": "^2.2.6",
"formik-material-ui": "^3.0.1",
"formik-material-ui-lab": "^0.0.8",
Expand Down Expand Up @@ -92,15 +93,15 @@
"@types/react-html-parser": "^2.0.2",
"@types/react-router-dom": "^5.1.6",
"@types/yup": "^0.29.11",
"@typescript-eslint/eslint-plugin": "^4.18.0",
"@typescript-eslint/parser": "^4.18.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"eslint": "^7.22.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"husky": "8.0.3",
"lint-staged": "15.2.2",
"prettier": "^2.2.0",
"source-map-explorer": "2.5.2",
"typescript": "^5.0.4"
Expand Down Expand Up @@ -133,7 +134,7 @@
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx}": [
"yarn lint:check"
"npm run lint:check"
]
}
}
3 changes: 3 additions & 0 deletions src/assets/img/download_csv.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import dayjs from "dayjs"

dayjs.extend(localizedFormat)

// eslint-disable-next-line react/no-deprecated
ReactDOM.render(
<React.StrictMode>
<TezosProvider>
Expand Down
4 changes: 4 additions & 0 deletions src/models/Choice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ export interface Choice {
export interface WalletAddress {
address: string
balanceAtReferenceBlock: string
cidLink: string
choiceId: string
payloadBytes: string
signature: string
}
2 changes: 2 additions & 0 deletions src/models/Polls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export interface Poll {
endTimeHours?: number | null
endTimeDays?: number | null
isXTZ: boolean
id?: string
getStatus?: any
}

export interface Vote {
Expand Down
13 changes: 7 additions & 6 deletions src/modules/explorer/components/BatchBar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import { Grid, Paper, styled, Switch, Typography } from "@material-ui/core"
import { ProposalFormInput } from "./ProposalFormInput"

import AddIcon from "@mui/icons-material/Add"
const BatchBarContainer = styled(Grid)(({ theme }) => ({
height: 47,
alignItems: "start",
Expand Down Expand Up @@ -41,8 +41,6 @@ const TransferActive = styled(Grid)({

const AddButton = styled(Paper)({
"marginLeft": 12,
"minHeight": 31,
"minWidth": 31,
"textAlign": "center",
"padding": 0,
"background": "inherit",
Expand Down Expand Up @@ -90,13 +88,13 @@ export const BatchBar = ({ isBatch, handleIsBatchChange, onClickAdd, items, acti
item
key={index}
onClick={() => setActiveItem(index)}
style={Number(index + 1) === activeItem ? { background: "#81FEB7" } : { background: "inherit" }}
style={Number(index + 1) === activeItem ? { background: "#24282D" } : { background: "inherit" }}
>
<Typography
variant="subtitle2"
style={
Number(index + 1) === activeItem
? { color: "#1C1F23", fontWeight: 500 }
? { color: "#81FEB7", fontWeight: 500 }
: { color: "#fff", opacity: 0.65, fontWeight: 500 }
}
>
Expand All @@ -106,7 +104,10 @@ export const BatchBar = ({ isBatch, handleIsBatchChange, onClickAdd, items, acti
)
})}

<AddButton onClick={onClickAdd}>+</AddButton>
<AddButton onClick={onClickAdd}>
{" "}
<AddIcon />{" "}
</AddButton>
</BatchBarContainer>
) : null}
</Grid>
Expand Down
21 changes: 17 additions & 4 deletions src/modules/explorer/components/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ interface DropdownProps extends SelectProps {
value?: string | undefined
onSelected?: (item: string | undefined) => void
isFirst?: boolean
isFilter?: boolean
}

const useStyles = makeStyles((theme: Theme) => ({
Expand All @@ -24,17 +25,29 @@ const useStyles = makeStyles((theme: Theme) => ({
minHeight: 24
},
option: {
"padding": 8,
"padding": 12,
"fontFamily": "Roboto Flex",
"cursor": "pointer",
"text-transform": "capitalize",
"&:hover": {
background: "rgba(129, 254, 183, .4)"
}
},
selectFilter: {
"backgroundColor": "#2F3438",
"padding": 12,
"borderRadius": 8,
"paddingRight": "36px !important",
"&:focus": {
backgroundColor: "#2F3438",
padding: 12,
borderRadius: 8,
paddingRight: 36
}
}
}))

export const Dropdown: React.FC<DropdownProps> = ({ options, value, onSelected }) => {
export const Dropdown: React.FC<DropdownProps> = ({ options, value, onSelected, isFilter = false }) => {
const classes = useStyles()
const [selected, setSelected] = useState<string | undefined>(value)

Expand All @@ -49,11 +62,11 @@ export const Dropdown: React.FC<DropdownProps> = ({ options, value, onSelected }

return (
<Select
// native
disableUnderline={true}
value={selected}
onChange={handleSelected}
classes={{
select: classes.selectSelect
select: isFilter ? classes.selectFilter : classes.selectSelect
}}
>
{options.map(({ name, value }, index) => (
Expand Down
176 changes: 176 additions & 0 deletions src/modules/explorer/components/FiltersDialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
import React, { useEffect, useState } from "react"
import { ResponsiveDialog } from "./ResponsiveDialog"
import { Grid, styled } from "@material-ui/core"
import { Typography } from "@mui/material"
import { Dropdown } from "./Dropdown"
import { ProposalStatus } from "services/services/dao/mappers/proposal/types"
import { SmallButton } from "modules/common/SmallButton"
import { Order, ProposalType } from "./FiltersUserDialog"
import { Filters } from "../pages/User/components/UserMovements"

interface Props {
open: boolean
handleClose: () => void
selectedTab: number
saveFilters: (filters: Filters) => void
}

const SectionTitle = styled(Typography)({
fontSize: "18px !important",
fontWeight: 600
})

const Container = styled(Grid)({
marginTop: 6,
gap: 24
})

const StatusButton = styled(Grid)(({ theme }) => ({
"background": theme.palette.primary.main,
"padding": "8px 16px",
"borderRadius": 50,
"marginRight": 16,
"marginBottom": 16,
"cursor": "pointer",
"textTransform": "capitalize",
"&:hover": {
background: "rgba(129, 254, 183, .4)"
}
}))

interface StatusOption {
label: string
selected: boolean
}

export enum OffchainStatus {
ACTIVE = "active",
CLOSED = "closed",
ALL = "all"
}

export const FilterProposalsDialog: React.FC<Props> = ({ open, handleClose, selectedTab, saveFilters }) => {
const [filters, setFilters] = useState<StatusOption[]>([])
const [status, setStatus] = useState<StatusOption[]>([])
const [offchainStatus, setOffchainStatus] = useState<OffchainStatus>(OffchainStatus.ALL)
const proposalType = selectedTab === 0 ? ProposalType.ON_CHAIN : ProposalType.OFF_CHAIN
const [order, setOrder] = useState<Order>(Order.RECENT)

const isSelected = (item: StatusOption) => {
return filters.includes(item) ? true : false
}

const saveStatus = (status: StatusOption) => {
let updated: StatusOption[] = []
if (filters.includes(status)) {
status.selected = false
updated = filters.filter(item => item.label !== status.label)
} else {
updated = filters.slice()
updated.push(status)
}
setFilters(updated)
}

const findStatus = () => {
const values = Object.values(ProposalStatus)
for (const item in values) {
const obj = {
label: values[item],
selected: false
}
setStatus(oldArray => [...oldArray, obj])
}
}

useEffect(() => {
setStatus([])
findStatus()
}, [])

const saveOffchainStatus = (status: OffchainStatus) => {
if (offchainStatus === status) {
setOffchainStatus(OffchainStatus.ALL)
} else {
setOffchainStatus(status)
}
}

const showFilters = () => {
const filterObject: Filters = {
type: proposalType,
offchainStatus: offchainStatus,
onchainStatus: filters,
order: order
}
saveFilters(filterObject)
handleClose()
}

return (
<>
<ResponsiveDialog open={open} onClose={handleClose} title={"Filter"} template="sm">
{/* <Container container direction="column">
<Grid item>
<SectionTitle>Sort By</SectionTitle>
</Grid>
<Grid item>
<Dropdown
options={[
{ name: "Newest to Oldest", value: "recent" },
{ name: "Most Popular to Least Popular", value: "popular" }
]}
value={"recent"}
// onSelected={filterProposalByPopularity}
isFilter={true}
/>
</Grid>
</Container> */}
<Container container direction="column">
<Grid item>
<SectionTitle>Proposal Status</SectionTitle>
</Grid>
{selectedTab === 0 ? (
<Grid item container direction="row">
{status.length > 0 &&
status.map((item, index) => {
return (
<StatusButton
item
key={`status-${index}`}
style={isSelected(item) ? { backgroundColor: "#fff", color: "#1c1f23" } : {}}
>
<Typography onClick={() => saveStatus(item)}>{item.label}</Typography>
</StatusButton>
)
})}
</Grid>
) : (
<Grid item container direction="row">
<StatusButton
item
onClick={() => saveOffchainStatus(OffchainStatus.ACTIVE)}
style={offchainStatus === OffchainStatus.ACTIVE ? { backgroundColor: "#fff", color: "#1c1f23" } : {}}
>
<Typography>Active</Typography>
</StatusButton>
<StatusButton
item
onClick={() => saveOffchainStatus(OffchainStatus.CLOSED)}
style={offchainStatus === OffchainStatus.CLOSED ? { backgroundColor: "#fff", color: "#1c1f23" } : {}}
>
<Typography>Closed</Typography>
</StatusButton>
</Grid>
)}
</Container>

<Container container direction="row" justifyContent="flex-end">
<SmallButton color="secondary" variant="contained" onClick={showFilters}>
Apply
</SmallButton>
</Container>
</ResponsiveDialog>
</>
)
}
Loading
Loading