This document provides detailed instructions on the structure and usage of assets and the store folder in the InfraBoard project, along with a step-by-step guide for creating and using custom .tsx
icon components.
aws/
: Contains.tsx
icon components related to AWS services:compute/
: Icons for AWS compute services.network/
: Icons for AWS networking services.- (Other subdirectories for additional AWS categories)
gcp/
: Contains.tsx
icon components related to GCP services:compute/
: Icons for GCP compute services.network/
: Icons for GCP networking services.- (Other subdirectories for additional GCP categories)
- Copy the SVG code.
- Open the SVGR Playground.
- Paste the SVG code into the playground. It will generate a React component.
- Save the generated code into a new
.tsx
file within the appropriate directory insrc/assets/
. - Follow proper naming conventions for the file.
- Import the newly created
.tsx
file intosrc/assets/index.ts
. - Add the new component to the relevant icon object.
- Import the desired icon object:
import { AWSIcons } from '@/assets/aws';
- Destructure the required icon from the object:
const { YourIconComponentName } = AWSIcons;
- Use the component in your application:
<YourIconComponentName className="" />
aws/
: Contains data files related to AWS services, categorized into:compute/
network/
applications/
others/
- (Additional categories as required)
gcp/
: Contains data files related to GCP services, categorized into:compute/
ai/
applications/
others/
- (Additional categories as required)
Each subdirectory contains objects that may include React icons or custom .tsx
icon components. These objects are imported into store/aws/index.ts
and store/gcp/index.ts
for centralized access.
leftSidebarData
: Responsible for rendering the tabs in the left sidebar. Tabs can be easily added or removed by modifying this file.
graph TD
A[src/] --> B[assets/]
B --> B1[aws/]
B --> B2[gcp/]
B1 --> B1A[compute/]
B1 --> B1B[network/]
B1 --> B1C[...]
B2 --> B2A[compute/]
B2 --> B2B[network/]
B2 --> B2C[...]
A --> C[store/]
C --> C1[aws/]
C --> C2[gcp/]
C1 --> C1A[compute/]
C1 --> C1B[network/]
C1 --> C1C[applications/]
C1 --> C1D[others/]
C2 --> C2A[compute/]
C2 --> C2B[ai/]
C2 --> C2C[applications/]
C2 --> C2D[others/]
C --> C3[leftSidebarData]
- Maintain a clear and consistent naming convention for all files and components.
- Regularly update the
index.ts
files for centralized imports and better modularity. - Use the
leftSidebarData
file for managing the tabs dynamically in the left sidebar.