scalefree0x / cartesi-werewolf

Apache License 2.0
3 stars 0 forks source link

Add frontend-app base #8

Closed AaronTheBruce closed 9 months ago

AaronTheBruce commented 9 months ago

Using the cartesi-web-frontend I added tailwindcss and daisyui as a component style library.

I added react-redux for handling global state across the application. I added the base for a Session state. Will be more to come here for sure.

I moved the original cartesi frontend components into the components/ folder and an additional cartesi/ sub-folder for storing these files. This way they won't get cluttered.

I decided to use react-router-dom, since we are already using vanilla react. To migrate with nextjs when we have config-overrides happening, I didn't want the headache to config it.

Currently, I have the base page for a homepage and a route for handling 404 routes. With this, we should be ready to rock and roll.

Current State:

Homepage

image

Game

image

7

AaronTheBruce commented 9 months ago

Connection to metamask is not persisting between pages.

amcritchie commented 9 months ago

@AaronTheBruce, I'm excited to get your front end working. I followed your readme and am getting an application error upon loading the application. Any thoughts?

// Upon loading http://localhost:3000/

ERROR in src/App.tsx:15:33
TS1149: File name '/Users/amcritchie/alex-apps/cartesi/cartesi-werewolf/frontend-web-cartesi/src/router/routes.tsx' differs from already included file name '/Users/amcritchie/alex-apps/cartesi/cartesi-werewolf/frontend-web-cartesi/src/router/Routes.tsx' only in casing.
  The file is in the program because:
    Imported via "./router/Routes" from file '/Users/amcritchie/alex-apps/cartesi/cartesi-werewolf/frontend-web-cartesi/src/App.tsx'
    Root file specified for compilation
    Imported via './Routes' from file '/Users/amcritchie/alex-apps/cartesi/cartesi-werewolf/frontend-web-cartesi/src/router/index.tsx'
    Imported via "./router/routes" from file '/Users/amcritchie/alex-apps/cartesi/cartesi-werewolf/frontend-web-cartesi/src/App.tsx'
    13 | import { FC } from "react";
    14 | import Routes from "./router/Routes";
  > 15 | import { werewolf_routes } from "./router/routes";
       |                                 ^^^^^^^^^^^^^^^^^
    16 | import { TopBar } from "./components/cartesi/top-bar";
    17 |
    18 | const App: FC = () => {
AaronTheBruce commented 9 months ago

@amcritchie Try upgrading your node to v21.6.1, reinstall your local packages with yarn and re-up with yarn start