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(xo-core): add pool status item component #7769

Closed
wants to merge 3 commits into from

Conversation

P4l0m4
Copy link
Collaborator

@P4l0m4 P4l0m4 commented Jun 21, 2024

Capture d'écran 2024-06-21 112222

@P4l0m4 P4l0m4 self-assigned this Jun 21, 2024
@P4l0m4 P4l0m4 requested a review from OlivierFL June 21, 2024 14:08
import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
import { faAngleRight } from '@fortawesome/free-solid-svg-icons'

type LegendColor = 'default' | 'success' | 'warning' | 'error' | 'disabled' | 'dark-blue'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not extract the type from the UiLegend component into a ui-legend.type.ts and import the type from that file?

Comment on lines +44 to +49
type Segment = {
value: number
color: 'success' | 'warning' | 'error' | 'unknown'
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, you can create donut-chart.type.ts and import the type instead of duplicating it.


interface Props {
title: string
titleLink: string
Copy link
Collaborator

Choose a reason for hiding this comment

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

According to the design system, the link should be optional.

Comment on lines 70 to 71
titleLinkLabel: 'See all',
totalLabel: 'Total',
Copy link
Collaborator

Choose a reason for hiding this comment

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

These strings should be translated. Also, it doesn't make sense to have the link required, and the link label optional with a default value.

Comment on lines 26 to 30
<div class="total">
<span class="typo c2-semi-bold">{{ totalLabel }}</span
><span class="typo h3-semi-bold">{{ totalValue }}</span>
</div>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not use the CardNumbers component? Also, according to the mock-ups, the whole component should be right-aligned on desktop and left-aligned on mobile.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Someone said the design system prevails on the mockup. On the design system, the label and value are spread appart
image

Copy link
Contributor

Choose a reason for hiding this comment

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

As I told you before here (point #4) or there, this has been discussed during the call with Clémence in which you took part.

You already made this exact same change twice.

Reusable components are useless if they are not intended to be reused.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In my opinion, this component is not useful in web-core. According to the mock-ups, the component will only be used in XO 6. I would suggest to move the component to web and add the business logic to get the data from the pool store. There is no need to make this component act as an intermediate component that redefines all the props needed by the child components. This would create unnecessary maintainability problems. By the way, since the values needed by DonutChart and UiLegend are mostly the same, maybe you could make a child component for this part.

Comment on lines 6 to 8
<RouterLink :to="titleLink">
<UiButton level="tertiary" size="extra-small" :right-icon="faAngleRight">{{ titleLinkLabel }}</UiButton>
</RouterLink>
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ The RouterLink renders a <a> tag, and <button> is not allowed as a child.

@OlivierFL OlivierFL requested a review from ByScripts June 26, 2024 07:33
@P4l0m4 P4l0m4 marked this pull request as draft June 26, 2024 08:32
@P4l0m4 P4l0m4 force-pushed the pool-status-item-component branch from 32a7744 to ca5a757 Compare June 26, 2024 09:26
@P4l0m4 P4l0m4 force-pushed the pool-status-item-component branch from ca5a757 to a56bbe8 Compare June 26, 2024 09:30
@ByScripts
Copy link
Contributor

Note

I'll wait for #7778 before doing this review.

@P4l0m4 P4l0m4 closed this Jul 15, 2024
@P4l0m4 P4l0m4 deleted the pool-status-item-component branch July 15, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants