Skip to content

Commit cdebb84

Browse files
dms120iamalwaysuncomfortable
authored andcommitted
feat: improve alignment
1 parent dfe3506 commit cdebb84

1 file changed

Lines changed: 41 additions & 39 deletions

File tree

examples/react-app/src/components/functions/ExecuteTransaction.tsx

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
} from '@/lib/dispatchPrograms';
2626
import { programIdToField } from '@/lib/programIdField';
2727
import { DispatchPrepPanel } from './DispatchPrepPanel';
28+
import { Switch } from '../ui/switch';
2829

2930
export function ExecuteTransaction() {
3031
const {
@@ -383,9 +384,44 @@ export function ExecuteTransaction() {
383384
<section className="space-y-4">
384385
<div className="space-y-4">
385386
<div className="space-y-2">
386-
<Label htmlFor="program" className="transition-colors duration-300">
387-
Program ID
388-
</Label>
387+
<div className="flex justify-between items-center gap-2">
388+
<Label htmlFor="program" className="transition-colors duration-300">
389+
Program ID
390+
</Label>
391+
<div className="flex items-center gap-2">
392+
<Switch
393+
className="scale-80"
394+
id="filterToDispatch2"
395+
checked={filterToDispatch}
396+
onCheckedChange={(checked: boolean) => setFilterToDispatch(checked)}
397+
/>
398+
<Label htmlFor="filterToDispatch" className="label-xs normal-case">
399+
Dynamic dispatch programs
400+
</Label>
401+
<TooltipProvider>
402+
<Tooltip>
403+
<TooltipTrigger asChild>
404+
<button
405+
type="button"
406+
className="text-muted-foreground hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm"
407+
aria-label="What is dynamic dispatch?"
408+
>
409+
<HelpCircle className="h-4 w-4" />
410+
</button>
411+
</TooltipTrigger>
412+
<TooltipContent className="max-w-xs">
413+
<p className="body-s">
414+
Dynamic dispatch in Aleo (via <code>call.dynamic</code>) lets an Aleo program
415+
function call a function on ANY other Aleo program if the function has the
416+
same name, inputs and outputs. This is similar to interfaces in Ethereum and
417+
enables ERC20-like functionality in Aleo. Toggle this on to filter for
418+
programs that use dynamic dispatch.
419+
</p>
420+
</TooltipContent>
421+
</Tooltip>
422+
</TooltipProvider>
423+
</div>
424+
</div>
389425
<div className="flex gap-2">
390426
<div className="flex-1">
391427
<ProgramAutocomplete
@@ -419,40 +455,6 @@ export function ExecuteTransaction() {
419455
</span>
420456
</div>
421457
)}
422-
<div className="flex items-center gap-2">
423-
<input
424-
type="checkbox"
425-
id="filterToDispatch"
426-
checked={filterToDispatch}
427-
onChange={e => setFilterToDispatch(e.target.checked)}
428-
className="rounded border-input"
429-
/>
430-
<Label htmlFor="filterToDispatch" className="text-sm">
431-
Dynamic dispatch programs
432-
</Label>
433-
<TooltipProvider>
434-
<Tooltip>
435-
<TooltipTrigger asChild>
436-
<button
437-
type="button"
438-
className="text-muted-foreground hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm"
439-
aria-label="What is dynamic dispatch?"
440-
>
441-
<HelpCircle className="h-4 w-4" />
442-
</button>
443-
</TooltipTrigger>
444-
<TooltipContent className="max-w-xs">
445-
<p className="body-s">
446-
Dynamic dispatch in Aleo (via <code>call.dynamic</code>) lets an Aleo program
447-
function call a function on ANY other Aleo program if the function has the same
448-
name, inputs and outputs. This is similar to interfaces in Ethereum and enables
449-
ERC20-like functionality in Aleo. Toggle this on to filter for programs that use
450-
dynamic dispatch.
451-
</p>
452-
</TooltipContent>
453-
</Tooltip>
454-
</TooltipProvider>
455-
</div>
456458
</div>
457459

458460
{knownDispatchProgram && !dispatchAlertDismissed && (
@@ -486,7 +488,7 @@ export function ExecuteTransaction() {
486488
<DispatchPrepPanel entry={knownDispatchProgram} />
487489
)}
488490

489-
<div className="space-y-2">
491+
<div className="space-y-2 mb-6">
490492
<Label htmlFor="functionName" className="transition-colors duration-300">
491493
Function Name
492494
</Label>
@@ -504,7 +506,7 @@ export function ExecuteTransaction() {
504506
placeholder="Enter function name"
505507
/>
506508
</div>
507-
<div className="space-y-2">
509+
<div className="space-y-2 mb-6">
508510
<div className="flex items-center justify-between">
509511
<Label htmlFor="inputs" className="transition-colors duration-300">
510512
Inputs

0 commit comments

Comments
 (0)