Skip to content

Commit

Permalink
Feature/user menu issue 61 (#63)
Browse files Browse the repository at this point in the history
* add ProfileModal

* add BrowserViewProfile view value in constants

* Update astro.config.mjs

* upgrade astrojs tov5

* upgrade to v5 getEntry change signature and ViewTransition renamed to ClientRouter

* update storybook to use mock ws (not working at the moment)

* update menu

* fix RegisterForm layout

---------

Co-authored-by: Daniele Guido <1181642+danieleguido@users.noreply.github.com>
  • Loading branch information
danieleguido and danieleguido authored Dec 6, 2024
1 parent a51cdca commit f269ea6
Show file tree
Hide file tree
Showing 21 changed files with 1,029 additions and 957 deletions.
13 changes: 13 additions & 0 deletions .storybook/mocks-ws.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// src/mocks/handlers.js
import { ws } from "msw"

const chat = ws.link("/mock-socket.io")

export const handlers = [
chat.addEventListener("connection", ({ client }) => {
console.log("Client connected")
client.addEventListener("message", (event) => {
client.send("hello from server!")
})
}),
]
12 changes: 9 additions & 3 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import type { Preview } from "@storybook/react"
// import { initialize, mswLoader } from "msw-storybook-addon"
import { initialize, mswLoader } from "msw-storybook-addon"

import "./fonts.css"
import "bootstrap/dist/css/bootstrap.min.css"
import "../src/styles/global.css"
import { handlers } from "./mocks-ws"

/*
* Initializes MSW
* See https://github.com/mswjs/msw-storybook-addon#configuring-msw
* to learn how to customize it
*/
// initialize()
initialize()

const preview: Preview = {
parameters: {
Expand All @@ -20,8 +21,13 @@ const preview: Preview = {
date: /Date$/i,
},
},
msw: {
handlers: {
chat: handlers,
},
},
},
// loaders: [mswLoader], // 👈 Add the MSW loader to all stories
loaders: [mswLoader], // 👈 Add the MSW loader to all stories
}

export default preview
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ WORKDIR /app
COPY package*.json ./

# Install dependencies
RUN npm install
RUN npm install --legacy-peer-deps

# Copy the rest of the application code
COPY public ./public
Expand Down
14 changes: 11 additions & 3 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import dotenv from "dotenv"

console.log("NODE_ENV:", process.env.NODE_ENV)
dotenv.config({
path: [".env", ".env.local", `.env.${process.env.NODE_ENV}`],
path: [
".env",
".env.local",
`.env.${process.env.NODE_ENV}`,
`.env.${process.env.NODE_ENV}.local`,
],
debug: true,
override: true,
})
Expand Down Expand Up @@ -34,6 +39,9 @@ if (process.env.NODE_ENV === "development") {
// https://astro.build/config
export default defineConfig({
integrations: [react(), mdx()],
legacy: {
collections: true,
},
site: process.env.PUBLIC_IMPRESSO_DATALAB_SITE || "http://localhost:4321",
base: process.env.PUBLIC_IMPRESSO_DATALAB_BASE || "/",
ssr: {
Expand All @@ -54,7 +62,7 @@ export default defineConfig({
"[PROXY WS]",
path,
"->",
`${WsApiTarget}${rewrittenPath}`,
`${WsApiTarget}${rewrittenPath}`
)
return rewrittenPath
},
Expand All @@ -70,7 +78,7 @@ export default defineConfig({
"[PROXY]",
path,
"->",
`${PublicApiTarget}${rewrittenPath}`,
`${PublicApiTarget}${rewrittenPath}`
)
return rewrittenPath
},
Expand Down
Loading

0 comments on commit f269ea6

Please sign in to comment.