Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend: Profile Page Tabs as URL Params #364

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

joshua-rdrgz
Copy link
Collaborator

This PR contains some changes that moves the active tab state into the URL, that way the user can navigate to different profile page tabs via the URL, and the app can dynamically switch tabs if it needs to.

Demonstration

Screenshot 2024-03-20 at 1 31 54 PM Screenshot 2024-03-20 at 1 31 38 PM Screenshot 2024-03-20 at 1 32 31 PM

@joshua-rdrgz
Copy link
Collaborator Author

Build Command Replacement

With the implementation of this feature, I had to switch the "/profile" page to an SSR page instead of a static page -- this meant that using next export for the build commands was no longer feasible for the entire application (see more here). I've changed the build commands from next export to next start, which will spin up a NodeJS server capable of SSR for the "/profile" page. I've also removed next export from the build:ui command, as adding next start to this particular command causes the build tests to never finish (the spun up server will never spin back down).

  "scripts": {
    "build:dev": "env-cmd -f .env.development next build && next start",
    "build:stage": "env-cmd -f .env.staging next build && next start",
    "build:prod": "env-cmd -f .env.production next build && next start",
    "build:ui": "env-cmd -f .env.ui next build",
  },

@mikeyavorsky
Copy link
Collaborator

&& next start will break Dockerfile.cloud as written. We need to either background that task or remove && next start from the rest of the commands in package.json, and write a separate start: next start command.

@mikeyavorsky mikeyavorsky self-requested a review April 3, 2024 00:18
"build:ui": "env-cmd -f .env.ui next build && next export",
"build:dev": "env-cmd -f .env.development next build && next start",
"build:stage": "env-cmd -f .env.staging next build && next start",
"build:prod": "env-cmd -f .env.production next build && next start",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove these && next start and add a command "start": "next start", or edit Dockerfile.cloud to add a & to the end of the npm run build:{... command.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do both of these things? I've adjusted the build commands to remove next start from them -- do I need to add & npm run start to the Dockerfile.cloud RUN command as well?

"scripts": {
    "build:dev": "env-cmd -f .env.development next build",
    "build:stage": "env-cmd -f .env.staging next build",
    "build:prod": "env-cmd -f .env.production next build",
    "build:ui": "env-cmd -f .env.ui next build",
    "start": "next start",
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants