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

chore(dashboard): render main layout as home page for v2 #6823

Merged
merged 4 commits into from
Mar 26, 2024
Merged

Conversation

riqwan
Copy link
Contributor

@riqwan riqwan commented Mar 26, 2024

Trying to keep these dashboard PRs short.

what:

  • renders an empty order page as home page to showcase the main layout

Currently it renders settings page as the default home page, this PR moves that over to the orders page, which will be currently empty, but it renders the main layout where most of the v2 work will be done

Screenshot 2024-03-26 at 09 43 23

Copy link

vercel bot commented Mar 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference 🔄 Building (Inspect) Visit Preview Mar 26, 2024 1:48pm
medusa-dashboard ❌ Failed (Inspect) Mar 26, 2024 1:48pm
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
docs-ui ⬜️ Ignored (Inspect) Visit Preview Mar 26, 2024 1:48pm
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Mar 26, 2024 1:48pm

Copy link

changeset-bot bot commented Mar 26, 2024

⚠️ No Changeset found

Latest commit: 0d6852d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

}

const Header = () => {
const { store, isError, error } = useV2Store({})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

only thing that changes here is the v2Store call. Lmk if this is the desired approach.

Copy link
Contributor

@kasperkristensen kasperkristensen left a comment

Choose a reason for hiding this comment

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

LGTM, added a comment on the useV2Store hook, but feel free to ignore it as its not really related to your PR.

@@ -8,7 +8,7 @@ export const useV2Store = ({ initialData }: { initialData?: any }) => {
{ initialData }
)

const store = data.stores[0]
const store = data?.stores[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: not really related to your PR, but make sense to manually set the error in the case where isLoading is false and the stores array is empty, to have the same effect as if the current useAdminStore endpoint fails. Otherwise, you might end up with a false positive, where loading is completed and no error is thrown, but at the same time store is undefined, causing the admin to break.

riqwan added 2 commits March 26, 2024 14:42
Comment on lines +13 to +15
if (!isLoading && !isError && typeof store === "undefined") {
throw new Error("Store does not exist")
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kasperkristensen is this what you mean?

@riqwan riqwan merged commit 448a30d into develop Mar 26, 2024
23 of 24 checks passed
@riqwan riqwan deleted the feat/v2-basis branch March 26, 2024 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants