Skip to content

Commit

Permalink
Use warning instead
Browse files Browse the repository at this point in the history
  • Loading branch information
dejavu1987 committed Nov 8, 2023
1 parent 6df2428 commit 72c9d1f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,29 @@ import { PageContent } from './components/PageContent';
import { IconGrid } from './components/IconGrid';
import { Menu } from './components/Menu';
import Logo from './assets/icons/icon.svg';
import { useEffect } from 'react';
import { toast } from 'react-toastify';

function App() {
useEffect(() => {
if (window.location.protocol === 'https:')
toast.warning(
<>
<strong>Warning:</strong> You are on secure <strong>(https)</strong>{' '}
page, you will need to open this page at{' '}
<a href="http://ftd.anilmaharjan.com.np">
http://ftd.anilmaharjan.com.np
</a>
<hr />
FreeTouchDeck Webserver does not support https, to be able to save
your config to FreeTouchDeck, you have to use the config page on http.
</>,
{
autoClose: false,
position: 'top-center',
}
);
}, []);
return (
<>
<Router>
Expand Down
4 changes: 4 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@
main {
@apply p-5;
}

#root {
--toastify-toast-width: 380px;
}
}

0 comments on commit 72c9d1f

Please sign in to comment.