Open cmheisel opened 5 years ago
Hi @cmheisel,
I think we could employ some heuristic to support both out of the box, before resorting to an additional name parameter.
Something along the lines of isNativeUrl(url) ? getAppNameFromNativeUrl(url) : getHostnameFromWebUrl(url)
.
Are you interested in making this contribution?
fwiw, i've changed the steps
data structure to:
[{
name: 'Extract all mental tasks to a list',
links: [
{ name: '🗒 Trello', url: 'trello://x-callback-url/showBoard?x-source=jobs-done&id=59e9dc0dd6c3de4e51ae29ea' },
{ name: '✅ Things', url: 'things:///show?id=today' }
]
}]
and then simply removed the parsing of urls and replaced it with explicitly passing down a name
prop to the Link
component
works fine for me 🙂
Hmm. So I'm starting to think flexibility might be better here. Less code to manage 👍
@chapati23 If you don't mind, can I see a screenshot of your app? I'm curious how it looks with emojis in the link text 😅
Real logos (slack, trello etc.) would be nicer of course, but didn't have enough time for more customization so far
Nice. I'm a fan of the minimalist look, but I do like how you put a smiley in the intro! 😄
fwiw, i've changed the
steps
data structure to:[{ name: 'Extract all mental tasks to a list', links: [ { name: '🗒 Trello', url: 'trello://x-callback-url/showBoard?x-source=jobs-done&id=59e9dc0dd6c3de4e51ae29ea' }, { name: '✅ Things', url: 'things:///show?id=today' } ] }]
and then simply removed the parsing of urls and replaced it with explicitly passing down a
name
prop to theLink
componentworks fine for me 🙂
@chapati23 - Nice! Is there a diff you can share for how to handle/display the new structure?
I use Bear and Things which use:/// native app URL schemes.
Example:
By default those don't render at all because there's no "host name" in the URL. You can work around it by including the x-callback-url scheme but then the link test isn't terribly descriptive.
Could the URLs have an optional name parameter, or have fallback logic to use the "scheme" if there's no hostname. That'd result in bear instead of x-callback-url