Page MenuHomePhabricator

[e.cash] Refactor global css
ClosedPublic

Authored by johnkuney on May 5 2023, 21:05.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC99b499770788: [e.cash] Refactor global css
Summary

Chaging how the global styles are applied to be more consistent with styled components
-utilized styled components createGlobalStyle feature and added to the top of _app.js
-this should inject the previous css rules globally
-I moved the "container" class to be a component instead to avoid the inconsistent single classname used for that

Test Plan

@bot preview-e.cash
See if everything renders as before

Diff Detail

Repository
rABC Bitcoin ABC
Branch
ecash-global-styles
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23654
Build 46922: Build Diff
Build 46921: arc lint + arc unit

Event Timeline

bytesofman requested changes to this revision.May 5 2023, 21:50
bytesofman added a subscriber: bytesofman.
bytesofman added inline comments.
web/e.cash/components/container/index.js
3 ↗(On Diff #40223)

Seems a bit overkill for this to have its own file. We might have a need for many simple components that are style only and do not require props or other react logic.

Also this is not consistently applied.

Container gets its own folder and index.js, but layout.js is just a file in the components directory?

Also other components with a directory have an index.js which defines the component logic and a styles.js which defines styled components, but here we have index.js defining the styled component.

  • Move layout.js so that it has its own folder, layout, including index.js (no styled.js as it has no unshared styled-components)
  • Create a new folder atoms or some name that makes sense to you and give it an index.js and a styles.js. Define all styled components that do not take props or use react logic in this file. In index.js, just import everything from styles.js and export it.

Then in the future, on a given webpage, you can just import {Container, Spacer, HorizontalLine, ... etc, other simple styled components} from 'components/atoms'

web/e.cash/pages/_app.js
6 ↗(On Diff #40223)

This should be in the new atoms folder

This revision now requires changes to proceed.May 5 2023, 21:50

Rename files, put layout in its own folder, create atoms

@bot preview-e.cash

web/e.cash/components/atoms/index.js
3–4 ↗(On Diff #40225)

combine into one object

bytesofman requested changes to this revision.May 8 2023, 13:45

update export object in /components/atoms/index.js

This revision now requires changes to proceed.May 8 2023, 13:45

Change atoms index.js to have one export

This revision is now accepted and ready to land.May 8 2023, 16:35
This revision was automatically updated to reflect the committed changes.