This repository has been archived by the owner on Oct 28, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
351 additions
and
131 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {Alert} from "@mui/material"; | ||
|
||
export default function ContainerUpLearnMore({variant}) { | ||
if (!process.env.REACT_APP_CONTAINERUP_DEMO) { | ||
return ''; | ||
} | ||
|
||
if (variant === "long") { | ||
return ( | ||
<Alert severity="info" sx={{mt: '5px'}}> | ||
Love this project? Learn more about ContainerUp <a href="https://containerup.org/" target="_blank" rel="noreferrer">here</a>. | ||
</Alert> | ||
); | ||
} | ||
|
||
return ( | ||
<Alert severity="info" sx={{mt: '5px'}}> | ||
Learn more about ContainerUp <a href="https://containerup.org/" target="_blank" rel="noreferrer">here</a>. | ||
</Alert> | ||
); | ||
} |
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
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,9 @@ | ||
import {Alert} from "@mui/material"; | ||
|
||
export default function WebsocketConnectError() { | ||
return ( | ||
<Alert severity="error"> | ||
Failed to connect websocket. | ||
</Alert> | ||
); | ||
} |
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,22 @@ | ||
import {enqueueSnackbar} from "notistack"; | ||
import {Button} from "@mui/material"; | ||
import RefreshIcon from '@mui/icons-material/Refresh'; | ||
|
||
export function showWebsocketDisconnectError() { | ||
const action = snackbarId => ( | ||
<Button | ||
color="inherit" | ||
size="small" | ||
startIcon={<RefreshIcon />} | ||
onClick={() => window.location.reload()} | ||
> | ||
Reload | ||
</Button> | ||
); | ||
|
||
enqueueSnackbar('Websocket disconnected. The information on this page is NOT up-to-date.', { | ||
variant: 'warning', | ||
persist: true, | ||
action | ||
}); | ||
} |
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,42 @@ | ||
import { useEffect } from "react"; | ||
import { useLocation } from "react-router-dom"; | ||
|
||
export const useGA4 = () => { | ||
const ga4 = process.env.REACT_APP_CONTAINERUP_GA4; | ||
|
||
useEffect(() => { | ||
if (!ga4) { | ||
return; | ||
} | ||
|
||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){window.dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', ga4, { | ||
send_page_view: false | ||
}); | ||
|
||
const script = document.createElement('script'); | ||
script.src = "https://www.googletagmanager.com/gtag/js?id=" + ga4; | ||
script.async = true; | ||
|
||
document.body.appendChild(script); | ||
return () => { | ||
document.body.removeChild(script); | ||
}; | ||
}, [ga4]); | ||
|
||
const location = useLocation(); | ||
useEffect(() => { | ||
if (!ga4) { | ||
return; | ||
} | ||
|
||
function gtag(){window.dataLayer.push(arguments);} | ||
gtag("event", "page_view", { | ||
page_path: location.pathname + location.search + location.hash, | ||
page_search: location.search, | ||
page_hash: location.hash, | ||
}); | ||
}, [ga4, location]); | ||
}; |
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
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.