-
Notifications
You must be signed in to change notification settings - Fork 1
Create/Implement Icon Registry, Create/Update API search page #42
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
Conversation
…IconName for icon prop and improve code consistency
…g consistency and maintainability
…r icon props, enhancing consistency and maintainability across the application
…onality; update existing search route with comments for clarity
…ayout structure; integrate Icon component for consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces a centralized icon registry system and refactors icon usage throughout the application. The changes aim to standardize how icons are referenced and rendered across pages and components, moving from direct component imports to a string-based registry lookup system.
Changes:
- Created a new icon registry system with a centralized
Iconcomponent that uses string-based icon names instead of direct component references - Refactored multiple data files and components to use the new
IconNametype instead ofReact.ComponentTypeorReactNode - Updated Contact, Services, and Home pages to use the new
Iconcomponent - Added experimental optimization for Chakra UI package imports in Next.js config
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| next.config.ts | Adds experimental package import optimization for Chakra UI |
| data/services.ts | Updates icon references from component imports to string-based IconName type |
| data/get-involved.tsx | Refactors icon type from ReactNode to IconName |
| data/empowerment.tsx | Changes icon type to use string-based IconName |
| data/contact.tsx | Updates SocialLink interface to use IconName for platform field |
| components/ui/icons/index.ts | Changes from named exports to direct re-exports of React Icons |
| components/ui/icons/icon.tsx | Creates new Icon wrapper component for centralized icon rendering |
| components/ui/icons/icon-registry.tsx | Establishes centralized icon registry mapping string names to components |
| components/services/support-card.tsx | Updates to use new Icon component with name prop |
| components/services/service-card.tsx | Refactors to use Icon component and adds Chakra UI Card styling |
| components/services/faq-item.tsx | Updates to use Icon component for Plus/Minus icons |
| components/home/feature-card.tsx | Changes icon prop type to IconName and uses Icon component |
| components/common/iconbutton.tsx | Adds new (unused) IconButton component |
| components/common/footer.tsx | Updates all icon usage to new Icon component with string names |
| app/page.tsx | Refactors to use Icon component for ArrowRight icons |
| app/(Pages)/services/page.tsx | Adds SimpleGrid for responsive layout and removes duplicate sections |
| app/(Pages)/contact/page.tsx | Updates to use Icon component for social links and adds IconButton usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
components/services/service-card.tsx
Outdated
| top={255} | ||
| /> | ||
| <Heading as={"h4"}>{title}</Heading> | ||
| <h4>{title}</h4> |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate title rendering. The title is rendered twice on consecutive lines - once as a Chakra UI Heading component and once as a plain h4 element. Remove the duplicate h4 element on line 40.
| <h4>{title}</h4> |
app/(Pages)/contact/page.tsx
Outdated
|
|
||
| <Icon name={link.platform} size={10} /> |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate Icon components. The same icon is rendered twice on consecutive lines (82 and 84) within the IconButton. Remove the duplicate Icon on line 84.
| <Icon name={link.platform} size={10} /> |
app/(Pages)/contact/page.tsx
Outdated
| <div> | ||
| {socialLinks.map((link) => ( | ||
| <a | ||
| key={link.platform} | ||
| href={link.url} | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| aria-label={`Visit our ${link.platform} page`} | ||
| > | ||
| <Icon name={link.platform} size={10} /> | ||
| <span>{link.platform}</span> | ||
| </a> | ||
| ))} | ||
| </div> |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate social links sections. The social links are rendered in two separate sections (lines 50-63 and lines 64-89) with different styling but the same content. This appears to be leftover code from refactoring. Remove the duplicate section that is not intended to be displayed.
| <div> | |
| {socialLinks.map((link) => ( | |
| <a | |
| key={link.platform} | |
| href={link.url} | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| aria-label={`Visit our ${link.platform} page`} | |
| > | |
| <Icon name={link.platform} size={10} /> | |
| <span>{link.platform}</span> | |
| </a> | |
| ))} | |
| </div> |
components/common/iconbutton.tsx
Outdated
| //Create a reusable IconButton component that takes in link, platform, url, and icon as props and renders an anchor tag with the provided icon. | ||
| // & React.ComponentProps<typeof ChakraIcon> | ||
|
|
||
| export default function IconButton({ | ||
| link, | ||
| platform, | ||
| url, | ||
| icon, | ||
| }: { | ||
| link: string; | ||
| platform: string; | ||
| url: string; | ||
| icon: React.ReactNode; | ||
| }) { |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused component and parameter. This IconButton component is never imported or used anywhere in the codebase. Additionally, the link parameter in the function signature is defined but never used in the component body. Either remove this entire file if it's not needed, or remove the unused link parameter if the component will be used in the future.
| import { Icon as ChakraIcon } from "@chakra-ui/react"; | ||
|
|
||
| export type IconName = keyof typeof iconRegistry; | ||
|
|
||
| type IconProps = { | ||
| name: IconName; | ||
| size?: number; | ||
| color?: string; | ||
| } & React.ComponentProps<typeof ChakraIcon>; |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate type export. The IconName type is exported in both icon.tsx (line 5) and icon-registry.tsx (line 30). This creates a duplicate export that could lead to confusion. Remove the export from icon.tsx and import it from icon-registry.tsx instead to maintain a single source of truth.
| import { Icon as ChakraIcon } from "@chakra-ui/react"; | |
| export type IconName = keyof typeof iconRegistry; | |
| type IconProps = { | |
| name: IconName; | |
| size?: number; | |
| color?: string; | |
| } & React.ComponentProps<typeof ChakraIcon>; | |
| import type { IconName } from "./icon-registry"; | |
| import { Icon as ChakraIcon } from "@chakra-ui/react"; | |
| type IconProps = { | |
| name: IconName; | |
| size?: number; | |
| color?: string; | |
| } & React.ComponentProps<typeof ChakraIcon>; |
…e; update social links rendering and integrate Chakra UI components for consistency; enhance resource data structure in JSON; update dependencies to latest versions.
…ce form submission feedback with toaster notifications; improve layout and reset functionality.
… Chakra UI integration; remove old Search component for improved structure and maintainability.
…ion; integrate team member cards and enhance layout with Chakra UI components.
|
@copilot re-review |
|
@BorDevTech I've opened a new pull request, #43, to work on those changes. Once the pull request is ready, I'll request review from you. |
[WIP] Implement icon registry and update API search page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 27 out of 33 changed files in this pull request and generated 17 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
components/ui/icons/icon.tsx
Outdated
| import { iconRegistry } from "./icon-registry"; | ||
| import { Icon as ChakraIcon } from "@chakra-ui/react"; | ||
|
|
||
| export type IconName = keyof typeof iconRegistry; | ||
|
|
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type IconName is duplicated here and also exported from icon-registry.tsx. This creates ambiguity about which import to use. Consider removing this duplicate type definition and importing IconName from icon-registry instead to maintain a single source of truth.
| import { iconRegistry } from "./icon-registry"; | |
| import { Icon as ChakraIcon } from "@chakra-ui/react"; | |
| export type IconName = keyof typeof iconRegistry; | |
| import { iconRegistry, IconName } from "./icon-registry"; | |
| import { Icon as ChakraIcon } from "@chakra-ui/react"; |
app/(Pages)/contact/page.tsx
Outdated
| Image as ChakraImage, | ||
| Card, | ||
| } from "@chakra-ui/react"; | ||
| import { poppins } from "../../../components/ui/fonts"; |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import poppins.
| import { poppins } from "../../../components/ui/fonts"; |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ith ChakraImage for better integration
… implement strong typing in TypeScript, and enhance search functionality with region and category filters using Chakra UI components.
…ports in ContactForm, and streamline FeatureCard component imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 31 out of 36 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Create a reusable IconButton component that takes in link, platform, url, and icon as props and renders an anchor tag with the provided icon. | ||
| // & React.ComponentProps<typeof ChakraIcon> | ||
|
|
||
| export default function IconButton({ | ||
| link, | ||
| platform, | ||
| url, | ||
| icon, | ||
| }: { | ||
| link: string; | ||
| platform: string; | ||
| url: string; | ||
| icon: React.ReactNode; | ||
| }) { | ||
| return ( | ||
| <a | ||
| href={url} | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| aria-label={`Visit our ${platform} page`} | ||
| > | ||
| {icon} | ||
| </a> | ||
| ); | ||
| } |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The IconButton component is created but not used anywhere in the codebase. Consider removing this file or implementing its usage if it was intended for the icon refactor.
| // Create a reusable IconButton component that takes in link, platform, url, and icon as props and renders an anchor tag with the provided icon. | |
| // & React.ComponentProps<typeof ChakraIcon> | |
| export default function IconButton({ | |
| link, | |
| platform, | |
| url, | |
| icon, | |
| }: { | |
| link: string; | |
| platform: string; | |
| url: string; | |
| icon: React.ReactNode; | |
| }) { | |
| return ( | |
| <a | |
| href={url} | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| aria-label={`Visit our ${platform} page`} | |
| > | |
| {icon} | |
| </a> | |
| ); | |
| } | |
| // This file previously contained an IconButton React component that was not used | |
| // anywhere in the codebase. It has been removed to eliminate dead code. | |
| // Explicitly mark this file as a module with no exports. | |
| export {}; |
| link, | ||
| platform, | ||
| url, | ||
| icon, | ||
| }: { | ||
| link: string; |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link parameter is defined but never used in this component. Remove the unused parameter or implement its intended functionality.
| link, | |
| platform, | |
| url, | |
| icon, | |
| }: { | |
| link: string; | |
| platform, | |
| url, | |
| icon, | |
| }: { |
| const [isSubmitting, setIsSubmitting] = useState(false); | ||
| const [status, setStatus] = useState<SubmissionStatus>({ type: null, message: '' }); | ||
| const submitToasterId = "contact-form-submission"; | ||
| const [showToast, setShowToast] = useState(false); |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable declaration. The showToast state is set but never used. Remove this unused state or implement its intended functionality.
| const [toastMessage, setToastMessage] = useState({ | ||
| error: () => "", | ||
| loading: () => | ||
| toaster.loading({ | ||
| id: submitToasterId, | ||
| title: "Submitting form", | ||
| description: "Please wait while we submit your message.", | ||
| type: "info", | ||
| closable: true, | ||
| }), | ||
| update: () => "", | ||
| updateSuccess: () => | ||
| toaster.update(submitToasterId, { | ||
| title: "Form submitted", | ||
| description: "Your message has been sent successfully.", | ||
| type: "success", | ||
| duration: 3000, | ||
| closable: true, | ||
| }), | ||
| reset: () => | ||
| toaster.create({ | ||
| title: "Form reset", | ||
| description: "The contact form has been cleared.", | ||
| type: "info", | ||
| closable: true, | ||
| }), | ||
| }); |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The toastMessage object contains unused properties (error and update). These functions are defined but never called. Remove unused functions or implement their intended functionality.
| import { Tooltip } from "@/components/ui/tooltip"; | ||
| export default function SearchResources() { | ||
| //Retrieve mock data from json file | ||
| const [searchlist, setSearchlist] = useState(null); |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable setSearchlist.
| const [searchlist, setSearchlist] = useState(null); | |
| const [searchlist] = useState(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 31 out of 36 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // export type IconName = keyof typeof iconRegistry; | ||
|
|
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented-out code. This export type comment should either be removed entirely or the actual export should be uncommented and used, but keeping commented code reduces code cleanliness.
| // export type IconName = keyof typeof iconRegistry; |
| @@ -1,17 +1,20 @@ | |||
| import { IconName } from "../ui/icons/icon"; | |||
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import. The IconName type is imported but never used in this file since the icon prop type is defined inline as icon: IconName.
| import { IconName } from "../ui/icons/icon"; | |
| import type { IconName } from "../ui/icons/icon"; |
| @@ -0,0 +1,25 @@ | |||
| // Create a reusable IconButton component that takes in link, platform, url, and icon as props and renders an anchor tag with the provided icon. | |||
| // & React.ComponentProps<typeof ChakraIcon> | |||
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented-out code. Lines 1-4 contain a comment about the component's purpose, but the implementation doesn't match the described interface. Either update the comment to reflect the actual implementation or remove it entirely.
| // & React.ComponentProps<typeof ChakraIcon> |
| link: string; | ||
| platform: string; | ||
| url: string; | ||
| icon: React.ReactNode; | ||
| }) { | ||
| return ( | ||
| <a | ||
| href={url} |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link parameter is defined but never used in this component. Consider removing it from the props interface or using it for the href attribute if that was the intention.
| link: string; | |
| platform: string; | |
| url: string; | |
| icon: React.ReactNode; | |
| }) { | |
| return ( | |
| <a | |
| href={url} | |
| link?: string; | |
| platform: string; | |
| url: string; | |
| icon: React.ReactNode; | |
| }) { | |
| return ( | |
| <a | |
| href={link ?? url} |
| const [isSubmitting, setIsSubmitting] = useState(false); | ||
| const [status, setStatus] = useState<SubmissionStatus>({ type: null, message: '' }); | ||
| const submitToasterId = "contact-form-submission"; | ||
| const [showToast, setShowToast] = useState(false); |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable showToast.
| const [showToast, setShowToast] = useState(false); |
This pull request introduces several improvements and refactors across multiple pages and API routes, focusing on code consistency, UI enhancements, and better resource management. The most significant changes include UI updates for the Contact and Services pages, improved icon usage, and the addition of a new resources file for API search functionality.
UI and Component Improvements
Refactored the
Contactpage (app/(Pages)/contact/page.tsx) to use consistent import styles, improved the rendering of social links and contact information by introducing the customIconcomponent, and enhanced accessibility and layout for both desktop and mobile views. [1] [2] [3] [4] [5] [6] [7] [8] [9]Updated the
Servicespage (app/(Pages)/services/page.tsx) to use Chakra UI'sSimpleGridfor better responsive layouts, streamlined the rendering of service and support cards, and improved the structure and readability of the page. [1] [2] [3] [4] [5]Modernized the
Homepage (app/page.tsx) by updating import styles, replacing the icon in the "Learn More" button with the customIconcomponent, and improving text formatting for clarity and consistency. [1] [2]API and Resource Management
Added a new
resources.jsonfile (app/(API Routes)/api/search/resources.json) containing various resource links for re-entry, employment, housing, and crisis management, supporting API-based resource searches.Introduced comments and documentation in API route files to clarify their purpose, including a catch-all search route and a dynamic state resource route. (app/(API Routes)/api/search/route.tsR1-R8, app/(API Routes)/api/search/[state]/route.tsR1)
Updated the file path construction in the blog search API route (
app/(API Routes)/api/blog/search/route.ts) to remove the unnecessary"src"directory, improving compatibility with deployment environments.