Skip to content

Commit

Permalink
Replaces all instances of hardcoded 'OP'
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgingras committed Dec 5, 2024
1 parent f73e6a0 commit bbba84b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Input } from "@/components/ui/input";
import { useEnsName } from "wagmi";
import { formatUnits } from "viem";
import { useState, SetStateAction, useEffect, type Dispatch } from "react";
import Tenant from "@/lib/tenant/tenant";

function SubdelegationToRow({
to,
Expand All @@ -21,6 +22,7 @@ function SubdelegationToRow({
index: number;
setOverFlowDelegation: Dispatch<SetStateAction<boolean>>;
}) {
const { token } = Tenant.current();
const [newAllowanceInput, setNewAllowanceInput] = useState("");

const allowance = allowances[index];
Expand Down Expand Up @@ -146,7 +148,7 @@ function SubdelegationToRow({
inputMode="numeric"
/>
<div className="flex items-center pr-2 pl-1 w-[100px]">
<p>OP</p>
<p>{token.symbol}</p>
<div className="bg-input w-[1px] h-6 mx-1"></div>
<p>{percent}%</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import InputBox from "@/components/shared/InputBox";
import { MultiButtons } from "@/components/shared/MultiButtons";
import SimulateTransaction from "@/components/shared/SimulateTransaction";
import { formatEther, parseUnits } from "viem";
import Tenant from "@/lib/tenant/tenant";

export default function AddTransactionsDetails({
form,
Expand All @@ -17,6 +18,7 @@ export default function AddTransactionsDetails({
form: Form;
optionIndex: number;
}) {
const { token } = Tenant.current();
const addTransaction = (type: "Transfer" | "Custom") => {
form.onChange.options(
form.state.options.map((option, i) => {
Expand Down Expand Up @@ -112,10 +114,10 @@ export default function AddTransactionsDetails({
</VStack>
<VStack className="w-full">
<label className="text-xs text-tertiary font-semibold">
Transfer amount requested (OP)
Transfer amount requested ({token.symbol})
</label>
<InputBox
placeholder={"3 000 000 OP"}
placeholder={`3 000 000 ${token.symbol}`}
value={formatEther(transaction.transferAmount)}
type="number"
onChange={(next) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import { HStack, VStack } from "@/components/Layout/Stack";
import InputBox from "@/components/shared/InputBox";
import { Switch } from "@/components/shared/Switch";
import LabelWithInfo from "./LabelWithInfo";
import Tenant from "@/lib/tenant/tenant";

export default function ApprovalCriteriaRow({ form }: { form: Form }) {
const { token } = Tenant.current();
return (
<>
<h4 className="pb-1 font-semibold">Approval parameters</h4>
Expand All @@ -16,12 +18,12 @@ export default function ApprovalCriteriaRow({ form }: { form: Form }) {
</p>
<HStack className="w-full mb-4" gap={4}>
<VStack className="w-full">
<LabelWithInfo label="Budget (OP)">
<LabelWithInfo label={`Budget (${token.symbol})`}>
This is the maximum number of tokens that can be transferred from
all the options in this proposal.
</LabelWithInfo>
<InputBox
placeholder={"30 000 000 OP"}
placeholder={`3 000 000 ${token.symbol}`}
value={form.state.budget}
onChange={(next) => form.onChange.budget(next)}
required
Expand Down Expand Up @@ -69,7 +71,7 @@ export default function ApprovalCriteriaRow({ form }: { form: Form }) {
winner
</LabelWithInfo>
<InputBox
placeholder={"3 000 000 OP"}
placeholder={`3 000 000 ${token.symbol}`}
value={form.state.threshold}
type="number"
onChange={(next) => form.onChange.threshold(next)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { PaginatedResult } from "@/app/lib/pagination";
import { Vote } from "@/app/api/common/votes/vote";
import ProposalNonVoterList from "@/components/Votes/ProposalVotesList/ProposalNonVoterList";
import ProposalVotesFilter from "./ProposalVotesFilter";
import Tenant from "@/lib/tenant/tenant";

const OptimisticProposalVotesCard = ({
proposal,
Expand Down Expand Up @@ -39,6 +40,7 @@ const OptimisticProposalVotesCard = ({
fetchCurrentDelegators: (proposalId: string) => void;
status: string;
}) => {
const { token } = Tenant.current();
const [isClicked, setIsClicked] = useState<boolean>(false);
const [showVoters, setShowVoters] = useState(true);
const handleClick = () => {
Expand Down Expand Up @@ -83,9 +85,9 @@ const OptimisticProposalVotesCard = ({

<p className="mt-1 font-normal text-secondary">
This proposal will automatically pass unless{" "}
{disapprovalThreshold}% of the votable supply of OP is
against. Currently {againstRelativeAmount}% (
{againstLengthString} OP) is against.
{disapprovalThreshold}% of the votable supply of{" "}
{token.symbol} is against. Currently {againstRelativeAmount}%
({againstLengthString} {token.symbol}) is against.
</p>
</div>
)}
Expand Down

0 comments on commit bbba84b

Please sign in to comment.