-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
new extension vike-react-chakra
#151
Conversation
f7b00ae
to
dd2e0bd
Compare
💯 Hi Muhammad, yes good point I think a new setting Looking forward to merge 😍 |
dd2e0bd
to
c403cbf
Compare
Hi Rom, Thanks I'll also try adding the |
Hello Muhammad, nice 👌 I suggest we minimize the code a bit. The rationale being that we'll eventually have a lot of integration packages like this. To make things more maintainable let's keep things as simple as possible.
👍 Is |
Ah, I'm just reading that 😅. So, yea, I'm inclined to think that haivng a
Yea, maybe this integration package is a bit counter productive 🤔 WDYT? Maybe with eject it could make sense? |
Yes, it is, see ChakraProviderProps.
Yeah I think so. Users can configure the chakra theme system and add additional provider inside one
I'm not sure yet.
Indeed. Let's add |
I'm a bit confused: what would then be the added value of I just looked at https://github.com/pacocoursey/next-themes; how is that related to (vike-react-)chakra? |
I'm not great at explaining this, but as far as I know, |
609228f
to
c403cbf
Compare
How is this relevant to our discussion and/or to |
So that users can follow the Setup Provider guide to use the generated Provider (which includes |
c403cbf
to
2173a67
Compare
I just pushed a new changes. |
I'll add |
Their docs say:
But that isn't something the user can influence, right? In other words: what would be the concrete added value of Alternative idea: // +chakra.js
export default {
system: /* ... */
} WDYT? |
It's what the CLI generates, (inside
|
I don't see how it's related to our discussion?
Sure, but again, what's the concrete advantage?
Of course.
Does their docs document that? 👀 I'm still not sure I see any concrete benefit of |
Maybe I misunderstood your question. What do you mean by |
Anyways, what about we don't use // +chakra.js
export default {
system: /* ... */
locale: /* ... */
} And we also can add optinal export { Wrapper }
import React, { ReactNode } from 'react'
import { ChakraProvider, LocaleProvider, defaultSystem } from '@chakra-ui/react'
import { usePageContext } from 'vike-react/usePageContext'
function Wrapper({ children }: { children: ReactNode }) {
const pageContext = usePageContext()
const { chakra } = pageContext.config
return (
<ChakraProvider value={chakra?.system ?? defaultSystem}>
<ChakraLocaleProvider locale={chakra?.locale}>
{children}
</ChakraLocaleProvider>
</ChakraProvider>
)
}
function ChakraLocaleProvider(props: { locale?: string; children: ReactNode }) {
if (props.locale) {
return <LocaleProvider locale={props.locale}>{props.children}</LocaleProvider>
}
return <>{props.children}</>
} |
Sounds good! Also, how about:
|
2173a67
to
849fe84
Compare
849fe84
to
0850332
Compare
I'm not sure either, though I think the Okay, I'm happy with this PR. Please take a look and let me know if I missed anything. |
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.
Looks good! I made some polishing comments. As you can see I made a lot of them. The rationale here being that things will be ejectable so everything is part of the "shop window". Looking forward to it 💫
It now works with |
64895ea
to
ff8eff3
Compare
This reverts commit e6fb7ee.
08dd9f9
to
a9cb903
Compare
Well done, awesome 🚀 , thank you |
Alright, let's merge? Let me know if you disagree with anything. |
LGTM, even better we don't need to use FYI, I had issues with |
Made one last change: dbd7160. |
vike-react-chakra
vike-react-chakra
Merged ✨ Let's:
|
Also we forgot to update the main readme: https://github.com/vikejs/vike-react |
Or better yet let's remove that readme and just add link to vike.dev/extensions#react
|
I agree |
@phonzammi Up for it? |
Sure, I want to, ETA later tonight |
Ok ok, wasn't sure whether there was some ambiguity :) |
TODO :
Add Custom Config/Setting :
ChakraCustomProvider ?chakraCustomConfig ?+system