-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
feat: support branding #639
base: next
Are you sure you want to change the base?
Conversation
refactor: add explanation to theme.brand
decorators: [ | ||
(Story) => { | ||
const theme = useTheme(); | ||
return <Story args={{ theme: { ...theme, brand: { title: 'React Native' } } }} />; |
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 don't like having this decorator in every story just to make typescript happy. Essentially the problem is only that theme requires a lot of properties that we don't want to define here.
Maybe I missed something to make it easier?
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.
https://github.com/trajano/expo-experiments/blob/4287571d3a9fe568700ce97ecc266d5a5bff621e/packages/my-app/.storybook/index.ts#L11-L16 shows what I did on mine to pass it in, but I cheated with the any
because of the imageSource
thing which you resolved in web-theme.ts I think.
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.
But I think what you have looks correct. At least for the context of the story.
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.
Can't wait to drop my patches :D
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 think just use the existing Storybook logo to prevent having another asset,
decorators: [ | ||
(Story) => { | ||
const theme = useTheme(); | ||
return <Story args={{ theme: { ...theme, brand: { title: 'React Native' } } }} />; |
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.
https://github.com/trajano/expo-experiments/blob/4287571d3a9fe568700ce97ecc266d5a5bff621e/packages/my-app/.storybook/index.ts#L11-L16 shows what I did on mine to pass it in, but I cheated with the any
because of the imageSource
thing which you resolved in web-theme.ts I think.
decorators: [ | ||
(Story) => { | ||
const theme = useTheme(); | ||
return <Story args={{ theme: { ...theme, brand: { title: 'React Native' } } }} />; |
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.
But I think what you have looks correct. At least for the context of the story.
Thanks so much for taking the time, I promise I will get to this pr soon. I have a lot going on currently but ideally in this coming week. Feel free to tag me as a reminder if I take too long :). |
I updated by patches but should still be the same |
sorry again for taking a while, I have not forgotten |
@tlow92 I tried this out and its working pretty great already. I made some adjustments in my latest commit, could you check if you agree with the changes? basically its these things
|
ok had to adjust some types as well, we want this to be an optional theme property |
I had a thought... How about making the logo image be a prop that points to a component like That way someone can use Svg or Icon or something else. It just needs a separate prop called It can be later, right now simple branding is fine as long as I can refer to the image via |
@trajano yeah I think that can also work, I will give it a try a bit later |
@dannyhw Sorry have been very busy. Changes look good to me, nothing to add from my side, I think. Thanks for the additional fixes 🙏 |
Implements Feature:
#625
What I did
Support for branding, based on the patches from @trajano. Many thanks!
How it works