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

feat: Implement a flippable arrow ui component #78

Conversation

mkarajohn
Copy link
Contributor

@mkarajohn mkarajohn commented Oct 11, 2023

Resolves DSTRBTN-540

Generated summary (powered by Graphite)

TL;DR

This pull request introduces a new UI component, FlippableArrow, which is an arrow icon that can be flipped vertically based on the expanded prop.

What changed

Three new files were added to the src/ui/FlippableArrow directory:

  1. FlippableArrow.styles.ts: This file contains the styled component IconWrapper which applies a 3D rotation transformation to its child based on the expanded prop.

  2. FlippableArrow.tsx: This is the main component file. It accepts expanded, color, and size as props and renders the IconWrapper with an Icon child.

  3. index.ts: This file exports the FlippableArrow component.

How to test

To test this component, import it into a React component and pass in the required props. Change the expanded prop to see the arrow icon flip.

import React, { useState } from 'react';
import FlippableArrow from 'src/ui/FlippableArrow';

function TestComponent() {
  const [expanded, setExpanded] = useState(false);

  return (
    <div>
      <FlippableArrow expanded={expanded} color="black" size={24} />
      <button onClick={() => setExpanded(!expanded)}>Toggle</button>
    </div>
  );
}

Why make this change

This change was made to provide a reusable UI component that can be used wherever a flippable arrow icon is needed, such as in accordions or dropdown menus. This will help ensure consistency across the application and reduce code duplication.

Copy link
Contributor Author

mkarajohn commented Oct 11, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

Copy link
Contributor Author

mkarajohn commented Oct 24, 2023

Merge activity

@mkarajohn mkarajohn changed the base branch from 10-11-feat_Update_ocntext_and_useProducts_hook to 10-10-feat_add_custom_Menu_component October 24, 2023 14:44
@mkarajohn mkarajohn merged commit c63db80 into 10-10-feat_add_custom_Menu_component Oct 24, 2023
1 of 4 checks passed
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