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

remove custom Spinner component #669

Merged
merged 2 commits into from
Dec 21, 2023
Merged
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
23 changes: 0 additions & 23 deletions packages/nextjs/components/assets/Spinner.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useReducer } from "react";
import { ContractReadMethods } from "./ContractReadMethods";
import { ContractVariables } from "./ContractVariables";
import { ContractWriteMethods } from "./ContractWriteMethods";
import { Spinner } from "~~/components/assets/Spinner";
import { Address, Balance } from "~~/components/scaffold-eth";
import { useDeployedContractInfo, useNetworkColor } from "~~/hooks/scaffold-eth";
import { useTargetNetwork } from "~~/hooks/scaffold-eth/useTargetNetwork";
Expand All @@ -25,7 +24,7 @@ export const ContractUI = ({ contractName, className = "" }: ContractUIProps) =>
if (deployedContractLoading) {
return (
<div className="mt-14">
<Spinner width="50px" height="50px" />
<span className="loading loading-spinner loading-lg"></span>
</div>
);
}
Expand Down
5 changes: 2 additions & 3 deletions packages/nextjs/utils/scaffold-eth/notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
ExclamationTriangleIcon,
InformationCircleIcon,
} from "@heroicons/react/24/solid";
import { Spinner } from "~~/components/assets/Spinner";

type NotificationProps = {
content: React.ReactNode;
Expand All @@ -25,7 +24,7 @@ type NotificationOptions = {

const ENUM_STATUSES = {
success: <CheckCircleIcon className="w-7 text-success" />,
loading: <Spinner />,
loading: <span className="w-6 loading loading-spinner"></span>,
error: <ExclamationCircleIcon className="w-7 text-error" />,
info: <InformationCircleIcon className="w-7 text-info" />,
warning: <ExclamationTriangleIcon className="w-7 text-warning" />,
Expand Down Expand Up @@ -54,7 +53,7 @@ const Notification = ({
: `hover:-translate-y-1 ${t.visible ? "bottom-0" : "-bottom-96"}`
}`}
>
<div className="text-2xl self-start">{icon ? icon : ENUM_STATUSES[status]}</div>
<div className="leading-[0] self-center">{icon ? icon : ENUM_STATUSES[status]}</div>
<div className={`overflow-x-hidden break-words whitespace-pre-line ${icon ? "mt-1" : ""}`}>{content}</div>

<div className={`cursor-pointer text-lg ${icon ? "mt-1" : ""}`} onClick={() => toast.dismiss(t.id)}>
Expand Down