Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Chores #73

Merged
merged 6 commits into from May 3, 2022
Merged

Chores #73

merged 6 commits into from May 3, 2022

Conversation

AlicanC
Copy link
Contributor

@AlicanC AlicanC commented May 3, 2022

chore: restructure App

Moves routes to a separate file for better visibility.

chore: suffix page components with "Page"

I think we should generally be more explicit in naming. It's very probable that we have things like class UserModel, function UserView or function UserPage which would clash if we named all of them User.

chore: add Recoil

Added Recoil for managing the UI state. There's also a persistEffect Recoil effect that will persist atoms to LocalStorage. (Used this to store wallet PK.)

Note: I'm not saying we should use Recoil to store data. I'm mainly thinking of things like:

  • storing preferred locale
  • storing the selected option of a select so we don't forget it on refresh
  • etc.

chore: rename WalletContext to AppContext and add useContract

Heavily refactored this. useWallet is now called useAppContext and not used that much. There are two new hooks:

  • useWallet: just returns the Wallet in the context, not the whole context as it used to.
  • useContract: returns the main SwaySwap contract with the wallet connected to it.

chore: lazy load pages

Now, code for only necessary pages will be loaded.

chore: upgrade React to 18.1.0

@AlicanC AlicanC requested a review from luizstacio May 3, 2022 11:51
@AlicanC AlicanC self-assigned this May 3, 2022
Copy link
Member

@luizstacio luizstacio left a comment

Choose a reason for hiding this comment

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

LGTM! Nice improvements on the code

@AlicanC AlicanC merged commit b752ae1 into master May 3, 2022
@AlicanC AlicanC deleted the jc/chores branch May 3, 2022 12:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants