Skip to content

Commit

Permalink
Issue #PS-1094 feat: Implement search and filter functionality for Bl…
Browse files Browse the repository at this point in the history
…ock and center list (comment fixes)
  • Loading branch information
Aar-if committed Jun 27, 2024
1 parent 6a7fb71 commit 398a495
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 42 deletions.
7 changes: 1 addition & 6 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,10 @@
"BLOCKS": {
"TEACHING_BLOCKS": "Teaching Blocks",
"SEARCH" : "Search..",
"FILTERS": "Filters",
"CREATE_NEW": "Create New",
"NEW_BLOCK": "New Block",
"BLOCK_NAME": "Block Name",
"CREATE": "Create",
"NAMES": "Names",
"A_TO_Z": "A to Z",
"Z_TO_A": "Z to A",
"SEARCH_BLOCKS": "Search Blocks",
"APPLY": "Apply"
"SEARCH_BLOCKS": "Search Blocks"
}
}
7 changes: 1 addition & 6 deletions public/locales/hi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,16 +237,11 @@
"BLOCKS": {
"TEACHING_BLOCKS": "शिक्षण ब्लॉक्स",
"SEARCH" : "खोजें..",
"FILTERS":"फिल्टर्स",
"CREATE_NEW": "नया निर्माण",
"NEW_BLOCK": "नया ब्लॉक",
"BLOCK_NAME": "ब्लॉक का नाम",
"CREATE": "बनाएँ",
"NAMES": "नाम",
"A_TO_Z": " ए से जेड तक",
"Z_TO_A": "जेड से ए तक",
"SEARCH_BLOCKS": "ब्लॉक खोजें",
"APPLY": "लागू करें"
"SEARCH_BLOCKS": "ब्लॉक खोजें"

}
}
10 changes: 4 additions & 6 deletions public/locales/mr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,13 @@
"BLOCKS": {
"TEACHING_BLOCKS": "शिक्षण ब्लॉक्स",
"SEARCH" : "शोधा..",
"FILTERS": "फिल्टर्स",

"CREATE_NEW": "नवीन तयार करा",
"NEW_BLOCK": "नवीन ब्लॉक",
"BLOCK_NAME": "ब्लॉकचं नाव",
"CREATE": "तयार करा",
"NAMES": "नावे",
"A_TO_Z": "ए ते झेड",
"Z_TO_A": "झेड ते ए",
"SEARCH_BLOCKS": "ब्लॉक शोधा",
"APPLY": "लागू करा"

"SEARCH_BLOCKS": "ब्लॉक शोधा"

}
}
8 changes: 2 additions & 6 deletions public/locales/or/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,11 @@
"BLOCKS": {
"TEACHING_BLOCKS": "ଶିକ୍ଷା ବ୍ଲକ୍ସ",
"SEARCH" : "ସନ୍ଧାନ କରନ୍ତୁ..",
"FILTERS": "ଫିଲ୍ଟର୍ସ",
"CREATE_NEW": "ନୂତନ ସୃଷ୍ଟି କରନ୍ତୁ",
"NEW_BLOCK": "ନୂଆ ବ୍ଲକ୍",
"BLOCK_NAME": "ବ୍ଲକ୍ ନାମ",
"CREATE": "ତିଆରି କରନ୍ତୁ",
"NAMES": "ନାମ",
"A_TO_Z": "ଏ ସେ ଜେଡ଼",
"Z_TO_A": "ଜେଡ଼ ସେ ଏ",
"SEARCH_BLOCKS": "ବ୍ଲକ୍‌ ଖୋଜନ୍ତୁ",
"APPLY": "ପ୍ରୟୋଗ କରନ୍ତୁ"

"SEARCH_BLOCKS": "ବ୍ଲକ୍‌ ଖୋଜନ୍ତୁ"
}
}
2 changes: 1 addition & 1 deletion src/pages/blocks/components/CreateBlockModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const CreateBlockModal: React.FC<CreateBlockModalProps> = ({
sx={{
width: '100%',
border: 'none',
backgroundColor: '#FDBE16',
backgroundColor: theme?.palette?.primary?.main,
mb: 2,
}}
>
Expand Down
15 changes: 8 additions & 7 deletions src/pages/blocks/components/FilterModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ const FilterModal: React.FC<FilterModalProps> = ({
variant="h3"
mt={2}
>
{t('BLOCKS.FILTERS')}
{t('COMMON.FILTERS')}
</Typography>
<IconButton onClick={handleClose}>
<Close />
</IconButton>
</Box>
<Divider sx={{ mb: 2, mx: -2 }} />
<Typography fontSize="12px" variant="subtitle1">
{t('BLOCKS.NAMES')}
{t('COMMON.NAMES')}
</Typography>
<RadioGroup
value={sortOrder}
Expand All @@ -118,7 +118,7 @@ const FilterModal: React.FC<FilterModalProps> = ({
}
className="modal_label"
labelPlacement="start"
label={t('BLOCKS.A_TO_Z')}
label={t('COMMON.A_TO_Z')}
/>
<FormControlLabel
sx={{ justifyContent: 'space-between' }}
Expand All @@ -135,18 +135,19 @@ const FilterModal: React.FC<FilterModalProps> = ({
}
className="modal_label"
labelPlacement="start"
label={t('BLOCKS.Z_TO_A')}
label={t('COMMON.Z_TO_A')}
/>
</RadioGroup>
<Divider sx={{ mt: 2, mx: -2 }} />
<Button
variant="contained"
variant="outlined"
color="primary"
fullWidth
onClick={handleApplyClick}
sx={{ mt: 2 }}
sx={{ mt: 2, border: 'none',
backgroundColor: theme?.palette?.primary?.main }}
>
{t('BLOCKS.APPLY')}
{t('COMMON.APPLY')}
</Button>
</Box>
</Fade>
Expand Down
13 changes: 3 additions & 10 deletions src/pages/blocks/[district].tsx → src/pages/blocks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Search from '@mui/icons-material/Search';
import { ArrowDropDown, KeyboardArrowRight } from '@mui/icons-material';
import AddIcon from '@mui/icons-material/Add';
import { useRouter } from 'next/router';
import { GetStaticPaths } from 'next';

import CreateBlockModal from './components/CreateBlockModal';
import FilterModal from './components/FilterModal';

Expand All @@ -26,7 +26,7 @@ const Blocks: React.FC<BlocksProps> = () => {
const { t } = useTranslation();
const theme = useTheme<any>();
const router = useRouter();
const { district } = router.query;
const district = 'Nagpur';

const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
const [openModal, setOpenModal] = useState(false); // State for modal
Expand Down Expand Up @@ -158,7 +158,7 @@ const Blocks: React.FC<BlocksProps> = () => {
fontWeight: '500',
}}
>
{t('BLOCKS.FILTERS')}
{t('COMMON.FILTERS')}
</Button>
</Box>
<Button
Expand Down Expand Up @@ -225,13 +225,6 @@ const Blocks: React.FC<BlocksProps> = () => {
);
};

export const getStaticPaths: GetStaticPaths<{ slug: string }> = async () => {
return {
paths: [],
fallback: 'blocking',
};
};

export async function getStaticProps({ locale }: any) {
return {
props: {
Expand Down

0 comments on commit 398a495

Please sign in to comment.