From 2361e1dd7ce3074b860966211dd825cec40acaf8 Mon Sep 17 00:00:00 2001 From: Afo Date: Sat, 14 Sep 2024 00:48:53 -0700 Subject: [PATCH 1/3] polishing work for UI --- packages/app/src/constants.ts | 6 -- packages/app/src/types/greengoods.d.ts | 5 -- packages/app/src/views/Profile/index.tsx | 56 ------------- packages/client/dev-dist/sw.js | 2 +- packages/client/index.html | 6 +- packages/client/package.json | 1 + packages/client/src/App.tsx | 11 ++- packages/client/src/components/Button.tsx | 4 +- .../client/src/components/Form/Progress.tsx | 9 +++ .../client/src/components/Garden/Actions.tsx | 22 ++++-- .../client/src/components/Layout/AppBar.tsx | 15 +--- .../client/src/components/Layout/Footer.tsx | 2 +- .../client/src/components/Layout/Hero.tsx | 51 ++---------- .../client/src/components/Layout/Splash.tsx | 4 +- packages/client/src/constants.ts | 2 + packages/client/src/index.css | 39 ++++----- packages/client/src/modules/greengoods.ts | 28 ++++++- .../client/src/providers/GardenProvider.tsx | 6 +- .../client/src/providers/UserProvider.tsx | 7 +- .../client/src/providers/WorkProvider.tsx | 12 +++ packages/client/src/views/Gardens/Card.tsx | 19 ++--- packages/client/src/views/Gardens/Garden.tsx | 63 ++++++++------- packages/client/src/views/Gardens/index.tsx | 38 +++++---- packages/client/src/views/Landing/index.tsx | 51 +++++++++++- packages/client/src/views/Profile/Account.tsx | 66 ++++++++-------- packages/client/src/views/Profile/Help.tsx | 79 ++++++++++++------- packages/client/src/views/Profile/Setting.tsx | 63 +++++++++++++++ packages/client/src/views/Profile/index.tsx | 49 +++++++----- packages/client/src/views/Work/Intro.tsx | 15 ++++ packages/client/src/views/Work/index.tsx | 75 ++++++++++++++---- packages/client/src/views/index.tsx | 3 +- packages/client/vite.config.ts | 2 +- 32 files changed, 481 insertions(+), 330 deletions(-) delete mode 100644 packages/app/src/constants.ts delete mode 100644 packages/app/src/types/greengoods.d.ts delete mode 100644 packages/app/src/views/Profile/index.tsx create mode 100644 packages/client/src/views/Profile/Setting.tsx create mode 100644 packages/client/src/views/Work/Intro.tsx diff --git a/packages/app/src/constants.ts b/packages/app/src/constants.ts deleted file mode 100644 index 918da13..0000000 --- a/packages/app/src/constants.ts +++ /dev/null @@ -1,6 +0,0 @@ -export const WORK_SCHEMA_UID = - "0x9341009d07b8de3eb72b96ac42246c549f3e32636cb31a75961fbee6db44a0eb"; -export const WORK_APPROVAL_SCHEMA_UID = - "0x019249c30ec1d02ae41abb3fbbeeb56b9bbb2261cf94191fac73089308aa662a"; -export const GARDEN_ASSESSMENT_SCHEMA_UID = - "0x7433e24287be826b49e5eb28cd52192823e542521c94084a691e67e5cc7e8176"; diff --git a/packages/app/src/types/greengoods.d.ts b/packages/app/src/types/greengoods.d.ts deleted file mode 100644 index 9f414c9..0000000 --- a/packages/app/src/types/greengoods.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare interface Garden {} -declare interface GardenAssessment {} -declare interface Action {} -declare interface Work {} -declare interface WorkApproval {} diff --git a/packages/app/src/views/Profile/index.tsx b/packages/app/src/views/Profile/index.tsx deleted file mode 100644 index d91a5f6..0000000 --- a/packages/app/src/views/Profile/index.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import React from "react"; - -import { Web3Props } from "../../hooks/providers/web3"; -import { ProfileDataProps } from "../../../../client/src/views/Profile/useProfile"; - -import { ProfileInfo } from "../../../../client/src/views/Profile/Account"; -import { ProfileActions } from "../../components/Profile/Actions"; - -interface ProfileProps extends ProfileDataProps, Web3Props {} - -export const Profile: React.FC = ({ - avatarSpring, - address, - avatar, - name, - ready, - user, - wallets, - activeWallet, - sendTransaction, - zeroDevReady, - login, - logout, - error, -}) => { - const web3Props = { - address, - login, - logout, - error, - ready, - zeroDevReady, - user, - activeWallet, - wallets, - sendTransaction, - }; - - return ( -
-
- - -
-
- ); -}; - -export default Profile; diff --git a/packages/client/dev-dist/sw.js b/packages/client/dev-dist/sw.js index b869f79..316a4d8 100644 --- a/packages/client/dev-dist/sw.js +++ b/packages/client/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-c982e567'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "index.html", - "revision": "0.iuutgq7l69o" + "revision": "0.nfin5vsrpm8" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { diff --git a/packages/client/index.html b/packages/client/index.html index 3177631..0e11ece 100644 --- a/packages/client/index.html +++ b/packages/client/index.html @@ -60,7 +60,7 @@ name="msapplication-TileImage" content="/images/ms-icon-144x144.png" /> - + @@ -71,10 +71,10 @@ Green Goods - +
diff --git a/packages/client/package.json b/packages/client/package.json index 9142ca8..44ff21e 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -29,6 +29,7 @@ "react-intl": "6.6.8", "react-router-dom": "^6.26.1", "react-select": "5.8.0", + "react-spring-bottom-sheet": "3.4.1", "react-tailwindcss-datepicker": "^1.7.2", "zod": "^3.23.8" }, diff --git a/packages/client/src/App.tsx b/packages/client/src/App.tsx index 280a1b0..0d507df 100644 --- a/packages/client/src/App.tsx +++ b/packages/client/src/App.tsx @@ -14,13 +14,14 @@ import Views from "@/views"; import Login from "@/views/Login"; import Landing from "@/views/Landing"; import { Appbar } from "@/components/Layout/AppBar"; +import { CircleLoader } from "./components/Loader"; function App() { const { authenticated } = usePrivy(); const { isMobile, isInstalled } = usePWA(); - const { smartAccountReady } = useUser(); + const { authenticating, smartAccountReady } = useUser(); - const isDownloaded = isMobile && isInstalled; + const isDownloaded = isMobile; const isAuthenticated = authenticated && smartAccountReady; return ( @@ -37,7 +38,11 @@ function App() { path="/login" element={ isDownloaded ? - !isAuthenticated ? + !isAuthenticated && authenticating ? +
+ +
+ : !isAuthenticated ? : : diff --git a/packages/client/src/components/Button.tsx b/packages/client/src/components/Button.tsx index 9dbbd1c..cb9baee 100644 --- a/packages/client/src/components/Button.tsx +++ b/packages/client/src/components/Button.tsx @@ -60,9 +60,9 @@ export const Button = forwardRef( ref={ref} disabled={disabled} className={` - ${className} ${sizeClasses} ${styleClasses} ${fullWidth ? "w-full" : ""} + ${sizeClasses} ${styleClasses} ${fullWidth ? "w-full" : ""} inline-flex justify-center items-center gap-x-2 text-sm font-semibold rounded-lg - border disabled:pointer-events-none disabled:opacity-50 + border disabled:pointer-events-none disabled:opacity-50 ${className} `} {...props} > diff --git a/packages/client/src/components/Form/Progress.tsx b/packages/client/src/components/Form/Progress.tsx index db3285e..4b5a3d9 100644 --- a/packages/client/src/components/Form/Progress.tsx +++ b/packages/client/src/components/Form/Progress.tsx @@ -44,3 +44,12 @@ export const FormProgress = ({ currentStep, steps }: FormProgressProps) => { ); }; + +{ + /*
    +
  • Register
  • +
  • Choose plan
  • +
  • Purchase
  • +
  • Receive Product
  • +
*/ +} diff --git a/packages/client/src/components/Garden/Actions.tsx b/packages/client/src/components/Garden/Actions.tsx index 6cfbb59..30a034f 100644 --- a/packages/client/src/components/Garden/Actions.tsx +++ b/packages/client/src/components/Garden/Actions.tsx @@ -14,16 +14,24 @@ export const GardenActions: React.FC = ({ const [work, setWork] = useState(null); return ( -
-
    + <> +
      {actions.map((action) => ( -
    • -

      {action.title}

      -

      {action.instructions}

      +
    • + action + +

      {action.description}

    • ))}
    -

    Work

    +
    Work
      {works.map((work) => (
    • setWork(work)}> @@ -45,6 +53,6 @@ export const GardenActions: React.FC = ({ -
+ ); }; diff --git a/packages/client/src/components/Layout/AppBar.tsx b/packages/client/src/components/Layout/AppBar.tsx index dcc4078..6828d9c 100644 --- a/packages/client/src/components/Layout/AppBar.tsx +++ b/packages/client/src/components/Layout/AppBar.tsx @@ -33,21 +33,14 @@ export const Appbar = () => { const { pathname } = useLocation(); return ( -