Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion frontend/packages/ui/src/features/pages/home-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const HomePage = ({ main, header }: HomePageProps) => {
return (
<AppShell header={{ height: 60 }} padding="md">
<AppShell.Header>{header}</AppShell.Header>
<AppShell.Main>{main}</AppShell.Main>
<AppShell.Main mb={64}>{main}</AppShell.Main>
<AppShell.Footer
h={100}
withBorder={false}
Expand Down
23 changes: 5 additions & 18 deletions frontend/packages/ui/src/features/proposals/proposals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const formatRunCycle = (date: string) => {
}

type CellProps = {
isExpanded: boolean
isExpanded?: boolean
}

/*
Expand All @@ -54,7 +54,7 @@ interface ExpandedCellProps extends CellProps {

const ExpandedCell = memo(function ExpandedCell({
Component,
isExpanded,
isExpanded = false,
}: ExpandedCellProps) {
return (
<Component
Expand All @@ -77,7 +77,7 @@ interface CycleCellProps extends CellProps {

const CycleCell = memo(function CycleCell({
cycle,
isExpanded,
isExpanded = true,
}: CycleCellProps) {
return (
<Group gap={0}>
Expand Down Expand Up @@ -303,11 +303,7 @@ const ProposalHeader = () => {

const Proposals = () => {
const proposals = useAppSelector(selectAvailableProposals)

const cycles = Object.keys(proposals).sort((a, b) => Number(b) - Number(a))
const [expandedCycles, setExpandedCycles] = useState<string[]>(
cycles.slice(0, 1) // Expand the most recent cycle by default
)

return (
<DataTable
Expand All @@ -320,24 +316,15 @@ const Proposals = () => {
accessor: 'cycle',
title: <ProposalHeader />,
noWrap: true,
render: ({ cycle }) => (
<CycleCell
cycle={cycle}
isExpanded={expandedCycles.includes(cycle)}
/>
),
render: ({ cycle }) => <CycleCell cycle={cycle} />,
},
]}
records={cycles.map((cycle) => ({
cycle,
proposals: proposals[cycle],
}))}
rowExpansion={{
allowMultiple: true,
expanded: {
recordIds: expandedCycles,
onRecordIdsChange: setExpandedCycles,
},
trigger: 'always',
content: ({ record }) => {
return <ProposalSubTable proposals={record.proposals} />
},
Expand Down