mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-19 00:15:43 +01:00
* feat: change color scheme * feat: add navigation menu * fix: add bg image * fix: add archive and strategies to navigation * fix: round corners * feat: mobile view project details * feat: mobile view navigation * fix: only show menu if user is admin * fix: rename navigation * fix: only render relevant routes for oss context * feat: add project actions * feat: add icons * feat: add breadcrumbs * fix: place breadcrumbs absolutely * fix: adjust breadcrumbs * fix: toast * fix: cleanup * fix login * fix: breadcrumbs * fix: add billing link * fix: links * fix: feature view * fix: path to go back * fix: remove default value * fix: remove unused imports * refactor: delete outdated test * fix: add item to filter in breadcrumb * fix: remove console log
27 lines
594 B
TypeScript
27 lines
594 B
TypeScript
import { useState } from 'react';
|
|
import Toast from '../component/common/Toast/Toast';
|
|
|
|
const useToast = () => {
|
|
const [toastData, setToastData] = useState({
|
|
show: false,
|
|
type: 'success',
|
|
text: '',
|
|
});
|
|
|
|
const hideToast = () => {
|
|
setToastData(prev => ({ ...prev, show: false }));
|
|
};
|
|
const toast = (
|
|
<Toast
|
|
show={toastData.show}
|
|
onClose={hideToast}
|
|
text={toastData.text}
|
|
type={toastData.type}
|
|
/>
|
|
);
|
|
|
|
return { toast, setToastData, hideToast };
|
|
};
|
|
|
|
export default useToast;
|