forked from Code-4-Community/scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 0
Search Bar Integration with ApplicationTable Component #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8877426
implemented the frontend ticket with bodie
ostepan8 4e969b1
Merge pull request #135 from Code-4-Community/backend-refactoring-pt2
SamNie2027 e3e013a
Merge branch 'main' into admin-prev-next-owen-and-bodie
SamNie2027 dc38509
Merge branch 'main' into admin-prev-next-owen-and-bodie
SamNie2027 3bcfa52
Searchbar integration with application table
bodhiYG af24543
Renamed TableSearchBar component and got rid of React.FC
bodhiYG 2a4e77f
Removed Unnecessary Files Fix
bodhiYG 1b267c4
Delete discplines.constants.ts
SamNie2027 cf5355b
Merge branch 'main' into bg-123-searchbar-functionality
SamNie2027 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { render } from '@testing-library/react'; | ||
|
|
||
| import App from './app'; | ||
|
|
||
| describe('App', () => { | ||
| it('should render successfully', () => { | ||
| const { baseElement } = render(<App />); | ||
| expect(baseElement).toBeTruthy(); | ||
| }); | ||
|
|
||
| it('should have a greeting as the title', () => { | ||
| const { getByText } = render(<App />); | ||
| expect(getByText(/Welcome frontend/gi)).toBeTruthy(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| import React from 'react'; | ||
| import { Box, Heading, Text, Flex } from '@chakra-ui/react'; | ||
|
|
||
| interface ApprovedCardProps { | ||
| title: string; | ||
| count: number; | ||
| description: string; | ||
| icon: React.ReactNode; | ||
| } | ||
|
|
||
| export function ApprovedCard({ | ||
| title, | ||
| count, | ||
| description, | ||
| icon, | ||
| }: ApprovedCardProps) { | ||
| return ( | ||
| <Box | ||
| borderWidth="2px" | ||
| borderColor="black" | ||
| borderRadius="16px" | ||
| padding="16px" | ||
| bg="white" | ||
| width="250px" | ||
| height="158px" | ||
| display="flex" | ||
| flexDirection="column" | ||
| > | ||
| <Flex | ||
| justifyContent="space-between" | ||
| alignItems="center" | ||
| mb="15px" | ||
| px="16px" | ||
| > | ||
| <Heading as="h3" size="md" fontWeight="600" color="#686868"> | ||
| {title} | ||
| </Heading> | ||
| <Flex | ||
| alignItems="center" | ||
| justifyContent="center" | ||
| width="24px" | ||
| height="24px" | ||
| borderRadius="full" | ||
| bg="#204AA0" | ||
| color="white" | ||
| > | ||
| {icon} | ||
| </Flex> | ||
| </Flex> | ||
| <Text | ||
| fontSize="32px" | ||
| fontWeight="600" | ||
| mb="15px" | ||
| color="#000000" | ||
| px="16px" | ||
| > | ||
| {count} | ||
| </Text> | ||
| <Text as="h4" fontWeight="600" color="#686868" px="16px"> | ||
| {description} | ||
| </Text> | ||
| </Box> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| interface PageCounterProps { | ||
| page: number; | ||
| setPage: (page: number) => void; | ||
| maxPages: number; | ||
| } | ||
|
|
||
| function PageCounter({ page, setPage, maxPages }: PageCounterProps) { | ||
| const getPageNumbers = () => { | ||
| const pages: (number | string)[] = []; | ||
|
|
||
| if (maxPages <= 4) { | ||
| // Show all pages if 4 or fewer | ||
| for (let i = 1; i <= maxPages; i++) { | ||
| pages.push(i); | ||
| } | ||
| } else { | ||
| // Always show first 3 pages when near the start | ||
| if (page <= 3) { | ||
| pages.push(1, 2, 3); | ||
| pages.push('...'); | ||
| pages.push(maxPages); | ||
| } | ||
| // Show last 3 pages when near the end | ||
| else if (page >= maxPages - 2) { | ||
| pages.push(1); | ||
| pages.push('...'); | ||
| pages.push(maxPages - 2, maxPages - 1, maxPages); | ||
| } | ||
| // Show current page with neighbors in the middle | ||
| else { | ||
| pages.push(1); | ||
| pages.push('...'); | ||
| pages.push(page - 1, page, page + 1); | ||
| pages.push('...'); | ||
| pages.push(maxPages); | ||
| } | ||
| } | ||
|
|
||
| return pages; | ||
| }; | ||
|
|
||
| return ( | ||
| <div style={{ display: 'flex', gap: '10px', alignItems: 'center' }}> | ||
| {getPageNumbers().map((p, index) => | ||
| typeof p === 'string' ? ( | ||
| <span | ||
| key={`ellipsis-${index}`} | ||
| style={{ | ||
| padding: '8px', | ||
| fontFamily: 'Lato, sans-serif', | ||
| fontSize: '14px', | ||
| fontWeight: 400, | ||
| lineHeight: '100%', | ||
| color: '#686868', | ||
| }} | ||
| > | ||
| {p} | ||
| </span> | ||
| ) : ( | ||
| <button | ||
| key={p} | ||
| onClick={() => setPage(p)} | ||
| style={{ | ||
| padding: '8px', | ||
| backgroundColor: '#F8F8F8', | ||
| color: '#686868', | ||
| border: '1px solid #686868', | ||
| borderRadius: '10px', | ||
| cursor: 'pointer', | ||
| fontFamily: 'Lato, sans-serif', | ||
| fontSize: '14px', | ||
| fontWeight: 400, | ||
| lineHeight: '100%', | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| justifyContent: 'center', | ||
| }} | ||
| > | ||
| {p} | ||
| </button> | ||
| ), | ||
| )} | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default PageCounter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import { IoChevronBack, IoChevronForward } from 'react-icons/io5'; | ||
|
|
||
| function PageTransitionButton({ | ||
| buttonType, | ||
| onClick, | ||
| }: { | ||
| buttonType: 'previous' | 'next'; | ||
| onClick: () => void; | ||
| }) { | ||
| return ( | ||
| <button | ||
| onClick={onClick} | ||
| style={{ | ||
| display: 'flex', | ||
| flexDirection: 'row', | ||
| alignItems: 'center', | ||
| gap: '10px', | ||
| padding: '8px', | ||
| backgroundColor: '#F8F8F8', | ||
| border: '1px solid #686868', | ||
| borderRadius: '10px', | ||
| cursor: 'pointer', | ||
| fontFamily: 'Lato, sans-serif', | ||
| fontSize: '14px', | ||
| fontWeight: 400, | ||
| lineHeight: '100%', | ||
| color: '#686868', | ||
| }} | ||
| > | ||
| {buttonType === 'previous' && ( | ||
| <IoChevronBack style={{ width: '14px', height: '14px' }} /> | ||
| )} | ||
| <span>{buttonType === 'previous' ? 'Previous' : 'Next'}</span> | ||
| {buttonType === 'next' && ( | ||
| <IoChevronForward style={{ width: '14px', height: '14px' }} /> | ||
| )} | ||
| </button> | ||
| ); | ||
| } | ||
|
|
||
| export default PageTransitionButton; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| import { IoSearch } from 'react-icons/io5'; | ||
|
|
||
| interface SearchbarProps { | ||
| value: string; | ||
| onChange: (e: React.ChangeEvent<HTMLInputElement>) => void; | ||
| } | ||
|
|
||
| function Searchbar({ value, onChange }: SearchbarProps) { | ||
| return ( | ||
| <div | ||
| style={{ | ||
| display: 'flex', | ||
| flexDirection: 'row', | ||
| alignItems: 'center', | ||
| width: '100%', | ||
| padding: '8px 16px', | ||
| gap: '10px', | ||
| backgroundColor: '#F8F8F8', | ||
| border: '1px solid #686868', | ||
| borderRadius: '10px', | ||
| }} | ||
| > | ||
| <input | ||
| type="text" | ||
| placeholder="Search applications by name, email" | ||
| value={value} | ||
| onChange={onChange} | ||
| style={{ | ||
| flex: 1, | ||
| border: 'none', | ||
| outline: 'none', | ||
| backgroundColor: 'transparent', | ||
| fontFamily: 'Lato, sans-serif', | ||
| fontSize: '14px', | ||
| fontWeight: 400, | ||
| lineHeight: '100%', | ||
| color: '#686868', | ||
| }} | ||
| /> | ||
| <IoSearch | ||
| style={{ | ||
| width: '24px', | ||
| height: '24px', | ||
| padding: '3px', | ||
| color: '#686868', | ||
| }} | ||
| /> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default Searchbar; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.