Skip to content

Commit

Permalink
Fix lottie animations
Browse files Browse the repository at this point in the history
  • Loading branch information
moysa committed May 29, 2024
1 parent 0cb86c7 commit 61644c9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/components/Note/NoteFooter/NoteFooter.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@
}
}

&.normal {
width: 100%;
}

.context {
background: none;
display: flex;
Expand Down
17 changes: 11 additions & 6 deletions src/components/Note/NoteFooter/NoteFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const NoteFooter: Component<{
let footerDiv: HTMLDivElement | undefined;
let repostMenu: HTMLDivElement | undefined;

const size = () => props.size || 'normal';
const size = () => props.size ?? 'normal';

const repostMenuItems: MenuItem[] = [
{
Expand Down Expand Up @@ -225,12 +225,17 @@ const NoteFooter: Component<{
return;
}

let newLeft = size() === 'wide' ? 15 : 13;
let newTop = size() === 'wide' ? -6 : -6;
let newLeft = 33;
let newTop = -6;

if (props.large) {
newLeft = 2;
newTop = -9;
if (size() === 'wide' && props.large) {
newLeft = 14;
newTop = -10;
}

if (size() === 'short') {
newLeft = 14;
newTop = -6;
}

medZapAnimation.style.left = `${newLeft}px`;
Expand Down

0 comments on commit 61644c9

Please sign in to comment.