Show download button only for the OS of the client-device.#254
Show download button only for the OS of the client-device.#254agent515 wants to merge 3 commits into
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/ritz078/moose/9sp24l5uu |
|
It detects my mac to be a linux. |
|
platform.js might be buggy |
Ohh, should I use different package or try out different versions? I tried |
|
Why not use Also, if it doesn't match any platform, we should show all the options. |
It is an object. So, converted into a string to use regex.
When I comment out GitHub-link, Mac link looks fine. I am not able to understand what's causing this problem. I have made some changes still couldn't resolve that issue. Making some pushes to see if anything is improved. |
Use React component to show Download Buttons
dee7c19 to
c98e3fd
Compare
| {flag && ( | ||
| <DownloadButton url={macUrl} logo={mdiApple} disabled={false} /> | ||
| )} | ||
| {flag && ( | ||
| <DownloadButton logo={mdiMicrosoftWindows} disabled={true} /> | ||
| )} | ||
| {flag && ( | ||
| <DownloadButton | ||
| url={linuxUrl} | ||
| logo={mdiLinux} | ||
| disabled={false} | ||
| /> | ||
| )} | ||
| { | ||
| <DownloadButton | ||
| url="https://github.com/ritz078/moose" | ||
| logo={mdiGithub} | ||
| disabled={false} | ||
| /> |
There was a problem hiding this comment.
{
flag && (
<>
<DownloadButton url={macUrl} logo={mdiApple} disabled={false} />
<DownloadButton logo={mdiMicrosoftWindows} disabled={true} />
<DownloadButton url={linuxUrl} logo={mdiLinux} disabled={false} />
<DownloadButton
url="https://github.com/ritz078/moose"
logo={mdiGithub}
disabled={false}
/>
</>
);
}
In that case you can use
Can you try adding a unique See https://kentcdodds.com/blog/understanding-reacts-key-prop Also I am thinking that we should have other links too in case someone wants to download a build of other platform. In the above image "Download for other platforms" is a button. If you click on it, all the links show up. WDYT ? |
|
closed by mistake. |




Fix #236
Using
platform.jsto detect OS at the client-side, only display the corresponding button and Github-repo-link.