Skip to content

Commit

Permalink
Merge pull request #357 from Rushikesh-Sonawane99/shiksha-2.0
Browse files Browse the repository at this point in the history
Issue #PS-000 chore: Fixed UI Issue and added toast message
  • Loading branch information
itsvick authored Jul 5, 2024
2 parents af60f92 + 0642d1d commit 7752d5e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/components/CohortSelectionSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { useTheme } from '@mui/material/styles';
import { useTranslation } from 'next-i18next';
import Loader from './Loader';
import { cohortHierarchy } from '@/utils/app.constant';
import { showToastMessage } from './Toastify';

interface CohortSelectionSectionProps {
classId: string;
Expand Down Expand Up @@ -151,6 +152,7 @@ const CohortSelectionSection: React.FC<CohortSelectionSectionProps> = ({
} catch (error) {
console.error('Error fetching cohort list', error);
setLoading(false);
showToastMessage(t('COMMON.SOMETHING_WENT_WRONG'), 'error');
}
};

Expand Down
7 changes: 4 additions & 3 deletions src/pages/blocks/centre.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
} from '@mui/icons-material';
import AddIcon from '@mui/icons-material/Add';
import FilterModalCenter from './components/FilterModalCenter';
import { toPascalCase } from '@/utils/Helper';

interface BlocksProps {
// Define any props if needed
Expand Down Expand Up @@ -110,10 +111,10 @@ const Blocks: React.FC<BlocksProps> = () => {

useEffect(() => {
const storedDistrict = localStorage.getItem('selectedBlockDistrict') || '';
setDistrict(storedDistrict);
setDistrict(toPascalCase(storedDistrict));

const storedBlock = localStorage.getItem('selectedBlock') || '';
setBlocks(storedBlock);
setBlocks(toPascalCase(storedBlock));
}, []);

useEffect(() => {
Expand Down Expand Up @@ -142,7 +143,7 @@ const Blocks: React.FC<BlocksProps> = () => {
fontWeight={'500'}
color={theme?.palette?.text?.primary}
>
{districts}, {state}
{districts}, {toPascalCase(state)}
</Typography>
<Box display={'flex'} alignItems={'center'} mb={2}>
<TextField
Expand Down
3 changes: 2 additions & 1 deletion src/pages/centers/[cohortId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import { useRouter } from 'next/router';
import { useTheme } from '@mui/material/styles';
import { useTranslation } from 'next-i18next';
import { toPascalCase } from '@/utils/Helper';

const TeachingCenterDetails = () => {
const [value, setValue] = React.useState(1);
Expand Down Expand Up @@ -46,7 +47,7 @@ const TeachingCenterDetails = () => {
(item: CustomField) => item.label === 'State'
);

cohortData.address = `${district?.value}, ${state?.value}` || '';
cohortData.address = `${toPascalCase(district?.value)}, ${toPascalCase(state?.value)}` || '';
}
setCohortDetails(cohortData);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/centers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ const TeachingCenters = () => {
<Box>
<TextField
className="input_search"
placeholder={t('COMMON.SEARCH_FACILITATORS')}
placeholder={t('COMMON.SEARCH')}
color="secondary"
focused
sx={{
Expand Down

0 comments on commit 7752d5e

Please sign in to comment.