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

WIP feat(APP-3508): Remove title and description props from ProposalVoting module component #327

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## Changed

- Removed heading and description from `ProposalVoting` terminal
thekidnamedkd marked this conversation as resolved.
Show resolved Hide resolved

## [1.0.52] - 2024-10-30

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ describe('<ProposalVotingContainer /> component', () => {
return <ProposalVotingContainer {...completeProps} />;
};

it('renders the proposal voting title and description', () => {
const title = 'Proposal voting';
const description = 'Description for the voting terminal';
render(createTestComponent({ title, description }));
expect(screen.getByRole('heading', { level: 2, name: title })).toBeInTheDocument();
expect(screen.getByText(description)).toBeInTheDocument();
});

it('renders an accordion container when having more than one child', () => {
const children = [
<ProposalVotingStage key="0" status={ProposalVotingStatus.ACCEPTED} startDate={0} endDate={0} />,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import classNames from 'classnames';
import React, { Children, type ComponentProps } from 'react';
import { Accordion, Card, Heading } from '../../../../../core';
import { Accordion, Card } from '../../../../../core';

export interface IProposalVotingContainerProps extends ComponentProps<'div'> {
/**
Expand All @@ -24,11 +24,7 @@ export const ProposalVotingContainer: React.FC<IProposalVotingContainerProps> =
const isMultiStage = processedChildren.length > 1;

return (
<Card className={classNames('flex flex-col overflow-hidden', className)} {...otherProps}>
<div className={classNames('flex flex-col gap-2 p-4 md:gap-3 md:p-6', { 'pb-2 md:pb-3': !isMultiStage })}>
<Heading size="h2">{title}</Heading>
<p className="text-base font-normal leading-normal text-neutral-500">{description}</p>
</div>
<Card className={classNames('flex w-full flex-col overflow-hidden', className)} {...otherProps}>
thekidnamedkd marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

The full component alignment with the new design can be done later, but without the title and description the component looks off. We can probably update the paddings and gap to have a better temporary version of the component
Screenshot 2024-11-04 at 15 50 42

{isMultiStage && (
<Accordion.Container isMulti={false} defaultValue={activeStage}>
{processedChildren.map((child, index) =>
Expand Down