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

add new sample: react shadcn dashboard #5337

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

Conversation

Sandeep-FED
Copy link
Contributor

@Sandeep-FED Sandeep-FED commented Nov 10, 2024

  • New sample
  • Bug fix/update
  • Related issues: fixes #X, partially #Y, mentioned in #Z

What's in this Pull Request?

This sample provides developers the ability to use ShadCN component in their webpart.

Node version used:
18.18.2

  • My pull request affects only ONE sample.
  • My sample builds without any warnings
  • I have updated the README.md file's Version history. For new samples, created a new README.md file matching this template
  • My README.md has at least one static high-resolution screenshot (i.e. not a GIF) located in the assets folder.
  • My README.md contains complete setup instructions, including pre-requisites and permissions required
  • My solution includes a .nvmrc file indicating the version of Node.js

@hugoabernier
Copy link
Collaborator

hugoabernier commented Nov 16, 2024

Hi @Sandeep-FED thank you for this sample! I am getting the following errors when attempting to build the solution:
image

Can you test that your solution builds from a clean environment and/or update your instructions please?

As this is intended to be a sample to help newcomers, we want to make sure that the instructions help them build the sample without issues.

@Sandeep-FED
Copy link
Contributor Author

Hi @hugoabernier , I have updated the readME.md with more info.

Please follow below steps:

  • create a new folder under src/utilities as lib/util.ts
  • add below CN helper code to it.
    import { clsx, type ClassValue } from "clsx"
    import { twMerge } from "tailwind-merge"
    export function cn(...inputs: ClassValue[]) {
    return twMerge(clsx(inputs))
    }

For more info: check 6th step in this: https://ui.shadcn.com/docs/installation/manual

@hugoabernier
Copy link
Collaborator

hugoabernier commented Nov 25, 2024

@Sandeep-FED can you help me understand why you would not add it to the sample instead of asking people to copy and paste that code in?

We need the samples to be as complete as possible for our community members to be able to use it easily

@Sandeep-FED
Copy link
Contributor Author

Sandeep-FED commented Nov 27, 2024

@hugoabernier, I know its not a straight forward approach, but this is how the ShadCN works in SPFx, that's why I wrote an blog about this.

blog link

I saw developers struggling to build SPFx with ShadCN components. I thought this might be useful for them.

Anyway no issues, if this doesn't make sense, please close this PR.

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.

2 participants