Skip to content

Commit

Permalink
replacing string with constants
Browse files Browse the repository at this point in the history
  • Loading branch information
VineetBala-AOT committed Feb 4, 2025
1 parent c92fc0a commit ff6e267
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion submit-web/src/components/Filters/SearchFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { InputAdornment, IconButton, TextField } from "@mui/material";
import { Search, Clear } from "@mui/icons-material";
import { useProjectFilters } from "./projectFilterStore";
import { BCDesignTokens } from "epic.theme";
import { USER_TYPE } from "@/models/User";

export const SearchFilter = ({userType}: {userType: string;}) => {
const { filters, setFilters } = useProjectFilters();
Expand All @@ -27,7 +28,8 @@ export const SearchFilter = ({userType}: {userType: string;}) => {
<TextField
fullWidth
variant="outlined"
placeholder={userType === "proponent"? "Search Submissions" : "Search Projects/Submissions by Name"}
placeholder={userType === USER_TYPE.PROPONENT
? "Search Submissions" : "Search Projects/Submissions by Name"}
value={searchText}
onChange={handleChange}
onKeyDown={handleKeyDown}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { notify } from "@/components/Shared/Snackbar/snackbarStore";
import { PageGrid } from "@/components/Shared/PageGrid";
import ProjectFilters from "@/components/Filters/ProjectFilters";
import { useProjectFilters } from "@/components/Filters/projectFilterStore";
import { USER_TYPE } from "@/models/User";

export const Route = createFileRoute(
"/proponent/_proponentLayout/projects/",
Expand Down Expand Up @@ -42,7 +43,7 @@ export function ProjectsPage() {
return (
<PageGrid>
<Grid item xs={12}>
<ProjectFilters userType='proponent'/>
<ProjectFilters userType={USER_TYPE.PROPONENT}/>
<If condition={isProjectsLoading}>
<Then>
<ProjectsSkeleton />
Expand Down
3 changes: 2 additions & 1 deletion submit-web/src/routes/staff/_staffLayout/projects/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Grid } from "@mui/material";
import { createFileRoute, Navigate } from "@tanstack/react-router";
import { useEffect } from "react";
import { Else, If, Then } from "react-if";
import { USER_TYPE } from "@/models/User";

export const Route = createFileRoute("/staff/_staffLayout/projects/")({
component: ProjectsPage,
Expand Down Expand Up @@ -37,7 +38,7 @@ function ProjectsPage() {
return (
<PageGrid>
<Grid item xs={12}>
<ProjectFilters userType='staff'/>
<ProjectFilters userType={USER_TYPE.STAFF}/>
<If condition={isProjectsLoading}>
<Then>
<ProjectsSkeleton />
Expand Down

0 comments on commit ff6e267

Please sign in to comment.