Skip to content

Commit

Permalink
fixed feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaitya2108 committed Jan 8, 2025
1 parent 5977c0a commit 69a908e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
8 changes: 1 addition & 7 deletions src/components/common/VerticalFormItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type VerticalFormProps = FormItemProps &
const VerticalFormItem = (props: VerticalFormProps) => {
const { icon, placeholder, formRegister, element, error, inputHeight } = props;
const { setValue } = useForm();
const [selectedOptions, setSelectedOptions] = useState<any[]>([]);
const [selectedOptions, setSelectedOptions] = useState<string[]>([]);
const [searchTerm, setSearchTerm] = useState('');

if (element === 'input') {
Expand Down Expand Up @@ -83,7 +83,6 @@ const VerticalFormItem = (props: VerticalFormProps) => {
}

if (element === 'select-multiple') {
// const { control, handleSubmit, setValue } = useForm();
const { options } = props;
const handleSelectionChange = (event: React.ChangeEvent<HTMLSelectElement>) => {
const selectedValues = Array.from(event.target.selectedOptions, option => option.value);
Expand Down Expand Up @@ -114,14 +113,9 @@ const VerticalFormItem = (props: VerticalFormProps) => {
lineHeight: inputHeight,
}}
multiple
// {...register('email', { required: 'At least one email must be selected' })}
{...formRegister}
onChange={handleSelectionChange}
// {...formRegister}
>
{/* <option value="" disabled>
{placeholder}
</option> */}
{filteredOptions.map(value => (
<option key={value}>{value}</option>
))}
Expand Down
1 change: 0 additions & 1 deletion src/pages/admin/attendance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { PublicEvent } from '@/lib/types/apiResponses';
interface FormValues {
email: string[];
event: string;
// points: number;
}
interface AwardPointsPageProps {
title: string;
Expand Down
1 change: 0 additions & 1 deletion src/pages/admin/points.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const AwardPointsPage: NextPage<AwardPointsPageProps> = ({
authToken,
sortedEmails,
}) => {
// const router = useRouter();
const {
register,
handleSubmit,
Expand Down

0 comments on commit 69a908e

Please sign in to comment.