{"id":21529370,"url":"https://github.com/ramsunvtech/react-camouflage","last_synced_at":"2025-06-29T15:37:23.151Z","repository":{"id":57157522,"uuid":"441599604","full_name":"ramsunvtech/react-camouflage","owner":"ramsunvtech","description":"camouflage components help to change view as per various status","archived":false,"fork":false,"pushed_at":"2021-12-26T14:51:16.000Z","size":288,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-16T03:31:59.713Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ramsunvtech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-25T03:55:12.000Z","updated_at":"2024-04-16T02:20:41.000Z","dependencies_parsed_at":"2022-09-07T20:33:00.941Z","dependency_job_id":null,"html_url":"https://github.com/ramsunvtech/react-camouflage","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/ramsunvtech/react-camouflage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramsunvtech%2Freact-camouflage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramsunvtech%2Freact-camouflage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramsunvtech%2Freact-camouflage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramsunvtech%2Freact-camouflage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramsunvtech","download_url":"https://codeload.github.com/ramsunvtech/react-camouflage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramsunvtech%2Freact-camouflage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262621230,"owners_count":23338648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T01:57:06.122Z","updated_at":"2025-06-29T15:37:23.123Z","avatar_url":"https://github.com/ramsunvtech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-camouflage\n`react-camouflage` components help to change view as per various status\n\n## Usage\n\n### FetchView\n\n#### Get rid of the below lengthy conditions for your API (service) status.\n\n```\nif (!status) {\n  return \u003cdiv\u003ePartial Loader goes here\u003c/div\u003e\n} else if (status === 'loading') {\n  return \u003cdiv\u003eSpinner goes here\u003c/div\u003e\n} else if (status === 'success') {\n  return \u003cdiv\u003eService Data List here\u003c/div\u003e\n} else {\n   return (\n     \u003cspan\u003eError Occurred: Please click to try again.\u003c/div\u003e\n   );\n}\n```\n\n#### Example for FetchView with `status` Props.\n\n```\nconst status = 'success';\n/**\n * `FetchView.Initial` will render when status is undefined or null.\n * `FetchView.Fetching` will render when status is 'loading`.\n * `FetchView.Fetched` will render when status is 'success`.\n * `FetchView.Error` will render when status is 'error`.\n */\n\n\u003cFetchView status={status}\u003e\n  \u003cFetchView.Initial\u003e\n    \u003cdiv\u003ePartial Loader goes here\u003c/div\u003e\n  \u003c/FetchView.Initial\u003e\n  \u003cFetchView.Fetching\u003e\n    \u003cdiv\u003eSpinner goes here\u003c/div\u003e\n  \u003c/FetchView.Fetching\u003e\n  \u003cFetchView.Fetched\u003e\n    \u003cdiv\u003eService Data List here\u003c/div\u003e\n  \u003c/FetchView.Fetched\u003e\n  \u003cFetchView.Error\u003e\n    \u003cspan\u003eError Occurred: Please click to try again.\u003c/div\u003e\n  \u003c/FetchView.Error\u003e\n\u003c/FetchView\u003e\n```\n\n#### Example for FetchView with `status` Props.\n\n```\nconst statusMapping = {\n  [Statuses.Success]: (status === 'success'),\n  [Statuses.Error]: (status === 'error'),\n  [Statuses.Loading]: (status === 'loading'),\n}\n\n\u003cFetchView statusMapping={statusMapping}\u003e\n  \u003cFetchView.Initial\u003e\n    \u003cdiv\u003ePartial Loader goes here\u003c/div\u003e\n  \u003c/FetchView.Initial\u003e\n  \u003cFetchView.Fetching\u003e\n    \u003cdiv\u003eSpinner goes here\u003c/div\u003e\n  \u003c/FetchView.Fetching\u003e\n  \u003cFetchView.Fetched\u003e\n    \u003cdiv\u003eService Data List here\u003c/div\u003e\n  \u003c/FetchView.Fetched\u003e\n  \u003cFetchView.Error\u003e\n    \u003cspan\u003eError Occurred: Please click to try again.\u003c/div\u003e\n  \u003c/FetchView.Error\u003e\n\u003c/FetchView\u003e\n```\n\n##### Using NPM:\n\n```sh\n$ npm install react-camouflage --save\n```\n\n##### Using yarn\n\n```sh\n$ yarn add react-camouflage\n```\n\n# Demo\n\n[Code Sandbox Working Demo](https://codesandbox.io/s/react-camouflage-test-in-ts-f139j)\n\n# License\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framsunvtech%2Freact-camouflage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framsunvtech%2Freact-camouflage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framsunvtech%2Freact-camouflage/lists"}