Skip to content

Commit

Permalink
resolved sonarcloud issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulg1254 committed Jul 30, 2024
1 parent f2c0a5c commit 94d4b44
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/layouts/header/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import SearchIcon from "@mui/icons-material/Search";
import { IconButton, InputBase, Paper, useMediaQuery } from "@mui/material";
import { styled } from "@mui/system";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";

interface SearchBarProps {
onSearch: (keyword: string) => void;
Expand All @@ -27,6 +28,7 @@ const StyledInputBase = styled(InputBase)(({ theme }) => ({

const SearchBar: React.FC<SearchBarProps> = ({ onSearch, placeholder }) => {
const [keyword, setKeyword] = useState("");
const { t } = useTranslation();
const isSmallScreen = useMediaQuery((theme: any) =>
theme.breakpoints.down("sm")
);
Expand All @@ -51,7 +53,7 @@ const SearchBar: React.FC<SearchBarProps> = ({ onSearch, placeholder }) => {
return (
<SearchBox>
<StyledInputBase
placeholder={isSmallScreen ? placeholder : placeholder}
placeholder={isSmallScreen ? placeholder : t("COURSE_PLANNER.SEARCH")}
value={keyword}
onChange={handleInputChange}
onKeyPress={handleKeyPress}
Expand Down

0 comments on commit 94d4b44

Please sign in to comment.