Skip to content

Commit

Permalink
♻️ Lint fix: Cleaned up code
Browse files Browse the repository at this point in the history
- Removed unused variables and imports
- Reordered import statements for better organization
- Simplified some expressions for readability
- Updated error messages to be more user-friendly
- Added necessary comments to suppress lint warnings
  • Loading branch information
Corantin committed Oct 18, 2024
1 parent c9141ea commit ca21da0
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 13 deletions.
1 change: 0 additions & 1 deletion apps/web/components/ActivatePoints.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ type ActiveMemberProps = {

export function ActivatePoints({
strategy,
communityAddress,
isMember,
isMemberActivated,
}: ActiveMemberProps) {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/CheckPassport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { Button } from "./Button";
import { Skeleton } from "./Skeleton";
import { Modal } from "@/components";
import { isProd } from "@/configs/isProd";
import { usePubSubContext } from "@/contexts/pubsub.context";
import { useChainIdFromPath } from "@/hooks/useChainIdFromPath";
import { useSubgraphQuery } from "@/hooks/useSubgraphQuery";
import { CV_PASSPORT_THRESHOLD_SCALE } from "@/utils/numbers";
import { usePubSubContext } from "@/contexts/pubsub.context";

type SubmitPassportResponse = {
data: any;
Expand Down
3 changes: 1 addition & 2 deletions apps/web/components/Forms/CommunityForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export const CommunityForm = ({

const { publish } = usePubSubContext();

const INPUT_TOKEN_MIN_VALUE = 1 / 10 ** tokenGarden.decimals;
const [showPreview, setShowPreview] = useState<boolean>(false);
const [previewData, setPreviewData] = useState<FormInputs>();
const [loading, setLoading] = useState(false);
Expand Down Expand Up @@ -261,7 +260,7 @@ export const CommunityForm = ({
registerOptions={{
min: {
value: 0,
message: `Amount must be greater than 0`,
message: "Amount must be greater than 0",
},
}}
suffix={tokenGarden.symbol}
Expand Down
9 changes: 2 additions & 7 deletions apps/web/components/Forms/ProposalForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import { FormInput } from "./FormInput";
import { FormPreview, FormRow } from "./FormPreview";
import { LoadingSpinner } from "../LoadingSpinner";
import { FormAddressInput } from "./FormAddressInput";
import { WalletBalance } from "../WalletBalance";
import { Button, EthAddress } from "@/components";
import { QUERY_PARAMS } from "@/constants/query-params";
Expand All @@ -26,8 +27,6 @@ import { abiWithErrors } from "@/utils/abi";
import { getEventFromReceipt } from "@/utils/contracts";
import { ipfsJsonUpload } from "@/utils/ipfsUtils";
import { formatTokenAmount } from "@/utils/numbers";
import { capitalize } from "@/utils/text";
import { FormAddressInput } from "./FormAddressInput";

//protocol : 1 => means ipfs!, to do some checks later
type FormInputs = {
Expand Down Expand Up @@ -74,8 +73,6 @@ const abiParameters = [
},
];

const ethereumAddressRegEx = /^(0x)?[0-9a-fA-F]{40}$/;

function formatNumber(num: string | number): string {
if (num == 0) {
return "0";
Expand Down Expand Up @@ -141,9 +138,7 @@ export const ProposalForm = ({
},
beneficiary: {
label: "Beneficiary:",
parse: (value: string) => (
<EthAddress address={value as Address}></EthAddress>
),
parse: (value: string) => <EthAddress address={value as Address} />,
},
proposalType: {
label: "Proposal Type:",
Expand Down
3 changes: 1 addition & 2 deletions apps/web/components/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { ReactNode, useEffect, useRef, useState } from "react";
import { ReactNode, useEffect, useRef } from "react";
import { XMarkIcon } from "@heroicons/react/24/outline";

interface ModalProps {
Expand Down Expand Up @@ -51,7 +51,6 @@ export function Modal({
return (
<dialog
className={`modal max-sm:modal-bottom ${className}`}
role="dialog"
ref={dialogRef}
>
<div className="modal-box max-w-5xl overflow-visible w-fit flex flex-col rounded-2xl bg-primary p-0">
Expand Down
1 change: 1 addition & 0 deletions apps/web/components/Skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const Skeleton = ({
.fill(0)
.map((_, i) => (
<div
// eslint-disable-next-line react/no-array-index-key
key={i}
className={`[--fallback-b3:#f0f0f0] skeleton h-5 w-full my-1 rounded-md ${className}`}
/>
Expand Down

0 comments on commit ca21da0

Please sign in to comment.