diff --git a/frontend/src/components/Teams/CreateTeam/ListMembersDialog/SearchInput.tsx b/frontend/src/components/Teams/CreateTeam/ListMembersDialog/SearchInput.tsx index 4c4598c00..c07105d60 100644 --- a/frontend/src/components/Teams/CreateTeam/ListMembersDialog/SearchInput.tsx +++ b/frontend/src/components/Teams/CreateTeam/ListMembersDialog/SearchInput.tsx @@ -8,10 +8,11 @@ interface InputProps { id: string; placeholder: string; icon?: 'search'; - iconPosition?: 'left' | 'right'; + iconPosition?: 'left' | 'right' | 'both'; disabled?: boolean; currentValue?: string; handleChange?: (event: React.ChangeEvent) => void; + handleClear?: () => void; } const SearchInput: React.FC = ({ @@ -22,6 +23,7 @@ const SearchInput: React.FC = ({ disabled, currentValue, handleChange, + handleClear, }) => { SearchInput.defaultProps = { iconPosition: undefined, @@ -37,13 +39,14 @@ const SearchInput: React.FC = ({ direction="column" > {!!icon && ( - + {icon === 'search' && ( )} @@ -64,6 +67,29 @@ const SearchInput: React.FC = ({ {placeholder} + + + ); }; diff --git a/frontend/src/components/Teams/CreateTeam/ListMembersDialog/index.tsx b/frontend/src/components/Teams/CreateTeam/ListMembersDialog/index.tsx index ce79c57ad..43b01d8f5 100644 --- a/frontend/src/components/Teams/CreateTeam/ListMembersDialog/index.tsx +++ b/frontend/src/components/Teams/CreateTeam/ListMembersDialog/index.tsx @@ -73,6 +73,10 @@ const ListMembersDialog = React.memo( setSearchMember(event.target.value); }; + const handleClearSearch = () => { + setSearchMember(''); + }; + const handleChecked = (id: string) => { const updateCheckedUsers = usersChecked.map((user) => user._id === id ? { ...user, isChecked: !user.isChecked } : user, @@ -137,8 +141,9 @@ const ListMembersDialog = React.memo( diff --git a/frontend/src/components/Teams/CreateTeam/ListMembersDialog/styles.tsx b/frontend/src/components/Teams/CreateTeam/ListMembersDialog/styles.tsx index 268d56308..aa971238f 100644 --- a/frontend/src/components/Teams/CreateTeam/ListMembersDialog/styles.tsx +++ b/frontend/src/components/Teams/CreateTeam/ListMembersDialog/styles.tsx @@ -36,6 +36,9 @@ const PlaceholderText = styled(Text, { '&[data-iconposition="right"]': { pl: '$17', }, + '&[data-iconposition="both"]': { + pl: '$57', + }, }); const IconWrapper = styled(Flex, { @@ -50,6 +53,9 @@ const IconWrapper = styled(Flex, { '&[data-iconposition="right"]': { right: '$16', }, + '&[data-iconposition="both"]': { + left: '$16', + }, '&[data-type="password"]': { '&:hover': { cursor: 'pointer', @@ -174,6 +180,10 @@ const StyledInput = styled('input', { '&[data-iconposition="right"]': { pr: '$56', }, + + '&[data-iconposition="both"]': { + px: '$56', + }, }); export { ButtonAddMember, IconWrapper, PlaceholderText, ScrollableContent, StyledInput }; diff --git a/frontend/src/components/Users/UserEdit/partials/TeamsDialog/index.tsx b/frontend/src/components/Users/UserEdit/partials/TeamsDialog/index.tsx index a96242a3d..397282fa6 100644 --- a/frontend/src/components/Users/UserEdit/partials/TeamsDialog/index.tsx +++ b/frontend/src/components/Users/UserEdit/partials/TeamsDialog/index.tsx @@ -12,7 +12,7 @@ import { TeamChecked, Team } from '@/types/team/team'; import isEmpty from '@/utils/isEmpty'; import Dialog from '@/components/Primitives/Dialog'; import { useQueryClient } from '@tanstack/react-query'; -import SearchInput from './SearchInput'; +import SearchInput from '@/components/Teams/CreateTeam/ListMembersDialog/SearchInput'; import { ScrollableContent } from './styles'; type Props = { @@ -49,6 +49,10 @@ const ListTeams = ({ isOpen, setIsOpen, providerAccountCreatedAt, joinedAt }: Pr setSearchTeam(event.target.value); }; + const handleClearSearch = () => { + setSearchTeam(''); + }; + const handleChecked = (id: string) => { teamsUserIsNotMember = teamsUserIsNotMember.map((team) => team._id === id ? { ...team, isChecked: !team.isChecked } : team, @@ -91,8 +95,9 @@ const ListTeams = ({ isOpen, setIsOpen, providerAccountCreatedAt, joinedAt }: Pr diff --git a/frontend/src/components/Users/UsersList/partials/ListOfCards/index.tsx b/frontend/src/components/Users/UsersList/partials/ListOfCards/index.tsx index 3d69a22bf..1e5e3777d 100644 --- a/frontend/src/components/Users/UsersList/partials/ListOfCards/index.tsx +++ b/frontend/src/components/Users/UsersList/partials/ListOfCards/index.tsx @@ -70,6 +70,10 @@ const ListOfCards = React.memo(() => { setSearch(event.target.value); }; + const handleClearSearch = () => { + setSearch(''); + }; + useEffect(() => { const timer = setTimeout(() => { fetchUsers.refetch(); @@ -87,11 +91,12 @@ const ListOfCards = React.memo(() => {