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

fix: lowercase roundId on round page & application page #3418

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ export default function ViewProjectDetails() {
datadogLogs.logger.info(`====> URL: ${window.location.href}`);
const {
chainId,
roundId,
roundId: paramRoundId,
applicationId: paramApplicationId,
} = useProjectDetailsParams();
const dataLayer = useDataLayer();
const { address: walletAddress } = useAccount();

const roundId = paramRoundId.toLowerCase();
let applicationId: string;

/// handle URLs where the application ID is ${roundId}-${applicationId}
Expand Down Expand Up @@ -549,12 +550,12 @@ function Sidebar(props: {

export function ProjectStats() {
const { chainId, roundId, applicationId } = useProjectDetailsParams();
const { round } = useRoundById(Number(chainId), roundId);
const { round } = useRoundById(Number(chainId), roundId.toLowerCase());
const dataLayer = useDataLayer();
const { data: application } = useApplication(
{
chainId: Number(chainId as string),
roundId,
roundId: roundId.toLowerCase(),
applicationId: applicationId,
},
dataLayer
Expand Down
10 changes: 5 additions & 5 deletions packages/grant-explorer/src/features/round/ViewRoundPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import {
import {
CalendarIcon,
ChainId,
VotingToken,
formatUTCDateAsISOString,
getRoundStrategyTitle,
getUTCTime,
renderToPlainText,
truncateDescription,
useTokenPrice,
VotingToken,
} from "common";
import { Button, Input } from "common/src/styles";
import AlloV1 from "common/src/icons/AlloV1";
Expand Down Expand Up @@ -123,15 +123,15 @@ export default function ViewRound() {
<BeforeRoundStart
round={round}
chainId={chainId}
roundId={roundId}
roundId={roundId.toLowerCase()}
/>
)}

{isAfterRoundStartDate && (
<AfterRoundStart
round={round}
chainId={Number(chainId)}
roundId={roundId}
roundId={roundId.toLowerCase()}
isBeforeRoundEndDate={isBeforeRoundEndDate}
isAfterRoundEndDate={isAfterRoundEndDate}
/>
Expand Down Expand Up @@ -298,7 +298,7 @@ function AfterRoundStart(props: {
const nativePayoutToken = votingTokens.find(
(t) =>
t.chainId === Number(props.chainId) &&
t.address === getAddress(props.round.token)
t.address.toLowerCase() === getAddress(props.round.token).toLowerCase()
);

const tokenData = data ?? {
Expand Down Expand Up @@ -1206,7 +1206,7 @@ function PreRoundPage(props: {
const nativePayoutToken = votingTokens.find(
(t) =>
t.chainId === Number(chainId) &&
t.address === getAddress(props.round.token)
t.address.toLowerCase() === getAddress(props.round.token).toLowerCase()
);

const tokenData = data ?? {
Expand Down
Loading