Skip to content

Commit f567307

Browse files
committed
wip
1 parent 6cb8231 commit f567307

File tree

5 files changed

+31
-20
lines changed

5 files changed

+31
-20
lines changed

app/providers.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,28 @@
22

33
import MotionConfig from "@/components/MotionConfig";
44
import { farcasterFrame } from "@farcaster/miniapp-wagmi-connector";
5-
import { type ReactNode } from "react";
5+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
6+
import { type ReactNode, useState } from "react";
67
import { createConfig, http, WagmiProvider } from "wagmi";
7-
import { base, mainnet } from "wagmi/chains";
8+
import { base, mainnet, baseSepolia } from "wagmi/chains";
89

910
const config = createConfig({
10-
chains: [base, mainnet],
11+
chains: [base, baseSepolia, mainnet],
1112
connectors: [farcasterFrame() as unknown as any],
1213
transports: {
1314
[base.id]: http(),
15+
[baseSepolia.id]: http(),
1416
[mainnet.id]: http(),
1517
},
1618
});
1719

1820
export function Providers(props: { children: ReactNode }) {
21+
const [queryClient] = useState(() => new QueryClient());
1922
return (
20-
<WagmiProvider config={config}>
21-
<MotionConfig>{props.children}</MotionConfig>
22-
</WagmiProvider>
23+
<QueryClientProvider client={queryClient}>
24+
<WagmiProvider config={config}>
25+
<MotionConfig>{props.children}</MotionConfig>
26+
</WagmiProvider>
27+
</QueryClientProvider>
2328
);
2429
}

components/CreatePostModal.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { mintclub } from "mint.club-v2-sdk";
1616
import { motion } from "motion/react";
1717
import { useState } from "react";
1818
import toast from "react-hot-toast";
19-
import { useAccount, useSwitchChain, useWalletClient } from "wagmi";
19+
import { useAccount, useSwitchChain } from "wagmi";
2020

2121
export default function CreatePostModal({
2222
userToken,
@@ -31,10 +31,10 @@ export default function CreatePostModal({
3131
const { address, chain } = useAccount();
3232
const { switchChain } = useSwitchChain();
3333

34-
const { data: walletClient } = useWalletClient({
35-
account: address,
36-
chainId: Number(NETWORK.BASE_SEPOLIA),
37-
});
34+
// const { data: walletClient } = useWalletClient({
35+
// account: address,
36+
// chainId: Number(NETWORK.BASE_SEPOLIA),
37+
// });
3838

3939
/**
4040
* 체인 확인 및 전환
@@ -405,15 +405,15 @@ export default function CreatePostModal({
405405
animate={{ opacity: 1, y: 0 }}
406406
transition={{ delay: 0.3, duration: timing.normal }}
407407
>
408-
<label className="block text-sm font-medium text-gray-700 mb-2 text-instagram-body">
408+
<label className="block text-sm font-medium text-white mb-2 text-instagram-body">
409409
포스트 이름
410410
</label>
411411
<motion.input
412412
type="text"
413413
value={postName}
414414
onChange={(e) => setPostName(e.target.value)}
415415
placeholder="포스트 이름을 입력하세요"
416-
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-ewha-600 text-instagram-body"
416+
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-ewha-600 text-black"
417417
whileFocus={{ scale: 1.02 }}
418418
transition={{ ...spring.smooth }}
419419
/>

components/Orb.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ interface OrbProps {
66
hoverIntensity?: number;
77
rotateOnHover?: boolean;
88
forceHoverState?: boolean;
9+
isHover?: boolean;
910
}
1011

1112
export default function Orb({
1213
hue = 0,
1314
hoverIntensity = 0.2,
1415
rotateOnHover = true,
1516
forceHoverState = false,
17+
isHover = false,
1618
}: OrbProps) {
1719
const ctnDom = useRef<HTMLDivElement>(null);
1820

@@ -162,8 +164,10 @@ export default function Orb({
162164
float c = cos(angle);
163165
uv = vec2(c * uv.x - s * uv.y, s * uv.x + c * uv.y);
164166
165-
uv.x += hover * hoverIntensity * 0.1 * sin(uv.y * 10.0 + iTime);
166-
uv.y += hover * hoverIntensity * 0.1 * sin(uv.x * 10.0 + iTime);
167+
// hover 상태를 반전시켜서 적용
168+
float invertedHover = 1.0 - hover;
169+
uv.x += invertedHover * hoverIntensity * 0.1 * sin(uv.y * 10.0 + iTime);
170+
uv.y += invertedHover * hoverIntensity * 0.1 * sin(uv.x * 10.0 + iTime);
167171
168172
return draw(uv);
169173
}
@@ -263,11 +267,13 @@ export default function Orb({
263267
program.uniforms.hue.value = hue;
264268
program.uniforms.hoverIntensity.value = hoverIntensity;
265269

266-
const effectiveHover = forceHoverState ? 1 : targetHover;
270+
// isHover prop이 true이면 hover 상태로, forceHoverState나 targetHover도 고려
271+
const effectiveHover = forceHoverState || isHover ? 1 : targetHover;
267272
program.uniforms.hover.value +=
268273
(effectiveHover - program.uniforms.hover.value) * 0.1;
269274

270-
if (rotateOnHover && effectiveHover > 0.5) {
275+
// rotateOnHover 로직도 반전 - hover 상태가 아닐 때 회전
276+
if (rotateOnHover && effectiveHover < 0.5) {
271277
currentRot += dt * rotationSpeed;
272278
}
273279
program.uniforms.rot.value = currentRot;
@@ -284,7 +290,7 @@ export default function Orb({
284290
container.removeChild(gl.canvas);
285291
gl.getExtension("WEBGL_lose_context")?.loseContext();
286292
};
287-
}, [hue, hoverIntensity, rotateOnHover, forceHoverState]);
293+
}, [hue, hoverIntensity, rotateOnHover, forceHoverState, isHover]);
288294

289295
return <div ref={ctnDom} className="w-full h-full" />;
290296
}

constants/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ export const TOAST_MESSAGES = {
6262

6363
// 유틸리티 함수들
6464
export const createTokenSymbol = (username: string): string =>
65-
`BASE${username.toUpperCase()}`;
65+
`AWHA${username.toUpperCase()}`;

hooks/useUserToken.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const useUserToken = () => {
3030
// TODO: 토큰 심볼 생성 - `EWHA${username.toUpperCase()}`
3131
// const tokenSymbol = `EWHATEST`;
3232

33-
const tokenSymbol = `EWHA${username.toUpperCase()}`;
33+
const tokenSymbol = createTokenSymbol(username);
3434
// TODO: mint.club SDK로 토큰 존재 여부 확인
3535
// mintclub.network(NETWORK.BASE_SEPOLIA).token(tokenSymbol).exists()
3636
const exists = await mintclub

0 commit comments

Comments
 (0)