CFE-15 fixed bug mock App with providers and wrapper

This commit is contained in:
AmirHossein Mahmoodi
2023-09-26 10:35:36 +03:30
parent 8ca1645cc3
commit 79f3806637
2 changed files with 11 additions and 13 deletions

View File

@@ -2,12 +2,12 @@ import App from "@/pages/_app";
import fa from "&/locales/fa/app.json"
const translations = {fa};
const MockAppWithProviders = ({Component, locale, title, isBot}) => {
const MockAppWithProviders = ({children, locale, title, isBot}) => {
const pageProps = {
title: title || '', isBot: isBot || true, locale: locale || 'fa', messages: translations[locale || 'fa']
}
return (<App Component={Component} pageProps={pageProps}/>)
return (<App Component={() => (<>{children}</>)} pageProps={pageProps}/>)
}
export default MockAppWithProviders