Skip to content

Commit

Permalink
Merge branch 'develop' into fix/cfe-324-proposal-message-accordion
Browse files Browse the repository at this point in the history
  • Loading branch information
jennieramida committed Feb 14, 2024
2 parents 612aad9 + 2c57839 commit f216e92
Show file tree
Hide file tree
Showing 71 changed files with 2,486 additions and 537 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

- [#782](https://github.com/alleslabs/celatone-frontend/pull/782) Show proposal details on vote details section tabs
- [#779](https://github.com/alleslabs/celatone-frontend/pull/779) Proposal period overview voting - no with veto alert
- [#778](https://github.com/alleslabs/celatone-frontend/pull/778) Proposal period overview voting
- [#775](https://github.com/alleslabs/celatone-frontend/pull/775) Proposal period overview deposit
- [#777](https://github.com/alleslabs/celatone-frontend/pull/777) Proposal votes table including filter and search functionality
- [#766](https://github.com/alleslabs/celatone-frontend/pull/766) Proposal status summary body
- [#763](https://github.com/alleslabs/celatone-frontend/pull/763) Proposal status summary top
- [#765](https://github.com/alleslabs/celatone-frontend/pull/765) Support Proposal Cancelled status
Expand All @@ -56,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Improvements

- [#776](https://github.com/alleslabs/celatone-frontend/pull/776) Add expand/collapse all to proposal messages in detail page
- [#781](https://github.com/alleslabs/celatone-frontend/pull/781) Tooltip default shouldWrap
- [#774](https://github.com/alleslabs/celatone-frontend/pull/774) Add relevant contract to cosmwasm pool
- [#771](https://github.com/alleslabs/celatone-frontend/pull/771) Adjust proposal detail
- [#772](https://github.com/alleslabs/celatone-frontend/pull/772) Add zod validator to code details page code id params
Expand All @@ -69,6 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Bug fixes

- [#780](https://github.com/alleslabs/celatone-frontend/pull/780) Fix proposal vote table, scroll to top on table
- [#761](https://github.com/alleslabs/celatone-frontend/pull/761) Fix copy button tooltip alignment
- [#754](https://github.com/alleslabs/celatone-frontend/pull/754) Fix mobile guard incorrect behavior
- [#751](https://github.com/alleslabs/celatone-frontend/pull/751) Fix fail txs should have no logs and remove stone-12-1
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"cosmjs-types": "^0.9.0",
"dayjs": "^1.11.6",
"file-saver": "^2.0.5",
"framer-motion": "^7.6.12",
"framer-motion": "^11.0.3",
"graphql": "^16.6.0",
"graphql-request": "^5.0.0",
"js-base64": "^3.7.4",
Expand Down
135 changes: 47 additions & 88 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/lib/app-provider/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export enum CELATONE_QUERY_KEYS {
// X/GOV
PROPOSAL_DATA = "CELATONE_QUERY_PROPOSAL_DATA",
PROPOSAL_VALIDATOR_VOTES_INFO = "CELATONE_QUERY_PROPOSAL_VALIDATOR_VOTES_INFO",
PROPOSAL_VOTES = "CELATONE_QUERY_PROPOSAL_VOTES",
PROPOSAL_VALIDATOR_VOTES = "CELATONE_QUERY_PROPOSAL_VALIDATOR_VOTES",
PROPOSAL_ANSWER_COUNTS = "CELATONE_QUERY_PROPOSAL_ANSWER_COUNTS",
RELATED_PROPOSALS_BY_CONTRACT_ADDRESS = "CELATONE_QUERY_RELATED_PROPOSALS_BY_CONTRACT_ADDRESS",
PROPOSALS_BY_MODULE_ID = "CELATONE_QUERY_PROPOSALS_BY_MODULE_ID",
PROPOSALS_COUNT_BY_MODULE_ID = "CELATONE_QUERY_PROPOSALS_COUNT_BY_MODULE_ID",
Expand Down
4 changes: 1 addition & 3 deletions src/lib/components/PrimaryNameMark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { Tooltip } from "lib/components/Tooltip";

export const PrimaryNameMark = () => (
<Tooltip label="Primary name">
<div>
<CustomIcon name="star-solid" color="accent.main" boxSize={3} m={0} />
</div>
<CustomIcon name="star-solid" color="accent.main" boxSize={3} m={0} />
</Tooltip>
);
20 changes: 10 additions & 10 deletions src/lib/components/Tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { TooltipProps } from "@chakra-ui/react";
import { Flex, Tooltip as ChakraTooltip } from "@chakra-ui/react";
import { Tooltip as ChakraTooltip } from "@chakra-ui/react";

import { CustomIcon } from "./icon";

Expand All @@ -11,6 +11,7 @@ export const Tooltip = ({
hasArrow
placement={placement}
arrowSize={8}
shouldWrapChildren
{...tooltipProps}
/>
);
Expand All @@ -23,14 +24,13 @@ export const TooltipInfo = ({
iconVariant = "default",
...tooltipProps
}: TooltipInfoProps) => (
<Tooltip {...tooltipProps}>
<Flex cursor="pointer">
<CustomIcon
color="gray.600"
name={iconVariant === "solid" ? "info-circle-solid" : "info-circle"}
boxSize={3}
m={0}
/>
</Flex>
<Tooltip {...tooltipProps} shouldWrapChildren>
<CustomIcon
color="gray.600"
name={iconVariant === "solid" ? "info-circle-solid" : "info-circle"}
boxSize={3}
m={0}
cursor="pointer"
/>
</Tooltip>
);
3 changes: 3 additions & 0 deletions src/lib/components/ValidatorBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface ValidatorBadgeProps {
ampCopierSection?: string;
maxWidth?: string;
hasLabel?: boolean;
moreInfo?: JSX.Element;
}

const FallbackRender = ({
Expand All @@ -40,6 +41,7 @@ export const ValidatorBadge = ({
ampCopierSection,
maxWidth = "160px",
hasLabel = true,
moreInfo,
}: ValidatorBadgeProps) => {
const { data: valImgSrc, isLoading } = useValidatorImage(validator);
const isMobile = useMobile();
Expand Down Expand Up @@ -71,6 +73,7 @@ export const ValidatorBadge = ({
maxWidth={maxWidth}
fixedHeight
/>
{moreInfo}
</Flex>
</>
) : (
Expand Down
14 changes: 2 additions & 12 deletions src/lib/components/delegations/total-card/TotalCardTop.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { TextProps } from "@chakra-ui/react";
import { Flex, Text } from "@chakra-ui/react";

import { CustomIcon } from "lib/components/icon";
import { Tooltip } from "lib/components/Tooltip";
import { TooltipInfo } from "lib/components/Tooltip";

interface TotalCardTopProps {
title: string;
Expand All @@ -19,15 +18,6 @@ export const TotalCardTop = ({
<Text variant="body2" fontWeight={fontWeight} textColor="text.dark">
{title}
</Text>
<Tooltip label={message}>
<div>
<CustomIcon
name="info-circle-solid"
color="gray.600"
boxSize={3}
cursor="pointer"
/>
</div>
</Tooltip>
<TooltipInfo label={message} iconVariant="solid" />
</Flex>
);
4 changes: 3 additions & 1 deletion src/lib/components/forms/SelectInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ interface SelectInputProps<T extends string> {
hasDivider?: boolean;
helperTextComponent?: ReactNode;
labelBgColor?: string;
popoverBgColor?: string;
size?: string | object;
}

Expand Down Expand Up @@ -69,6 +70,7 @@ export const SelectInput = <T extends string>({
hasDivider = false,
helperTextComponent,
labelBgColor = "background.main",
popoverBgColor = "gray.900",
size = "lg",
}: SelectInputProps<T>) => {
const inputRef = useRef() as MutableRefObject<HTMLInputElement>;
Expand Down Expand Up @@ -149,7 +151,7 @@ export const SelectInput = <T extends string>({
</PopoverTrigger>
<PopoverContent
border="unset"
bg="gray.900"
bg={popoverBgColor}
w={inputRef.current?.clientWidth}
maxH={`${ITEM_HEIGHT * 4}px`}
overflow="scroll"
Expand Down
11 changes: 11 additions & 0 deletions src/lib/components/icon/CustomIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,17 @@ export const ICONS = {
),
viewBox: "-2 -4 16 16",
},
circle: {
svg: (
<path
fillRule="evenodd"
clipRule="evenodd"
d="M0 8C0 12.416 3.584 16 8 16C12.416 16 16 12.416 16 8C16 3.584 12.416 0 8 0C3.584 0 0 3.584 0 8Z"
fill="currentColor"
/>
),
viewBox: viewboxDefault,
},
close: {
svg: (
<path
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/pagination/PageDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const PageDetail = ({
Items per page:
</Text>
<Select
bg="inherit"
border="none"
minW="70px"
w="fit-content"
Expand Down
4 changes: 1 addition & 3 deletions src/lib/layout/navbar/Expand.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ const SubMenuRender = ({ submenu, isCurrentPage }: SubMenuProps) => (
{submenu.map((subitem) =>
subitem.isDisable ? (
<Tooltip key={subitem.slug} label={subitem.tooltipText} maxW="240px">
<div>
<NavInfo submenu={subitem} isCurrentPage={isCurrentPage} />
</div>
<NavInfo submenu={subitem} isCurrentPage={isCurrentPage} />
</Tooltip>
) : (
<AppLink
Expand Down
29 changes: 29 additions & 0 deletions src/lib/pages/proposal-details/components/ActiveDot.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Box, type BoxProps } from "@chakra-ui/react";
import { easeInOut, transform, useAnimationFrame } from "framer-motion";
import { useRef } from "react";

import { getCurrentDate } from "lib/utils";

const DURATION = 1500; // in milliseconds
const opacityMap = transform([0, 0.5, 1], [1, 0.25, 1]);

export const ActiveDot = (props: BoxProps) => {
const ref = useRef<HTMLDivElement>(null);

useAnimationFrame(() => {
if (ref.current?.style) {
const time = getCurrentDate().getTime();
ref.current.style.opacity = `${opacityMap(easeInOut((time % DURATION) / DURATION))}`;
}
});

return (
<Box
ref={ref}
boxSize={3}
borderRadius="50%"
bgColor="accent.main"
{...props}
/>
);
};
39 changes: 0 additions & 39 deletions src/lib/pages/proposal-details/components/AllVotesTable.tsx

This file was deleted.

52 changes: 52 additions & 0 deletions src/lib/pages/proposal-details/components/DepositList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { Flex, Text } from "@chakra-ui/react";

import { useMobile } from "lib/app-provider";
import { ExplorerLink } from "lib/components/ExplorerLink";
import { TokenImageRender } from "lib/components/token";
import type { ProposalDeposit } from "lib/types";
import { formatUTokenWithPrecision, getTokenLabel } from "lib/utils";

interface DepositListProps {
proposalDeposits: ProposalDeposit[];
}

export const DepositList = ({ proposalDeposits }: DepositListProps) => {
const isMobile = useMobile();

return (
<div>
{proposalDeposits.map((deposit, index) => (
<Flex
key={deposit.depositor + index.toString()}
justify="space-between"
py="10px"
borderY="1px solid var(--chakra-colors-gray-700)"
>
<ExplorerLink
value={deposit.depositor}
type="user_address"
showCopyOnHover={!isMobile}
/>
<div>
{deposit.amount.map((token) => (
<Flex key={token.denom} alignItems="center" gap={2}>
<Text variant="body2">
<Text as="span" fontWeight={700} mr={1}>
{formatUTokenWithPrecision(
token.amount,
token.precision ?? 0,
true,
2
)}
</Text>
{getTokenLabel(token.denom, token.symbol)}
</Text>
<TokenImageRender logo={token.logo} />
</Flex>
))}
</div>
</Flex>
))}
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { ErrorFetching } from "lib/components/state";

interface ErrorFetchingProposalInfosProps {
isParamsOnly?: boolean;
}

export const ErrorFetchingProposalInfos = ({
isParamsOnly = false,
}: ErrorFetchingProposalInfosProps) => (
<ErrorFetching
dataName={`proposal params${!isParamsOnly && "and votes tally"}`}
/>
);
Loading

0 comments on commit f216e92

Please sign in to comment.