Skip to content

Commit

Permalink
tabs for on-chain & off-chain
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiolalombardim committed Dec 6, 2023
1 parent be4466b commit 19c5f4c
Show file tree
Hide file tree
Showing 8 changed files with 280 additions and 230 deletions.
3 changes: 3 additions & 0 deletions src/assets/img/link_active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/img/link_inactive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/assets/img/unlink_active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/assets/img/unlink_inactive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 2 additions & 13 deletions src/modules/explorer/components/DAOStatsRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ import { ProposalStatus } from "services/services/dao/mappers/proposal/types"
import { useDAOID } from "../pages/DAO/router"
import { usePolls } from "modules/lite/explorer/hooks/usePolls"
import dayjs from "dayjs"
import AccountBalanceWalletIcon from "@mui/icons-material/AccountBalanceWallet"
import FiberSmartRecordIcon from "@mui/icons-material/FiberSmartRecord"
import LockIcon from "@mui/icons-material/Lock"
import HowToVoteIcon from "@mui/icons-material/HowToVote"
import PaletteIcon from "@mui/icons-material/Palette"
import { ReactComponent as TzIcon } from "assets/img/tz_circle.svg"
import { formatNumber } from "../utils/FormatNumber"
import { useDAOHoldings, useDAONFTHoldings } from "services/contracts/baseDAO/hooks/useDAOHoldings"

Expand Down Expand Up @@ -40,7 +34,7 @@ const ItemTitle = styled(Typography)(({ theme }) => ({
}))

const ItemValue = styled(Typography)(({ theme }) => ({
fontSize: 36,
fontSize: 32,
fontWeight: 300,
[theme.breakpoints.down("sm")]: {
fontSize: 28
Expand Down Expand Up @@ -94,7 +88,6 @@ export const DAOStatsRow: React.FC = () => {
<Grid item xs={12} sm={6} md={4}>
<Item>
<ItemContent item container direction="row" alignItems="center">
<AccountBalanceWalletIcon color="secondary" />
<ItemTitle color="textPrimary">Total {symbol}</ItemTitle>
</ItemContent>
<Grid item>
Expand All @@ -105,7 +98,6 @@ export const DAOStatsRow: React.FC = () => {
<Grid item xs={12} sm={6} md={4}>
<Item>
<ItemContent item container direction="row" alignItems="center">
<TzIcon color="secondary" />
<ItemTitle color="textPrimary">Voting Addresses</ItemTitle>
</ItemContent>
<Grid item>
Expand All @@ -116,7 +108,6 @@ export const DAOStatsRow: React.FC = () => {
<Grid item xs={12} sm={6} md={4}>
<Item>
<ItemContent item container direction="row" alignItems="center">
<FiberSmartRecordIcon color="secondary" style={{ transform: "rotate(180deg)" }} />
<ItemTitle color="textPrimary">Tokens</ItemTitle>
</ItemContent>
<Grid item>
Expand All @@ -127,7 +118,7 @@ export const DAOStatsRow: React.FC = () => {
<Grid item xs={12} sm={6} md={4}>
<Item>
<ItemContent item container direction="row" alignItems="center">
<LockIcon color="secondary" /> <ItemTitle color="textPrimary">{symbol} Locked</ItemTitle>
<ItemTitle color="textPrimary">{symbol} Locked</ItemTitle>
</ItemContent>
<Grid item container direction="row">
<ItemValue color="textPrimary">{formatNumber(amountLocked)}</ItemValue>
Expand All @@ -138,7 +129,6 @@ export const DAOStatsRow: React.FC = () => {
<Grid item xs={12} sm={6} md={4}>
<Item>
<ItemContent item container direction="row" alignItems="center">
<HowToVoteIcon color="secondary" />
<ItemTitle color="textPrimary">Active Proposals</ItemTitle>
</ItemContent>
<Grid item>
Expand All @@ -154,7 +144,6 @@ export const DAOStatsRow: React.FC = () => {
<Grid item xs={12} sm={6} md={4}>
<Item>
<ItemContent item container direction="row" alignItems="center">
<PaletteIcon color="secondary" />
<ItemTitle color="textPrimary">NFTs</ItemTitle>
</ItemContent>
<Grid item>
Expand Down
7 changes: 0 additions & 7 deletions src/modules/explorer/pages/DAO/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,13 @@ const SubtitleText = styled(Typography)({
export const DAO: React.FC = () => {
const daoId = useDAOID()
const { data, cycleInfo, ledger } = useDAO(daoId)
const { mutate } = useFlush()
const theme = useTheme()
const isExtraSmall = useMediaQuery(theme.breakpoints.down("xs"))
const symbol = data && data.data.token.symbol.toUpperCase()

const name = data && data.data.name
const description = data && data.data.description

const { data: activeProposals } = useProposals(daoId, ProposalStatus.ACTIVE)
const { data: executableProposals } = useProposals(daoId, ProposalStatus.EXECUTABLE)
const { data: expiredProposals } = useProposals(daoId, ProposalStatus.EXPIRED)
const { data: polls } = usePolls(data?.liteDAOData?._id)
const activeLiteProposals = polls?.filter(p => Number(p.endTime) > dayjs().valueOf())

const [openDialog, setOpenDialog] = useState(false)

const handleCloseModal = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/explorer/pages/DAOList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const DAOItemCard = styled(Grid)({

const TabsContainer = styled(Grid)(({ theme }) => ({
borderRadius: 8,
gap: 30
gap: 16
}))

export const DAOList: React.FC = () => {
Expand Down
Loading

0 comments on commit 19c5f4c

Please sign in to comment.