-
Notifications
You must be signed in to change notification settings - Fork 107
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
Show download button only for the OS of the client-device. #254
base: master
Are you sure you want to change the base?
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
website/src/pages/index.tsx
Outdated
{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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{
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.js
to detect OS at the client-side, only display the corresponding button and Github-repo-link.