diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index cc6cf05..23143fb 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/eslint.config.js b/eslint.config.js index fbbe5ac..5d4362f 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -58,6 +58,7 @@ export default tseslint.config( '@typescript-eslint/no-unsafe-member-access': 'off', '@typescript-eslint/no-unsafe-call': 'off', '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/restrict-template-expressions': 'off', }, }, ); diff --git a/index.html b/index.html index e4b78ea..27abc50 100644 --- a/index.html +++ b/index.html @@ -5,9 +5,15 @@ Vite + React + TS + + + -
+
diff --git a/package.json b/package.json index 5d5b2ce..cb7db40 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@hookform/resolvers": "^3.10.0", + "@radix-ui/react-accordion": "^1.2.2", "@radix-ui/react-dialog": "^1.1.4", "@radix-ui/react-popover": "^1.1.4", "@radix-ui/react-slot": "^1.1.1", diff --git a/public/images/footer/footer.png b/public/images/footer/footer.png new file mode 100644 index 0000000..b67dcef Binary files /dev/null and b/public/images/footer/footer.png differ diff --git a/public/images/libra-card.png b/public/images/libra-card.png new file mode 100644 index 0000000..f50cc83 Binary files /dev/null and b/public/images/libra-card.png differ diff --git a/public/images/sun.png b/public/images/sun.png new file mode 100644 index 0000000..4efe6c9 Binary files /dev/null and b/public/images/sun.png differ diff --git a/public/images/textures/green.png b/public/images/textures/green.png new file mode 100644 index 0000000..9a02904 Binary files /dev/null and b/public/images/textures/green.png differ diff --git a/src/components/common/About/index.tsx b/src/components/common/About/index.tsx new file mode 100644 index 0000000..b7453b9 --- /dev/null +++ b/src/components/common/About/index.tsx @@ -0,0 +1,41 @@ +import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'; + +export const AboutSection = () => { + return ( +
+
+
+

About Tarot

+

+ Lorem ipsum dolor sit amet consectetur. Posuere auctor vivamus sed leo non pellentesque. Massa sed eget est + porta facilisis rhoncus mauris. Pellentesque malesuada morbi volutpat dictum. Sollicitudin suspendisse + aliquam imperdiet rutrum interdum. Dignissim in diam vestibulum sodales nibh nec scelerisque id. Sit + facilisi vestibulum etiam nunc a. Ullamcorper amet sed etiam ac adipiscing mauris cursus blandit vitae. + Lacus eget gravida morbi condimentum lobortis a. Blandit gravida dictum mollis scelerisque feugiat dis. +

+
+ + tarot1 +
+ +
+

Rules

+ +
+ tarot1 + tarot2 + tarot3 +
+ + + {new Array(6).fill(0).map((_, i) => ( + + Is it accessible? + Yes. It adheres to the WAI-ARIA design pattern. + + ))} + +
+
+ ); +}; diff --git a/src/components/common/Footer/index.tsx b/src/components/common/Footer/index.tsx new file mode 100644 index 0000000..9b7f4f5 --- /dev/null +++ b/src/components/common/Footer/index.tsx @@ -0,0 +1,10 @@ +export const Footer = () => { + return ( +
+

+ @{new Date().getFullYear()}. All rights reserved. + Powered by TarotSol AI +

+
+ ); +}; diff --git a/src/components/pages/game/game.tsx b/src/components/pages/game/game.tsx new file mode 100644 index 0000000..0fc0aee --- /dev/null +++ b/src/components/pages/game/game.tsx @@ -0,0 +1,90 @@ +import { zodResolver } from '@hookform/resolvers/zod'; +import { useWallet } from '@solana/wallet-adapter-react'; +import { useEffect } from 'react'; +import { SubmitHandler, useForm } from 'react-hook-form'; +import { toast } from 'react-toastify'; +import { z } from 'zod'; + +import { ConnectWalletButton } from '@/components/common/Header/connect-wallet-button'; +import { Button } from '@/components/ui/button'; +import { Input } from '@/components/ui/input'; +import useMakePrediction from '@/hooks/contracts/write/use-make-prediction'; + +const TarotRequestSchema = z.object({ + question: z + .string() + .min(3) + .max(1000) + .regex(/^[a-zA-Z0-9.,!? ]+$/, 'Only English letters and numbers are allowed') + .refine((value) => value.trim() !== '', { message: 'String cannot consist of only spaces' }), +}); + +type TarotRequestSchemaType = z.infer; + +export const GameSection = () => { + const { publicKey } = useWallet(); + const { mutateAsync: transfer, isSuccess, isPending, data: predictionAnswer } = useMakePrediction(); + + const { + register, + handleSubmit, + watch, + setValue, + formState: { errors }, + } = useForm({ resolver: zodResolver(TarotRequestSchema) }); + + const onSubmit: SubmitHandler = async (data, e) => { + e?.preventDefault(); + console.log('SubmitHandler data', data); + await transfer(watch('question').trim()); + }; + + useEffect(() => { + if (predictionAnswer) { + setValue('question', predictionAnswer + '\n' + watch('question')); + } + }, [isSuccess, predictionAnswer, setValue, watch]); + + return ( +
+

Game Page

+
+ {errors.question.message}} + > +