FixedFloatButton.tsx raw

   1  import * as React from "react";
   2  import { ExternalLinkButton } from "src/components/ui/custom/external-link-button";
   3  
   4  type FixedFloatButtonProps = Omit<
   5    React.ComponentProps<typeof ExternalLinkButton>,
   6    "to"
   7  > & {
   8    address?: string;
   9    from?: string;
  10    to?: string;
  11  };
  12  
  13  export function FixedFloatButton({
  14    address,
  15    from,
  16    to,
  17    ...props
  18  }: FixedFloatButtonProps) {
  19    const params = new URLSearchParams({
  20      ref: "qnnjvywb",
  21    });
  22    if (from) {
  23      params.set("from", from);
  24    }
  25    if (to) {
  26      params.set("to", to);
  27    }
  28    if (address) {
  29      params.set("address", address);
  30    }
  31  
  32    return (
  33      <ExternalLinkButton to={`https://ff.io/?${params.toString()}`} {...props} />
  34    );
  35  }
  36