Page MenuHomePhabricator

Add layout component
ClosedPublic

Authored by johnkuney on Apr 7 2023, 19:43.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABCf342672a7c44: Add layout component
Summary

Adding a layout component that will be used for every page to wrap it with a proper head and later use the nav and footer component.
The component can take several meta props so it can be customized as needed per page

Test Plan

run it and inspect the head

Diff Detail

Repository
rABC Bitcoin ABC
Branch
add-layout-structure
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23179
Build 45977: Build Diff
Build 45976: arc lint + arc unit

Event Timeline

bytesofman added inline comments.
web/e.cash/components/layout.js
31 ↗(On Diff #39414)

Is this a nextjs convention?

I know that React is deprecating defaultProps

What model are you seeing this in?

remove default props object

Good call I didn't realize that was deprecated. Changed them to default values as specified here https://react.dev/learn/passing-props-to-a-component#specifying-a-default-value-for-a-prop

bytesofman added inline comments.
web/e.cash/components/layout.js
20 ↗(On Diff #39456)

Doesn't this path need to be a full URL? Are relative paths accepted here?

23 ↗(On Diff #39456)

Doesn't this path need to be a full URL? Are relative paths accepted here?

This revision now requires changes to proceed.Apr 10 2023, 18:02

Edit: make social image paths absolute

Ah yes they do need to be absolute paths.

To fix I added the url as an environmental variable in a .env.local file as outlined here https://nextjs.org/docs/basic-features/environment-variables

Figured this would be good as its in more than one place and so it can easily be modified if needed

hmm hold on the .env.local didnt come through

add new line at end of file

Removing social images as we're not ready to define the absolute image paths

This revision is now accepted and ready to land.Apr 10 2023, 22:04
This revision was automatically updated to reflect the committed changes.