Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
camdnnn committed Jan 20, 2025
1 parent 7327c4b commit daca726
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
4 changes: 0 additions & 4 deletions front-end/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import MapChart from './map/MapChart/MapChart';
import cx from 'classnames';
import ModelViewer from './model/ModelViewer';

import TextField from './textfield/TextField';

const App = () => {
const location = useLocation();

Expand Down Expand Up @@ -47,8 +45,6 @@ const App = () => {
return () => clearTimeout(timer);
}, [successMessage]);

const [value, setValue] = useState('');

return (
<div className={styles.App}>
{location.pathname !== '/' && (
Expand Down
15 changes: 5 additions & 10 deletions front-end/src/components/textfield/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,19 @@ import styles from './TextField.module.scss';

interface TextFieldProps {
title: string;
value: string;
setValue: (value: string) => void;
label?: string;
placeholder?: string;
defaultValue?: string;
value?: string;
onChange?: (value: string) => void;
}

const TextField = ({
title,
value,
setValue,
label,
placeholder,
value,
onChange,
}: TextFieldProps) => {
const handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {
if (onChange) onChange(e.target.value);
};

return (
<div className={styles.textField}>
{label && <div className={styles.label}>{label}</div>}
Expand All @@ -32,7 +27,7 @@ const TextField = ({
type="text"
placeholder={placeholder}
value={value}
onChange={handleOnChange}
onChange={(e) => setValue(e.target.value)}
/>
</div>
</div>
Expand Down

0 comments on commit daca726

Please sign in to comment.