Skip to content

Commit 0be71bf

Browse files
fix: home panel animation, missing return
Signed-off-by: Henry <mail@henrygressmann.de>
1 parent d334a4d commit 0be71bf

File tree

2 files changed

+13
-26
lines changed

2 files changed

+13
-26
lines changed

web/src/api/hooks.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export const useDimension = ({
9595
.json()
9696
.then((req) => {
9797
if (typeof req === "string") {
98+
console.error("Error fetching graph data:", req);
9899
return Promise.reject(new Error(req));
99100
}
100101
return req;
@@ -145,9 +146,10 @@ export const useProjectGraph = ({
145146
.json()
146147
.then((req) => {
147148
if (typeof req === "string") {
149+
console.error("Error fetching graph data:", req);
148150
return Promise.reject(new Error(req));
149151
}
150-
toDataPoints(req.data, range);
152+
return toDataPoints(req.data, range);
151153
}),
152154
placeholderData: (prev) => prev,
153155
});
@@ -184,6 +186,7 @@ export const useProjectStats = ({
184186
.json()
185187
.then((req) => {
186188
if (typeof req === "string") {
189+
console.error("Error fetching graph data:", req);
187190
return Promise.reject(new Error(req));
188191
}
189192
return req;

web/src/components/projects.module.css

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -91,36 +91,20 @@
9191
cursor: pointer;
9292
padding: 0.9rem;
9393
margin: -1.1rem;
94-
transition: transform 300ms cubic-bezier(0.87, 0, 0.13, 1);
95-
}
96-
.AccordionTrigger[data-state="open"] {
97-
transform: rotate(180deg);
94+
transition: transform 150ms ease-out;
95+
96+
&[data-panel-open] {
97+
transform: rotate(180deg);
98+
}
9899
}
99100

100101
.AccordionContent {
101102
overflow: hidden;
102-
}
103-
.AccordionContent[data-state="open"] {
104-
animation: slideDown 400ms cubic-bezier(0.22, 1, 0.36, 1);
105-
}
106-
.AccordionContent[data-state="closed"] {
107-
animation: slideUp 400ms cubic-bezier(0.22, 1, 0.36, 1);
108-
}
103+
height: var(--accordion-panel-height);
104+
transition: height 150ms ease-out;
109105

110-
@keyframes slideDown {
111-
from {
112-
height: 0;
113-
}
114-
to {
115-
height: var(--radix-accordion-content-height);
116-
}
117-
}
118-
119-
@keyframes slideUp {
120-
from {
121-
height: var(--radix-accordion-content-height);
122-
}
123-
to {
106+
&[data-starting-style],
107+
&[data-ending-style] {
124108
height: 0;
125109
}
126110
}

0 commit comments

Comments
 (0)