managarten/apps-archived/memoro/apps/mobile/features/toast/contexts/ToastContext.tsx
Till-JS 61d181fbc2 chore: archive inactive projects to apps-archived/
Move inactive projects out of active workspace:
- bauntown (community website)
- maerchenzauber (AI story generation)
- memoro (voice memo app)
- news (news aggregation)
- nutriphi (nutrition tracking)
- reader (reading app)
- uload (URL shortener)
- wisekeep (AI wisdom extraction)

Update CLAUDE.md documentation:
- Add presi to active projects
- Document archived projects section
- Update workspace configuration

Archived apps can be re-activated by moving back to apps/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 07:03:59 +01:00

40 lines
1.1 KiB
TypeScript

import React, { createContext, useContext, ReactNode } from 'react';
import { ToastContextType } from '../types';
import { useToastActions } from '../store/toastStore';
import ToastContainer from '../components/ToastContainer';
const ToastContext = createContext<ToastContextType | null>(null);
interface ToastProviderProps {
children: ReactNode;
}
export const ToastProvider: React.FC<ToastProviderProps> = ({ children }) => {
const toastActions = useToastActions();
const contextValue: ToastContextType = {
showToast: toastActions.showToast,
hideToast: toastActions.hideToast,
updateToast: toastActions.updateToast,
showSuccess: toastActions.showSuccess,
showError: toastActions.showError,
showWarning: toastActions.showWarning,
showInfo: toastActions.showInfo,
showLoading: toastActions.showLoading,
};
return (
<ToastContext.Provider value={contextValue}>
{children}
<ToastContainer />
</ToastContext.Provider>
);
};
export const useToast = (): ToastContextType => {
const context = useContext(ToastContext);
if (!context) {
throw new Error('useToast must be used within a ToastProvider');
}
return context;
};