Skip to content

Conversation

@Roseskk
Copy link
Collaborator

@Roseskk Roseskk commented May 18, 2022

No description provided.

@Roseskk Roseskk requested a review from BigTows May 18, 2022 10:21
@Roseskk Roseskk linked an issue May 18, 2022 that may be closed by this pull request
@netlify
Copy link

netlify bot commented May 18, 2022

Deploy Preview for cheerful-lily-b65942 ready!

Name Link
🔨 Latest commit 2862f3f
🔍 Latest deploy log https://app.netlify.com/sites/cheerful-lily-b65942/deploys/6284c8c9a4779f000854a44b
😎 Deploy Preview https://deploy-preview-82--cheerful-lily-b65942.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

return (
<ViewLayout><Component {...pageProps} /></ViewLayout>
)
const getLayout = Component.getLayout ?? ((page:any)=> page)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ааааа теперь понял)

Смотри у тебя сейчас куча дублей кода, давай так:

  1. Если Component приводит свой Layout то мы его подставляем
  2. Если же Component не выдвигает свой Layout, то мы подставляем по умолчанию:
<ViewLayout>
            {page}
</ViewLayout>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну дубли есть как бы), для каждой страницы лэйаут, а ты о чем?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если ты НЕ переопределил функцию в компоненте, то подставлять ViewLayout иначе то что вернула функция. Тогда дубли уйдут

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не понял а что это еще не закрытый тикет чтоль

@Roseskk Roseskk requested a review from BigTows May 31, 2022 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Разбить Layout

3 participants