Skip to content
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
14 changes: 12 additions & 2 deletions apps/dashboard/src/@/components/blocks/FormFieldSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { AsteriskIcon, InfoIcon } from "lucide-react";
import type React from "react";
import { Label } from "@/components/ui/label";
import { ToolTipLabel } from "@/components/ui/tooltip";
import { cn } from "../../lib/utils";

export function FormFieldSetup(props: {
htmlFor?: string;
Expand All @@ -10,13 +11,22 @@ export function FormFieldSetup(props: {
children: React.ReactNode;
tooltip?: React.ReactNode;
isRequired: boolean;
labelClassName?: string;
labelContainerClassName?: string;
helperText?: React.ReactNode;
className?: string;
}) {
return (
<div className={props.className}>
<div className="mb-2 inline-flex items-center gap-1">
<Label htmlFor={props.htmlFor}>{props.label}</Label>
<div
className={cn(
"mb-2 inline-flex items-center gap-1",
props.labelContainerClassName,
)}
>
<Label htmlFor={props.htmlFor} className={props.labelClassName}>
{props.label}
</Label>

{props.isRequired && (
<AsteriskIcon className="size-3.5 text-destructive-text" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type React from "react";
import { type Dispatch, type SetStateAction, useMemo } from "react";
import { CodeClient } from "@/components/ui/code/code.client";
import { TabButtons } from "@/components/ui/tabs";
import { cn } from "@/lib/utils";

export type CodeEnvironment =
| "javascript"
Expand Down Expand Up @@ -50,6 +51,7 @@ interface CodeSegmentProps {
isInstallCommand?: boolean;
hideTabs?: boolean;
onlyTabs?: boolean;
codeContainerClassName?: string;
}

export const CodeSegment: React.FC<CodeSegmentProps> = ({
Expand All @@ -59,6 +61,7 @@ export const CodeSegment: React.FC<CodeSegmentProps> = ({
isInstallCommand,
hideTabs,
onlyTabs,
codeContainerClassName,
}) => {
const activeEnvironment: CodeEnvironment = useMemo(() => {
return (
Expand Down Expand Up @@ -106,7 +109,10 @@ export const CodeSegment: React.FC<CodeSegmentProps> = ({

{onlyTabs ? null : (
<CodeClient
className="rounded-none border-none grow"
className={cn(
"rounded-none border-none grow",
codeContainerClassName,
)}
scrollableContainerClassName="h-full"
code={code}
lang={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ export default function ContractFunctionComment({
return null;
}
return (
<>
<p className="mt-6">
<div>
<h3 className="text-base font-semibold mt-6 mb-3">
About this function <Badge>Beta</Badge>
</p>
</h3>
<CodeClient
code={query.data}
copyButtonClassName="hidden"
lang="wikitext"
lang="solidity"
className="bg-background"
/>
</>
</div>
);
}
Loading
Loading