Skip to content

fix(www): update use-toast file extension in docs and fix component source fileName resolution #7324

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

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

Conversation

a-jih
Copy link

@a-jih a-jih commented May 2, 2025

Description

Fixes: #7320

  • Updates the Toast docs to use the correct file extension for use-toast.ts.
  • Fixes an issue in rehype-component.ts where the path provided by fileName is not correctly resolved.
    • This affected the toaster.tsx and use-toast.ts component sources in manual installation documentation.

Screenshots

With these changes, the documentation now displays the correct Toast component/hook files.

Screenshot 2025-05-02 at 1 06 58 PM Screenshot 2025-05-02 at 1 07 09 PM

a-jih added 2 commits May 2, 2025 11:56
The `files` array in `Index` are now all objects, not strings. As such,
the `typeof file === 'string'` condition is never satisfied and, in
the example of toast, will never correctly resolve the `toaster.tsx`
and `use-toast.ts` file names and default to `component.files[0]?.path`
(`toast.tsx` in our example).

Let's update this condition to check against `file.path` instead and return
`.path` if a matching file name is found.
Copy link

vercel bot commented May 2, 2025

@a-jih is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@a-jih a-jih mentioned this pull request May 2, 2025
2 tasks
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.

[bug]: toast docs
1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy