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: improve ActivityTimeline and TimelineMarker components #2100

Merged
merged 13 commits into from
Jan 16, 2021

Conversation

wildergd
Copy link
Collaborator

fix: #2099

Changes proposed in this PR:

@nexxtway/react-rainbow

@commit-lint
Copy link

commit-lint bot commented Jan 15, 2021

Features

  • add variant prop to ActivityTimeline component (9f7a30d)

Tests

  • fix TimelineMarker tests (0087339)

Bug Fixes

Documentation

  • review activitytimeline component info (b7ec076)
  • add info to activitytimeline examples (9c00423)
  • add more info to activitytimeline component (81a2004)
  • add info to timelinemarker component (d7372d2)
  • fix typos in activitytimeline info (0b99d2b)
  • add an article to activitytimeline example (3823009)
  • fix example (937bd42)
  • add description to timelinemarker examples (4476552)

Styles

  • fix style for timelinemarker guide (2986bfd)

Contributors

wildergd, YulyGP

Commit-Lint commands

You can trigger Commit-Lint actions by commenting on this PR:

  • @Commit-Lint merge patch will merge dependabot PR on "patch" versions (X.X.Y - Y change)
  • @Commit-Lint merge minor will merge dependabot PR on "minor" versions (X.Y.Y - Y change)
  • @Commit-Lint merge major will merge dependabot PR on "major" versions (Y.Y.Y - Y change)
  • @Commit-Lint merge disable will desactivate merge dependabot PR
  • @Commit-Lint review will approve dependabot PR
  • @Commit-Lint stop review will stop approve dependabot PR

@github-actions
Copy link

github-actions bot commented Jan 15, 2021

Visit the preview URL for this PR (updated for commit 4476552):

https://react-rainbow--pr2100-feat-add-variant-pro-mrcg8pnw.web.app

(expires Fri, 22 Jan 2021 23:06:11 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@TahimiLeonBravo
Copy link
Collaborator

@wildergd let's use a gray color for the arrows

@TahimiLeonBravo
Copy link
Collaborator

@wildergd we need to fix the line color, in some cases it is not visible, I think we should use here an alpha color that guarantees that it is darker than the background
Screen Shot 2021-01-15 at 10 06 18 AM

@codeclimate
Copy link

codeclimate bot commented Jan 15, 2021

Code Climate has analyzed commit 4476552 and detected 15 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 4
Duplication 11

View more on Code Climate.

export interface ActivityTimelineProps extends BaseProps {
children?: ReactNode;
multiple?: boolean;
onToggleSection?: (event: MouseEvent<HTMLElement>, name: Names) => void;

Choose a reason for hiding this comment

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

Here we will pass one single argument, a object with the name:
{ name }

<StyledUl className={className} style={style}>
{children}
<StyledUl id={id} className={className} style={style} ref={containerRef} variant={variant}>
<Provider value={context}>{children}</Provider>
</StyledUl>

Choose a reason for hiding this comment

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

I think here, we should execute all this new code only if the variant is accordion:

if (variant === 'accordion') {
   return <NewAccordionComponent />;
}
return <OriginalComponent />;

PropTypes.string,
]),
/** Action fired when a TimelineMarker is selected.
* The event params include the `name` of the selected TimelineMarker. */

Choose a reason for hiding this comment

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

we need to explain that this props (multiple, activeSectionNames and onToggleSection) are only used for accordion variant

style,
} = props;
const {
isVariantAccordion,

Choose a reason for hiding this comment

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

I think we should pass variant, since if we add new ones in the future then is more easy to make things here based on the variant


return (
<StyledLi className={className} style={style}>
<StyledLi data-id="timeline-marker-li" className={className} style={style}>

Choose a reason for hiding this comment

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

same ^^ here we should only execute all this new code if it is accordion variant

@@ -9,7 +12,7 @@ const StyledColumnLeft = attachThemeAttrs(styled.div)`

::before {
content: '';
background-color: ${props => props.palette.background.highlight};
background-color: ${props => getColor(props)};

Choose a reason for hiding this comment

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

can pass getColor directly

@LeandroTorresSicilia LeandroTorresSicilia merged commit 3a12463 into master Jan 16, 2021
@LeandroTorresSicilia LeandroTorresSicilia deleted the feat-add-variant-prop-activitytimeline branch January 16, 2021 16:42
jpetaux pushed a commit to jpetaux/react-rainbow that referenced this pull request Jun 27, 2021
…xtway#2100)

* feat: add variant prop to ActivityTimeline component

* test: fix TimelineMarker tests

* fix: lint issues

* docs: review activitytimeline component info

* docs: add info to activitytimeline examples

* docs: add more info to activitytimeline component

* style: fix style for  timelinemarker guide

* docs: add info to timelinemarker component

* docs: fix typos in activitytimeline info

* docs: add an article to activitytimeline example

* docs: fix example

* docs: add description to timelinemarker examples

Co-authored-by: YulyGP <71304589+YulyGP@users.noreply.github.com>
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.

feat: improve ActivityTimeline and TimelineMarker components
4 participants