From 43459be8c520bdb46bb1fa64bcbacd01368a47fa Mon Sep 17 00:00:00 2001 From: alirehmani Date: Mon, 6 May 2024 17:35:56 +0500 Subject: [PATCH] update --- definition-web-ui | 4 ++ src/Managing.WebApp/.gitignore | 2 + src/Managing.WebApp/Dockerfile-web-ui-dev | 32 ++++++++++++++ src/Managing.WebApp/package.json | 11 ++--- src/Managing.WebApp/src/app/routes/index.tsx | 2 +- .../components/mollecules/LogIn/Profile.tsx | 44 +++++++++---------- .../src/pages/desk/deskWidget.tsx | 4 +- 7 files changed, 70 insertions(+), 29 deletions(-) create mode 100644 definition-web-ui create mode 100644 src/Managing.WebApp/Dockerfile-web-ui-dev diff --git a/definition-web-ui b/definition-web-ui new file mode 100644 index 0000000..4c42427 --- /dev/null +++ b/definition-web-ui @@ -0,0 +1,4 @@ +{ + "schemaVersion": 2, + "dockerfilePath": "./src/Managing.WebApp/Dockerfile-web-ui-dev" + } \ No newline at end of file diff --git a/src/Managing.WebApp/.gitignore b/src/Managing.WebApp/.gitignore index d451ff1..4e51f6b 100644 --- a/src/Managing.WebApp/.gitignore +++ b/src/Managing.WebApp/.gitignore @@ -3,3 +3,5 @@ node_modules dist dist-ssr *.local + +.env \ No newline at end of file diff --git a/src/Managing.WebApp/Dockerfile-web-ui-dev b/src/Managing.WebApp/Dockerfile-web-ui-dev new file mode 100644 index 0000000..98a400a --- /dev/null +++ b/src/Managing.WebApp/Dockerfile-web-ui-dev @@ -0,0 +1,32 @@ +# Stage 1: Build the Vite application +FROM node:20 AS builder + +# Set the working directory in the container +WORKDIR /app + +# Copy the package.json and package-lock.json first to leverage Docker's cache +COPY package*.json ./ + +# Install dependencies +RUN npm ci --only=production + +# Copy the application code +COPY . . + +# Build the Vite application +RUN npm run build + +# Stage 2: Create the runtime image +FROM nginx:alpine + +# Copy the built Vite application from the builder stage +COPY --from=builder /app/dist /usr/share/nginx/html + +# Copy a custom Nginx configuration file (if you need one) +# COPY nginx.conf /etc/nginx/nginx.conf + +# Expose port 80 +EXPOSE 80 + +# Start the Nginx server +CMD ["nginx", "-g", "daemon off;"] diff --git a/src/Managing.WebApp/package.json b/src/Managing.WebApp/package.json index 39f3f07..a86d331 100644 --- a/src/Managing.WebApp/package.json +++ b/src/Managing.WebApp/package.json @@ -18,13 +18,14 @@ "dependencies": { "@heroicons/react": "^1.0.6", "@microsoft/signalr": "^6.0.5", - "@tanstack/react-query": "^4.33.0", + "@tanstack/react-query": "^5.0.0", "@wagmi/chains": "^0.2.9", - "@wagmi/core": "^1.3.9", + "@wagmi/connectors": "^4.3.2", + "@wagmi/core": "^2.9.0", "@walletconnect/universal-provider": "^2.8.6", "axios": "^0.27.2", "classnames": "^2.3.1", - "connectkit": "^1.1.3", + "connectkit": "^1.7.3", "date-fns": "^2.30.0", "jotai": "^1.6.7", "lightweight-charts": "git+https://github.com/ntf/lightweight-charts.git", @@ -44,8 +45,8 @@ "react-table": "^7.8.0", "react-toastify": "^9.0.1", "reactflow": "^11.8.3", - "viem": "^1.4.2", - "wagmi": "^1.3.10", + "viem": "^2.0.6", + "wagmi": "^2.2.1", "web3": "^4.0.2", "zustand": "^4.4.1" }, diff --git a/src/Managing.WebApp/src/app/routes/index.tsx b/src/Managing.WebApp/src/app/routes/index.tsx index 74bcb4f..9202289 100644 --- a/src/Managing.WebApp/src/app/routes/index.tsx +++ b/src/Managing.WebApp/src/app/routes/index.tsx @@ -2,7 +2,7 @@ import { Suspense, lazy } from 'react' import { Route, Routes } from 'react-router-dom' import LayoutMain from '../../layouts' -import Desk from '../../pages/desk/desk' +import Desk from '../../pages/desk/Desk' import Scenario from '../../pages/scenarioPage/scenario' import Tools from '../../pages/toolsPage/tools' import Workflows from '../../pages/workflow/workflows' diff --git a/src/Managing.WebApp/src/components/mollecules/LogIn/Profile.tsx b/src/Managing.WebApp/src/components/mollecules/LogIn/Profile.tsx index 06f3d42..6292525 100644 --- a/src/Managing.WebApp/src/components/mollecules/LogIn/Profile.tsx +++ b/src/Managing.WebApp/src/components/mollecules/LogIn/Profile.tsx @@ -1,26 +1,26 @@ import { useConnect } from 'wagmi' -export function Profile() { - const { connect, connectors, error, isLoading, pendingConnector } = - useConnect() +// export function Profile() { +// const { connect, connectors, error, isLoading, pendingConnector } = +// useConnect() - return ( -
- {connectors.map((connector) => ( - - ))} +// return ( +//
+// {connectors.map((connector) => ( +// +// ))} - {error &&
{error.message}
} -
- ) -} +// {error &&
{error.message}
} +//
+// ) +// } diff --git a/src/Managing.WebApp/src/pages/desk/deskWidget.tsx b/src/Managing.WebApp/src/pages/desk/deskWidget.tsx index b7244fb..a2c8784 100644 --- a/src/Managing.WebApp/src/pages/desk/deskWidget.tsx +++ b/src/Managing.WebApp/src/pages/desk/deskWidget.tsx @@ -6,7 +6,7 @@ const loadWidget = (component: any) => { return React.lazy(() => import(`./widgets/${component}.tsx`)) } -export const DeskWidget = React.forwardRef((props: any, ref) => { +const DeskWidget = React.forwardRef((props: any, ref) => { const widget = props const widgetProperties = widget['data-properties'] as IWidgetProperties const WidgetComponent = loadWidget(widgetProperties.id) @@ -19,3 +19,5 @@ export const DeskWidget = React.forwardRef((props: any, ref) => { ) }) + +export default DeskWidget \ No newline at end of file