Skip to content

Commit

Permalink
Format & lint
Browse files Browse the repository at this point in the history
  • Loading branch information
CRBl69 committed Dec 3, 2024
1 parent 0930163 commit aef8a94
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ const ClientLaunchEmojicoinPage: React.FC<{

return (
<div className="flex flex-col grow relative overflow-hidden">
{randomSymbols.length > 0 &&
{randomSymbols.length > 0 && (
<EmojiRain
randomSymbols={randomSymbols}
onClick={(name) => setEmojis(name.emojis.map((e) => e.emoji))}
/>
}
)}
<TextCarousel />

<div className="flex justify-center items-center h-full px-6">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type symbolBytesToEmojis } from "@sdk/emoji_data";
import { AnimationPlaybackControls, useAnimate } from "framer-motion";
import { type AnimationPlaybackControls, useAnimate } from "framer-motion";
import { useEffect, useMemo, useState } from "react";
import { useWindowSize } from "react-use";

Expand All @@ -10,7 +10,7 @@ export function EmojiRainDrop({
name,
onClick,
index,
emojis
emojis,
}: {
name: ReturnType<typeof symbolBytesToEmojis>;
onClick?: (data: ReturnType<typeof symbolBytesToEmojis>) => void;
Expand All @@ -31,7 +31,6 @@ export function EmojiRainDrop({
const [scope, animate] = useAnimate();
const [controls, setControls] = useState<AnimationPlaybackControls>();


useEffect(() => {
const controls = animate(
scope.current,
Expand All @@ -48,12 +47,17 @@ export function EmojiRainDrop({
setControls(controls);

return () => controls.complete();
}, []);
}, [scope, animate, delay, height, emojis]);

return (
<div
onClick={() => onClick && onClick(name)}
onMouseOver={() => { if (controls){controls.time += delay; controls.pause()} }}
onMouseOver={() => {
if (controls) {
controls.time += delay;
controls.pause();
}
}}
onMouseOut={() => controls?.play()}
className="absolute emoji-rain-drop z-10 flex flex-col select-none cursor-pointer"
style={{
Expand All @@ -64,8 +68,7 @@ export function EmojiRainDrop({
ref={scope}
>
{name.emojis.map((e) => (
<span
key={`rain-drop-emoji-${e.hex}`}>{e.emoji}</span>
<span key={`rain-drop-emoji-${e.hex}`}>{e.emoji}</span>
))}
</div>
);
Expand All @@ -81,15 +84,16 @@ export function EmojiRain({
return (
<>
{randomSymbols.map((name, i) => {
const emojiRainDrop =
const emojiRainDrop = (
<EmojiRainDrop
key={`rain-drop-${name.emojis.map((e) => e.hex).reduce((a, b) => `${a}-${b}`, "")}`}
name={name}
onClick={onClick}
index={i}
emojis={randomSymbols.length}
/>;
return emojiRainDrop;
/>
);
return emojiRainDrop;
})}
</>
);
Expand Down
3 changes: 2 additions & 1 deletion src/typescript/sdk/src/indexer-v2/queries/app/launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { postgrest } from "../client";
import { queryHelper } from "../utils";
import { DatabaseTypeConverter } from "../../types";

const selectRandomSymbols = () => postgrest.rpc(DatabaseRpc.RandomSymbols, undefined, { get: true });
const selectRandomSymbols = () =>
postgrest.rpc(DatabaseRpc.RandomSymbols, undefined, { get: true });

export const fetchRandomSymbols = queryHelper(
selectRandomSymbols,
Expand Down

0 comments on commit aef8a94

Please sign in to comment.