Skip to content

Commit

Permalink
Merge pull request #58 from punky-lab/yhy-update-12
Browse files Browse the repository at this point in the history
Yhy update 12
  • Loading branch information
FrozenArcher authored Dec 16, 2024
2 parents d1f9aac + b8a19f8 commit 1621a61
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 437 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test Build

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

env:
BASE_URL: https://testing.punky.app/api/v1

jobs:
build:
name: Test build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install # will run `yarn install` command

- name: "Create env file"
run: |
touch .env
echo NEXT_PUBLIC_OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }} >> .env
echo NEXT_PUBLIC_APP_PLATFORM=telegram >> .env
echo NEXT_PUBLIC_API_BASE_URL=${{ env.BASE_URL }} >> .env
- name: Build the app
uses: borales/actions-yarn@v4
with:
cmd: build # will run `yarn build` command
21 changes: 3 additions & 18 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
"use client";

import Store from "@/components/MainUI/Store";
import Achieve from "@/components/MainUI/achieve";
import User from "@/components/MainUI/User";
import { UIState } from "@/lib/UI";
import { ReactNode, useCallback, useState } from "react";
import Wallet from "@/components/MainUI/Wallet";
import Init from "@/components/MainUI/Init";

export default function Home() {
const [currentUI, setCurrentUI] = useState<UIState>("main");
const popUpClose = useCallback(() => setCurrentUI("main"), []);

const UIShowing = new Map<UIState, ReactNode>([
["main", <Init key="main" switchTo={(target) => setCurrentUI(target)} />],
["store", <Store key="store" onClose={popUpClose} />],
["user", <User key="user" onClose={popUpClose} />],
["achieve", <Achieve key="achieve" onClose={popUpClose} />],
["wallet", <Wallet key="wallet" onClose={popUpClose} />]
]);

return (
<div className="h-screen w-screen bg-[url('../assets/scenes/main.webp')] bg-cover bg-top text-white overflow-hidden">
<div className="overflow-y-auto h-full">{UIShowing.get(currentUI)}</div>
<div className="overflow-y-auto h-full">
<Init />
</div>
</div>
);
}
6 changes: 1 addition & 5 deletions components/MainUI/Init.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ import type { Account } from "@ant-design/web3";

export type PageState = "chat" | "shop" | "info" | "user";

export default function Init({
switchTo,
}: {
switchTo: (target: UIState) => void;
}) {
export default function Init() {
const [currentPage, setCurrentPage] = useState<PageState>("chat");
const [isActionOpen, setIsActionOpen] = useState(false);
const [isSlideOpen, setIsSlideOpen] = useState(false);
Expand Down
232 changes: 0 additions & 232 deletions components/MainUI/Main.tsx

This file was deleted.

60 changes: 0 additions & 60 deletions components/MainUI/Store.tsx

This file was deleted.

Loading

0 comments on commit 1621a61

Please sign in to comment.