-
Notifications
You must be signed in to change notification settings - Fork 0
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
Factor out a <LocaleLink> component. #131
Conversation
* the path! | ||
*/ | ||
export function LocaleLink<TState>( | ||
props: GatsbyLinkProps<TState> & { ref?: never } |
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.
I was having weird type issues with the ref
prop but since we never actually use it in our code, I just simplified things by prohibiting it.
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.
Wow this is such a great feeling to see all of these locale props disappear! This looks great to me, thank you Atul!
content: { | ||
title: string; | ||
subtitle: string; | ||
ctaLink: string; | ||
ctaText: string; | ||
}; | ||
}; |
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.
I like this approach of slowly adding in more explicit type definitions as we go.
@toolness feel free to squash and merge when you get a chance! |
This factors out a
<LocaleLink>
component that automatically prefixes the passed-in URL with the current locale, as in WoW (see JustFixNYC/who-owns-what#186).