feat: Add CMS context, hooks, and types for managing CMS data

- Implemented CmsContext and CmsProvider for global state management of CMS data.
- Created a custom hook `useGetCms` to fetch CMS data using React Query.
- Defined TypeScript interfaces for CMS response and its related data structures.
- Added error handling for data fetching in both the service and context.
This commit is contained in:
AmirReza Jamali
2025-11-11 15:22:12 +03:30
parent 910e8aed89
commit efbdb82535
12 changed files with 198 additions and 107 deletions
+4 -1
View File
@@ -1 +1,4 @@
<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>
<svg width="36" height="43" viewBox="0 0 36 43" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.1429 21.5H24.8571H11.1429ZM11.1429 30.1667H24.8571H11.1429ZM29.4286 41H6.57143C5.35901 41 4.19625 40.5435 3.33894 39.7308C2.48163 38.9181 2 37.8159 2 36.6667V6.33333C2 5.18406 2.48163 4.08186 3.33894 3.2692C4.19625 2.45655 5.35901 2 6.57143 2H19.3394C19.9456 2.00012 20.5269 2.22848 20.9554 2.63483L33.3303 14.3652C33.759 14.7714 33.9999 15.3224 34 15.897V36.6667C34 37.8159 33.5184 38.9181 32.6611 39.7308C31.8038 40.5435 30.641 41 29.4286 41Z" fill="#24A6B4" fill-opacity="0.2"/>
<path d="M11.1429 21.5H24.8571M11.1429 30.1667H24.8571M29.4286 41H6.57143C5.35901 41 4.19625 40.5435 3.33894 39.7308C2.48163 38.9181 2 37.8159 2 36.6667V6.33333C2 5.18406 2.48163 4.08186 3.33894 3.2692C4.19625 2.45655 5.35901 2 6.57143 2H19.3394C19.9456 2.00012 20.5269 2.22848 20.9554 2.63483L33.3303 14.3652C33.759 14.7714 33.9999 15.3224 34 15.897V36.6667C34 37.8159 33.5184 38.9181 32.6611 39.7308C31.8038 40.5435 30.641 41 29.4286 41Z" stroke="#24A6B4" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 391 B

After

Width:  |  Height:  |  Size: 1.1 KiB