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

DEV-97.1: Finishing and Refactoring Pagination #80

Merged

Conversation

ApplePieAngel
Copy link
Contributor

@ApplePieAngel ApplePieAngel commented Dec 17, 2022

Description

Built on top of the first 88 commits of #79.

Continuing with the Search Page Redesign. This PR finishes styling and functioning for Pagination component. The PR also encompasses refactoring of redundant logic and unused classes in the pagination component.

This PR I've been trying new things after spending the last two days researching best React practices.

Features:

  • Current pagination button is now purple with white font.
  • Corrected colors for inactive buttons.
  • Removed underline under pagination buttons.
  • Refactored and cleaned up a lot of logic.
  • For the mobile view the pagination now centers underneath the Showing: X per page menu.
  • Showing 1-X to Y range is now absolute centered rather than relative to other containers on the same level.
  • Pagination Buttons (1, 2, 3...) now redirect you to the correct page.
  • a element hrefs have been replaced with MUI Links to maintain state.
  • You can hide/show the component (GoToPage) now by pressing "..."
  • The user can now type in a integer and go to that page.

Code Style and Reasoning:

  • Refactored nested components outside of the pagination. So the parent component doesn't continuously re-create the child component definition on re-rendering. Depending on the logic flow nested components can have minor or major performance impact that builds up over time.
  • Stored ternaries in variables to make the component tree cleaner.
  • Isolated specific logic to the relevant components to functions easier to maintain and change.
  • Maintained a structured import order (React -> External -> Internal) to improve organization.

Adds onto DEV-97 and #79

Screenshots

Before
chrome_CAob686eZq

After
chrome_ORWPRpIQxm

Code_seDb3pxCnf

Type of change

TODO:

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Manually, although I'll be writing test cases for this in a future PR.

@ApplePieAngel ApplePieAngel changed the base branch from main to DEV-97-Card-Components-Redesign December 17, 2022 16:30
@ApplePieAngel ApplePieAngel marked this pull request as ready for review December 18, 2022 01:21
* Fixed a bug where Rating wasn't inheriting the right color

* Updated pagination with larger icons for the next, back buttons

* Fixed a bug with Pagination where the buttons now render as gray

* Fixed a bug with ToGoPageX, deleted unnecessary override

* Realigned the buttons to be in the center of the purple box

* Fixed bug with text overflowing the card component

* Refactored out some of the CTA logic

* Refactored some rendundant classes, address now links in a new tab

* Added a lot of refactoring for redundant css

* Added min height for CTA bar

* Added additional margins to the Chips

* Cleanly render images without the use of booleans

* Added 16px margin around the card

* DEV-97.3: Search Page Menus and Mobile Menus (#82)

* Added components for search options, aligned text and icon

* Renamed class names for readability, created parent component for Sort

* Sort by bars now extend the length of the page on smaller dimensions

* Refactoring component tree into smaller components

* Header containing num of search results shrinks in smaller dimensions

* Reduced the margin between cards and pagination

* Sort bars now collapse at a smaller width

* Added extra font weight to the rating CTA

* Refactored some redudancy with props drilling

* Added dropdown for share button

* Fixed a bug regarding Google Maps and locations

* Replaced hrefs with react router links prevent re-rendering

* Added clear all button and refactored redundant component

* Changed Clear All button to be the same size as filter buutton

* Deleted unused css, added coloring and borders to the Clear All button

* Refactored props composition with Menus

* Fixed cards not extending the max length, changed some menu text

* Added back the new menu labels for all the menus

* Refactored components into one object to make it easier to edit

* Phone number buttons no longer appear if there's no input

* Align the filter and sort menus for the desktop view

* Users can no longer go to the current page with pagination.

* Menu now renders under the button rather than off to the side

* Changed the Buttons to ListItems, it now changes and saves the current value.

* Scrapped list items and implemented changing values with buttons

* The selected menu item label has a bolding effect

* Changed dropdown menu to gray and selected option is grayer with box shadow

* Added additional line height to mobile menus

* Adding initial test scaffolding

* Adding initial test scaffolding

* Added scaffolding for tests

* Added scaffolding to business card tests.

* Fixed no key in list error, fixed typo in className and fixed unused MUI element

* Refactoring all class names to be camelCase

* Added box shadow to apply box and removed bottom margin for mobile view

* Removed unnecessary prop causing errors.

* Removed empty tests, abstracted out pagination function

* Added test cases for next button.

* Added tests for check valid page number

* Testing range of results

* Added test cases for reviewCTA, addressRow, titleBar, ShareMenu, OrdinalNumber, formatPhone#, convertAdd..

* Added tests for business cards regarding CTA components

* Added tests for SortByMenu

* DEV-97.4: Add Report Problem Button in Results Page (#84)

* Added SupportButton component from PR 74

* Opening Go To Page no longer adjusts the page height, added support button
@ApplePieAngel ApplePieAngel merged commit 14459b7 into DEV-97-Card-Components-Redesign Mar 5, 2023
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.

1 participant