From 1ed824ab55a2b54c01dd1cbf8c2e752e368893c1 Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Thu, 2 Jan 2025 16:35:29 +0000 Subject: [PATCH 1/8] allow inputs to be rounded --- explorer-nextjs/src/components/input/Input.tsx | 12 +++++++++++- .../src/components/search/NodeAndAddressSearch.tsx | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/explorer-nextjs/src/components/input/Input.tsx b/explorer-nextjs/src/components/input/Input.tsx index 6c4cede926..5924c66cfe 100644 --- a/explorer-nextjs/src/components/input/Input.tsx +++ b/explorer-nextjs/src/components/input/Input.tsx @@ -1,13 +1,16 @@ -import { TextField } from "@mui/material"; +import { type SxProps, TextField } from "@mui/material"; const Input = ({ placeholder, fullWidth, value, + rounded = false, onChange, }: { placeholder?: string; fullWidth?: boolean; + rounded?: boolean; + sx?: SxProps; value: string; onChange: (event: React.ChangeEvent) => void; }) => { @@ -17,6 +20,13 @@ const Input = ({ fullWidth={fullWidth} value={value} onChange={onChange} + slotProps={{ + input: { + sx: { + borderRadius: rounded ? 10 : 2, + }, + }, + }} /> ); }; diff --git a/explorer-nextjs/src/components/search/NodeAndAddressSearch.tsx b/explorer-nextjs/src/components/search/NodeAndAddressSearch.tsx index 0df65de5c5..28e4c250f3 100644 --- a/explorer-nextjs/src/components/search/NodeAndAddressSearch.tsx +++ b/explorer-nextjs/src/components/search/NodeAndAddressSearch.tsx @@ -73,6 +73,7 @@ const NodeAndAddressSearch = () => { fullWidth value={inputValue} onChange={(e) => setInputValue(e.target.value)} + rounded />