temp: add resources

This commit is contained in:
2025-03-15 23:54:53 +08:00
parent a5bde33678
commit fd30741151
40 changed files with 2174 additions and 32 deletions

View File

@@ -0,0 +1,21 @@
import { toast } from 'react-toastify';
// Custom message component
const LoginMessage = () => {
const handleClick = () => {
const currentUrl = window.location.href;
const redirect = encodeURIComponent(currentUrl);
window.location.href = '/user/login?redirect=' + redirect;
};
return (
<div className='msg-container' onClick={handleClick} style={{ cursor: 'pointer' }}>
<p className='msg-title'>Please login</p>
<p className='msg-description'>Click here to go to the login page.</p>
</div>
);
};
export const toastLogin = () => {
toast.info(<LoginMessage />);
};

View File

@@ -0,0 +1,5 @@
import { toast } from 'react-toastify';
export const toastify = (message: string, type: 'success' | 'error' | 'warning' | 'info') => {
toast(message, { type });
};