diff --git a/src/features/editor/components/footer/mobile-footer.tsx b/src/features/editor/components/footer/mobile-footer.tsx index dc3f066..d0d507e 100644 --- a/src/features/editor/components/footer/mobile-footer.tsx +++ b/src/features/editor/components/footer/mobile-footer.tsx @@ -1,6 +1,7 @@ import { CodeIcon, ListBulletIcon } from '@radix-ui/react-icons'; import React from 'react'; +import { useLogsStore } from '../../stores/editor'; import { BottomTabsContainer, BottomTabsTab } from '../ui/bottom-tabs'; import type { FooterProps } from './types'; @@ -15,6 +16,8 @@ export const MobileFooter: React.FC = ({ isRightActive, className, }) => { + const { alert, clearAlert } = useLogsStore(); + return ( = ({ { + onRightClick(); + clearAlert(); + }} + showBadge={alert} isActive={isRightActive} /> diff --git a/src/features/editor/components/ui/bottom-tabs.tsx b/src/features/editor/components/ui/bottom-tabs.tsx index ef31978..0a81d71 100644 --- a/src/features/editor/components/ui/bottom-tabs.tsx +++ b/src/features/editor/components/ui/bottom-tabs.tsx @@ -33,12 +33,14 @@ interface BottomTabsTabProps extends ButtonProps { label: string; icon: ForwardRefExoticComponent>; isActive?: boolean; + showBadge?: boolean; } export const BottomTabsTab: React.FC = ({ label, icon, isActive = false, + showBadge, ...props }) => { const Icon = icon; @@ -50,10 +52,16 @@ export const BottomTabsTab: React.FC = ({ >
+
diff --git a/src/features/editor/stores/editor/logs-store.ts b/src/features/editor/stores/editor/logs-store.ts index b1c4710..7dcbb75 100644 --- a/src/features/editor/stores/editor/logs-store.ts +++ b/src/features/editor/stores/editor/logs-store.ts @@ -10,24 +10,31 @@ const logsList = new LinkedLogs(); interface LogsState { logs: log[]; isFirstTime: boolean; + alert: boolean; appendLogs: (logs: log) => void; clearLogs: () => void; + clearAlert: () => void; } const _useLogsStore = create((set) => ({ logs: [], isFirstTime: true, + alert: false, appendLogs: (log: log) => { logsList.append(log); set({ logs: logsList.getAllLogsInArray(), isFirstTime: false, + alert: true, }); }, clearLogs: () => { logsList.clearFirst(); set({ logs: [] }); }, + clearAlert: () => { + set({ alert: false }); + }, })); export const useLogsStore = createSelectors(_useLogsStore);