Skip to content

Commit

Permalink
fix ProposalList ColLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
eshark9312 committed Nov 30, 2023
1 parent f7ba1e9 commit 8488191
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ import { RowGapBlock } from '@/common/components/page/PageContent'
import { NotFoundText } from '@/common/components/typography/NotFoundText'
import { GetSortProps } from '@/common/hooks/useSort'
import { useMyMemberships } from '@/memberships/hooks/useMyMemberships'
import {
ProposalColLayout,
ProposalsListHeaders,
ProposalListHeader,
ProposalColLayoutWithVoteDetails,
} from '@/proposals/constants'
import { ProposalColLayout, ProposalsListHeaders, ProposalListHeader } from '@/proposals/constants'
import { Proposal } from '@/proposals/types'

import { ProposalListItem } from './ProposalListItem'
Expand All @@ -40,7 +35,7 @@ export const ProposalList = ({ proposals, getSortProps, isPast, isLoading }: Pro

return (
<RowGapBlock gap={4}>
<ProposalsListHeaders $colLayout={isCouncilMember ? ProposalColLayoutWithVoteDetails : ProposalColLayout}>
<ProposalsListHeaders $colLayout={ProposalColLayout(isCouncilMember, isPast)}>
{getSortProps ? <SortHeader {...getSortProps('title')}>Title</SortHeader> : <ProposalListHeader />}
<ProposalListHeader>Stage</ProposalListHeader>
<ProposalListHeader>Proposer</ProposalListHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Colors, Overflow } from '@/common/constants'
import { camelCaseToText } from '@/common/helpers'
import { toDDMMYY } from '@/common/utils/dates'
import { MemberInfo } from '@/memberships/components'
import { ProposalColLayout, ProposalColLayoutWithVoteDetails } from '@/proposals/constants'
import { ProposalColLayout } from '@/proposals/constants'
import { ProposalsRoutes } from '@/proposals/constants/routes'
import { isProposalActive } from '@/proposals/model/proposalStatus'
import { Proposal } from '@/proposals/types'
Expand Down Expand Up @@ -61,7 +61,7 @@ export const ProposalListItem = ({ proposal, isPast, memberId, isCouncilMember }
<ProposalItem
as={GhostRouterLink}
to={generatePath(ProposalsRoutes.preview, { id: proposal.id })}
$colLayout={isCouncilMember ? ProposalColLayoutWithVoteDetails : ProposalColLayout}
$colLayout={ProposalColLayout(isCouncilMember, isPast)}
$isPast={!isProposalActive(proposal.status)}
>
<FieldWrapper>
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/proposals/constants/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import styled from 'styled-components'

import { ListHeaders, ListHeader } from '@/common/components/List/ListHeader'

export const ProposalColLayout = '296px 148px 156px 60px'
export const ProposalColLayoutWithVoteDetails = ProposalColLayout + ' 80px'
export const ProposalColLayout = (isCouncilMember?: boolean, isPast?: boolean) =>
`296px 148px 156px${isPast ? ' 60px' : ''}${isCouncilMember ? ' 80px' : ''}`

export const ProposalsListHeaders = styled(ListHeaders)`
padding-right: 16px;
Expand Down

0 comments on commit 8488191

Please sign in to comment.