Skip to content

Commit

Permalink
used boolstate and abbreviation
Browse files Browse the repository at this point in the history
  • Loading branch information
KartikChawla09 committed Jul 1, 2024
1 parent b995e54 commit 17f2590
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions web-server/src/components/Teams/CreateTeams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import {
Tooltip
} from '@mui/material';
import { useSnackbar } from 'notistack';
import { FC, useState } from 'react';
import { FC } from 'react';
import React from 'react';

import {
useTeamCRUD,
TeamsCRUDProvider
} from '@/components/Teams/useTeamsConfig';
import { useEasyState } from '@/hooks/useEasyState';
import { useBoolState, useEasyState } from '@/hooks/useEasyState';
import { BaseRepo } from '@/types/resources';

import AnimatedInputWrapper from '../AnimatedInputWrapper/AnimatedInputWrapper';
Expand Down Expand Up @@ -163,7 +163,7 @@ const TeamRepos: FC<{ hideCardComponents?: boolean }> = ({
} = useTeamCRUD();

const searchQuery = useEasyState('');
const [searchFocus, setSearchFocus] = useState(false);
const searchFocus = useBoolState(false);

return (
<FlexBox col gap={2}>
Expand Down Expand Up @@ -193,8 +193,8 @@ const TeamRepos: FC<{ hideCardComponents?: boolean }> = ({
getOptionLabel={(option) => `${option.parent}/${option.name}`}
renderInput={(params) => (
<TextField
onFocus={() => setSearchFocus(true)}
onBlur={() => setSearchFocus(false)}
onFocus={searchFocus.true}
onBlur={searchFocus.false}
onChange={(e) => {
handleReposSearch(e as React.ChangeEvent<HTMLInputElement>);
searchQuery.set(e.target.value);
Expand All @@ -203,10 +203,10 @@ const TeamRepos: FC<{ hideCardComponents?: boolean }> = ({
label={
selectedRepos.length ? (
`${selectedRepos.length} selected`
) : !searchFocus ? (
) : !searchFocus.value ? (
<AnimatedInputWrapper />
) : (
'Search for organization/repo'
'Search for org/repo'
)
}
error={teamRepoError}
Expand Down

0 comments on commit 17f2590

Please sign in to comment.