Skip to content

Commit

Permalink
Improve animation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinBrett committed Sep 9, 2024
1 parent 0de429b commit eb180b3
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions components/system/Taskbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const Taskbar: FC = () => {
setAIVisible((currentAIState) => showAI ?? !currentAIState),
[]
);
const hasAI = hasWindowAI || aiEnabled;

return (
<>
Expand All @@ -67,23 +68,20 @@ const Taskbar: FC = () => {
searchVisible={searchVisible}
toggleSearch={toggleSearch}
/>
<TaskbarEntries
clockWidth={clockWidth}
hasAI={hasWindowAI || aiEnabled}
/>
<TaskbarEntries clockWidth={clockWidth} hasAI={hasAI} />
<Clock
hasAI={hasWindowAI || aiEnabled}
hasAI={hasAI}
setClockWidth={setClockWidth}
toggleCalendar={toggleCalendar}
width={clockWidth}
/>
{(hasWindowAI || aiEnabled) && (
<AIButton aiVisible={aiVisible} toggleAI={toggleAI} />
)}
{hasAI && <AIButton aiVisible={aiVisible} toggleAI={toggleAI} />}
</StyledTaskbar>
<AnimatePresence initial={false} presenceAffectsLayout={false}>
{calendarVisible && <Calendar toggleCalendar={toggleCalendar} />}
{aiVisible && <AIChat toggleAI={toggleAI} />}
{calendarVisible && (
<Calendar key="calendar" toggleCalendar={toggleCalendar} />
)}
{aiVisible && <AIChat key="aiChat" toggleAI={toggleAI} />}
</AnimatePresence>
</>
);
Expand Down

0 comments on commit eb180b3

Please sign in to comment.