Help finishing my widget
This is my first time contribution to the project and I am terrible with css since I work more with backend stuff.
1 . I need help understanding how to add descriptions to widget
2 . I need help trying to make my widget look good preferebly make it smaller
Here is the code https://github.com/cacpmw/homarr/blob/widget/bitcoin/src/widgets/bitcoin/BitcoinWidgetTile.tsx
GitHub
homarr/src/widgets/bitcoin/BitcoinWidgetTile.tsx at widget/bitcoin ...
Customizable browser's home page to interact with your homeserver's Docker containers (e.g. Sonarr/Radarr) - cacpmw/homarr
Solution:Jump to solution
GitHub
Widget: Bitcoin by cacpmw · Pull Request #1999 · ajnart/homarr
Category
Widget
Overview
A very simple bitcoin widget to fetch current price in USD and EUR plus the current recommended fees per transaction. It uses the free mempool api
I intend to improve this ...
34 Replies
Thank you for submitting a support request.
Depending on the volume of requests, our team should get in contact with you shortly.
⚠️ Please include the following details in your post or we may reject your request without further comment: - Log (See https://homarr.dev/docs/community/faq#how-do-i-open-the-console--log) - Operating system (Unraid, TrueNAS, Ubuntu, ...) - Exact Homarr version (eg. 0.15.0, not latest) - Configuration (eg. docker-compose, screenshot or similar. Use ``your-text`` to format) - Other relevant information (eg. your devices, your browser, ...)
❓ Frequently Asked Questions | Homarr documentation
Can I install Homarr on a Raspberry Pi?
Hi, We like the idea of a cryptocurrency widget.
Those are things that we might say once you make the PR but you might be interested to know it already:
Would it be possible to have a more advanced one that does more than just Bitcoin?
Is there any selfhosted app about crypto on which it could be based instead? (Since almost all our widgets are about selfhosting)
For your questions:
Description and name are set in the translation files.
Sizing: use the h and w parameters to 100% to make sure they do not grow bigger than needed and search about flex.
Personally I would put the image smaller on the left side with a price stack on the right.
Hi @Carlos Carneiro I can help you if needed. I’ll try to find if there is a self-hosting app for crypto.There are some websites for that.
I dont know many crypto apis. Also since I am not familiar with Homarr from a dev point of view I decided I wanted to a small contribution first. My plan is to increment this widget over time. I want to make it possible to verify transactions just by inputting an address too.
I wanted to make it smaller but I terrible at styling things @Yossi if you can make my widget look good Id owe you one
API's can be tricky, which is why we prefer the ones from selfhosting.
If you want to make a small contribution first, there are a few "good first issue" to tackle that we leave purposely for learning.
If you want to stick to that one it's fine too, but you're going to have a lot of request really fast about doing more on the widget so I'd suggest doing them from the get go. (Also people doing their own updates on it, so potentially impeding your gradual work on it)
Transactions may be a big security concern that goes way out of what homarr is, but I don't know enough about it to be sure, so just saying.
About the styling, since you're learning maybe you can try yourself a bit more with the clues I gave, it's a good opportunity and I think you'd be capable with the context of my previous message.
All bitcoin transactions are public. When we lookup for a transaction by address we see all the public available information about that. Like when I am expecting some bitcoin i want to see how many confirmations are there for example and that is public available but i just dont wanna leave my dashboard.
As of other people coming and contributing to this widget I am ok with that. But I will implement other functionalities already. I am feeling comfortable with it.
As of my styling capabilities I have already tried a lot to learn how to work with css that is the one thing I can never learn.
Anyway I will try a bit more making it look beautiful and also find some selfhosted btc api but I dont think I will be successful on those ones
Anyway I will try a bit more making it look beautiful and also find some selfhosted btc api but I dont think I will be successful on those ones
No need for CSS here, it's pure HTML
ok I will remove css and make it as simple as possible. Anyone willing to jumping and beautify it with styling is welcome
About bitcoin selfhosted api, it might be possible to get information from a selfhosted bitcoin node I am not sure though
Had you actually done everything about styling in a CSS file on the side? everything can be done in the HTML part, even styling can be done in there.
After a bit of research, it is true that selfhosted option for market monitoring doesn't seem to be that widespread if existing at all.
Then I would only ask to use the most reliable and known source if possible. I think most website have an API, you just have to explicitly search for it.
This is my new style
The Mempool Open Source Project®
Explore the full Bitcoin ecosystem with mempool.space
and I just found out that they have their own node package
@mempool/mempool.js
Yeah but that API is limited to bitcoin isn't it? Wouldn't it be better to have a tracker for a lot of crypto coins?
The only one I know of is Binance and they have an API. No idea if they are trustworthy enough.
Yes mempool only supports bitcoin. It is a consensus between the cryptocurrency community that all other coins are called "shitcoins". Anyway, if anyone else would like to jumping on this one with me to add more coins is welcome.
I my self only own bitcoins
regarding binance is involved in a lot of scandals plus it is a chinese company which makes me frown upon them when it comes to trusting
Yeah there's a lot of that in the crypto space which is why I don't really like it.
I think delivering data on all coins is best as most people will have shitcoins they want to follow.
Can someone help understand what is wrong with my useEffect
I am getting this error I cant seem to see the mistake:
Not sure you can make an api call inside a useEffect
You don't need to save the value from the API btw, not sure what you're trying to do here
I have an input field that should make api calls everytime input changes. I was avoiding to use a submit button but I guess I will have to use it
Yeah, never do that
Just intercept the "enter" key and a button with onclick
Also, you can use the onChange event of the textbox for that, but again, never make calls like that. If one user types out the whole thing by hand, it's gonna make a call every keystroke. That's bad
I know that. Usually users paste bitcoin addresses but the OnChange doesnt capture pasting
Cant find the where should be stored the translation files
Is there any code contributor docs?
💻 Developer Guides | Homarr documentation
Hold on! This is a technical documentation that
Like I said, doesn't matter anyway, only capture the enter key.
You might need to create one for your widget
public\locales\en\modules
I did that but was unsure. Do I have to make it for every language out there?
No no no, only english. Don't do anything other than english
check this out
i made the bitcoin module on the en folder
Translation doesn't play nice with hot reloading, restart the debugging
working!!!
That's great :) Remember, any string that a user can see must be translatable, so use that file extensively
okay
Okay, so I finished. I removed the option to input address for now cuz I couldnt get a nice solution. Hopefully I will improve it with more features.
Solution
GitHub
Widget: Bitcoin by cacpmw · Pull Request #1999 · ajnart/homarr
Category
Widget
Overview
A very simple bitcoin widget to fetch current price in USD and EUR plus the current recommended fees per transaction. It uses the free mempool api
I intend to improve this ...