From 1dc5f8d7b94eb412aac6cddd5686c87504e98846 Mon Sep 17 00:00:00 2001 From: Erik Goens Date: Thu, 25 Jul 2024 15:10:21 -0700 Subject: [PATCH] prevents header and pill content from wrapping adjusts type definitions to match new Coda table structures --- .../thumbprint-roadmap/overview/overview.jsx | 22 +++++------ next/pages/overview/roadmap.tsx | 37 +++++++++++-------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/next/components/thumbprint-roadmap/overview/overview.jsx b/next/components/thumbprint-roadmap/overview/overview.jsx index 359d3615..3b54b518 100644 --- a/next/components/thumbprint-roadmap/overview/overview.jsx +++ b/next/components/thumbprint-roadmap/overview/overview.jsx @@ -2,30 +2,30 @@ import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; +import { format } from 'date-fns'; import { Text, Pill } from '@thumbtack/thumbprint-react'; import { tpColorGray300 } from '@thumbtack/thumbprint-tokens'; import styles from './overview.module.scss'; -export const ComponentRow = ({ task, description, status, releaseDate}) => ( - <> +export const ComponentRow = ({ task, description, status, releaseDate }) => { + return ( - - {task} - + {task} - {description} + {description} - + {status} - {releaseDate} + {/* {format(new Date(releaseDate), 'M/dd/yy')} */} - -); + ); +}; ComponentRow.propTypes = { + statuses: Object, task: String, description: String, status: String, @@ -68,7 +68,7 @@ export const ComponentTable = ({ children }) => ( Status {roadmaps.map(item => { - return ( ); })} @@ -102,7 +105,7 @@ export default function Components({ export const getStaticProps = async () => { const listRowsRes = await fetch( // https://coda.io/developers/apis/v1#operation/listRows - `https://coda.io/apis/v1/docs/bXyUQb2tJW/tables/PublicRoadmap/rows?useColumnNames=true`, + `https://coda.io/apis/v1/docs/bXyUQb2tJW/tables/PublicRoadmap2/rows?useColumnNames=true`, { headers: { Authorization: `Bearer ${process.env.CODA_API_TOKEN}`, @@ -112,21 +115,23 @@ export const getStaticProps = async () => { const data = listRowsRes.ok ? await listRowsRes.json() : null; const roadmaps: Roadmap[] = data ? data.items : []; + // const roadmaps: Implementation[] = data ? data.items : []; - // const groupedImplementations = groupBy(roadmaps, implementation => { - // return implementation.values.Name; - // }); + const groupedImplementations = groupBy(roadmaps, implementation => { + return implementation.values.Status; + }); - // const groupedAndSortedImplementations = Object.keys(groupedImplementations) - // .sort() - // .map(key => { - // return groupedImplementations[key]; - // }); + const groupedAndSortedImplementations = Object.keys(groupedImplementations) + .sort() + .map(key => { + return groupedImplementations[key]; + }); return { props: { layoutProps: getLayoutProps(), roadmaps: roadmaps, + // roadmaps: groupedAndSortedImplementations, }, }; };