Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(links): extract LinkInfoEditor #416

Merged
merged 1 commit into from
Aug 16, 2020

Conversation

LoneRifle
Copy link
Contributor

Problem

As part of work for #399, we have to refactor parts of the codebase to encourage reuse

Solution

Extract the parts in the link control panel dealing with link info
into a reusable component, to be used in the post-creation modal later

  • Move ConfigOption and DrawerTextField into UserPage widgets
  • Extract LinkInfoEditor from ControlPanel, propagating changes in
    state in contact emails and description back to parent using
    callbacks and useEffect() hooks
  • Change emailValidator to have a boolean primitive return type,
    remove from useShortLink() return value

Tests

Exercise inputting of link information

Extract the parts in the link control panel dealing with link info
into a reusable component, to be used in the post-creation modal later

- Move ConfigOption and DrawerTextField into UserPage widgets
- Extract LinkInfoEditor from ControlPanel, propagating changes in
  state in contact emails and description back to parent using
  callbacks and `useEffect()` hooks
- Change emailValidator to have a boolean primitive return type,
  remove from `useShortLink()` return value
Copy link
Member

@yong-jie yong-jie left a comment

Choose a reason for hiding this comment

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

lgtm

@yong-jie yong-jie merged commit bd2a2ea into develop Aug 16, 2020
@yong-jie yong-jie deleted the refactor/links/info-editor branch August 16, 2020 06:56
xming13 pushed a commit to xming13/GoGovSG that referenced this pull request Aug 21, 2020
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.

2 participants