-
Notifications
You must be signed in to change notification settings - Fork 649
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into careui/forms
- Loading branch information
Showing
71 changed files
with
1,580 additions
and
988 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1,13 +1,18 @@ | ||
{ | ||
"dashboard_url": "https://dashboard.coronasafe.in", | ||
"github_url": "https://github.com/coronasafe", | ||
"coronasafe_url": "https://coronasafe.network?ref=care", | ||
"static_header_logo": "https://cdn.coronasafe.network/header_logo.png", | ||
"static_light_logo": "https://cdn.coronasafe.network/light-logo.svg", | ||
"static_black_logo": "https://cdn.coronasafe.network/black-logo.svg", | ||
"static_dpg_white_logo": "https://digitalpublicgoods.net/wp-content/themes/dpga/images/logo-w.svg", | ||
"static_coronasafe_logo": "https://3451063158-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M233b0_JITp4nk0uAFp%2F-M2Dx6gKxOSU45cjfgNX%2F-M2DxFOkMmkPNn0I6U9P%2FCoronasafe-logo.png?alt=media&token=178cc96d-76d9-4e27-9efb-88f3186368e8", | ||
"gmaps_api_key": "AIzaSyDsBAc3y7deI5ZO3NtK5GuzKwtUzQNJNUk", | ||
"gov_data_api_key": "579b464db66ec23bdd000001cdd3946e44ce4aad7209ff7b23ac571b", | ||
"recaptcha_site_key": "6LdvxuQUAAAAADDWVflgBqyHGfq-xmvNJaToM0pN", | ||
"kasp_enabled": false, | ||
"kasp_string": "KASP", | ||
"kasp_full_string": "Karunya Arogya Suraksha Padhathi", | ||
"state_logo": "https://digitalpublicgoods.net/wp-content/themes/dpga/images/logo.svg" | ||
"sample_format_asset_import": "https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=11JaEhNHdyCHth4YQs_44YaRlP77Rrqe81VSEfg1glko&exportFormat=xlsx", | ||
"sample_format_external_result_import": "https://docs.google.com/spreadsheets/d/17VfgryA6OYSYgtQZeXU9mp7kNvLySeEawvnLBO_1nuE/export?format=csv&id=17VfgryA6OYSYgtQZeXU9mp7kNvLySeEawvnLBO_1nuE" | ||
} |
Binary file not shown.
Binary file not shown.
This file contains 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 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 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,38 @@ | ||
import { useLocationChange } from "raviger"; | ||
import { createContext, ReactNode, useState } from "react"; | ||
|
||
export const HistoryContext = createContext<string[]>([]); | ||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
export const ResetHistoryContext = createContext(() => {}); | ||
|
||
export const HistoryAPIProvider = (props: { children: ReactNode }) => { | ||
const [history, setHistory] = useState<string[]>([]); | ||
|
||
useLocationChange( | ||
(newLocation) => { | ||
setHistory((history) => { | ||
if (history.length && newLocation.fullPath === history[0]) | ||
// Ignore push if navigate to same path (for some weird unknown reasons?) | ||
return history; | ||
|
||
if (history.length > 1 && newLocation.fullPath === history[1]) | ||
// Pop current path if navigate back to previous path | ||
return history.slice(1); | ||
|
||
// Otherwise just push the current path | ||
return [newLocation.fullPath, ...history]; | ||
}); | ||
}, | ||
{ onInitial: true } | ||
); | ||
|
||
const resetHistory = () => setHistory((history) => history.slice(0, 1)); | ||
|
||
return ( | ||
<HistoryContext.Provider value={history}> | ||
<ResetHistoryContext.Provider value={resetHistory}> | ||
{props.children} | ||
</ResetHistoryContext.Provider> | ||
</HistoryContext.Provider> | ||
); | ||
}; |
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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,26 @@ | ||
import { navigate } from "raviger"; | ||
import { useContext } from "react"; | ||
import { | ||
HistoryContext, | ||
ResetHistoryContext, | ||
} from "../../CAREUI/misc/HistoryAPIProvider"; | ||
|
||
export default function useAppHistory() { | ||
const history = useContext(HistoryContext); | ||
const resetHistory = useContext(ResetHistoryContext); | ||
|
||
const goBack = (fallbackUrl?: string) => { | ||
if (history.length > 1) | ||
// Navigate to history present in the app navigation history stack. | ||
return navigate(history[1]); | ||
|
||
if (fallbackUrl) | ||
// Otherwise, use provided fallback url if provided. | ||
return navigate(fallbackUrl); | ||
|
||
// Otherwise, fallback to browser's go back behaviour. | ||
window.history.back(); | ||
}; | ||
|
||
return { history, resetHistory, goBack }; | ||
} |
This file contains 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.