Skip to content

Commit

Permalink
prevents header and pill content from wrapping
Browse files Browse the repository at this point in the history
adjusts type definitions to match new Coda table structures
  • Loading branch information
egoens committed Jul 25, 2024
1 parent 55c388e commit 1dc5f8d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 27 deletions.
22 changes: 11 additions & 11 deletions next/components/thumbprint-roadmap/overview/overview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

Check failure on line 4 in next/components/thumbprint-roadmap/overview/overview.jsx

View workflow job for this annotation

GitHub Actions / ESLint

'classNames' is defined but never used
import { format } from 'date-fns';

Check failure on line 5 in next/components/thumbprint-roadmap/overview/overview.jsx

View workflow job for this annotation

GitHub Actions / ESLint

'format' is defined but never used
import { Text, Pill } from '@thumbtack/thumbprint-react';
import { tpColorGray300 } from '@thumbtack/thumbprint-tokens';
import styles from './overview.module.scss';

Check failure on line 8 in next/components/thumbprint-roadmap/overview/overview.jsx

View workflow job for this annotation

GitHub Actions / ESLint

'styles' is defined but never used

export const ComponentRow = ({ task, description, status, releaseDate}) => (
<>
export const ComponentRow = ({ task, description, status, releaseDate }) => {

Check failure on line 10 in next/components/thumbprint-roadmap/overview/overview.jsx

View workflow job for this annotation

GitHub Actions / ESLint

'releaseDate' is defined but never used
return (
<tr className="bb b-gray-300 bw-2 tl">
<td className="">
{task}
</td>
<td className="b">{task}</td>
<td className="pa2">
{description}
<Text size="2">{description}</Text>
</td>
<td className="pa2">
<td className="pa2 nowrap">
<Pill color="blue">{status}</Pill>
</td>
<td className="pa2">
{releaseDate}
{/* <Text size="2">{format(new Date(releaseDate), 'M/dd/yy')}</Text> */}
</td>
</tr>
</>
);
);
};

ComponentRow.propTypes = {
statuses: Object,

Check failure on line 28 in next/components/thumbprint-roadmap/overview/overview.jsx

View workflow job for this annotation

GitHub Actions / ESLint

'statuses' PropType is defined but prop is never used

Check failure on line 28 in next/components/thumbprint-roadmap/overview/overview.jsx

View workflow job for this annotation

GitHub Actions / ESLint

propType "statuses" is not required, but has no corresponding defaultProps declaration
task: String,

Check failure on line 29 in next/components/thumbprint-roadmap/overview/overview.jsx

View workflow job for this annotation

GitHub Actions / ESLint

propType "task" is not required, but has no corresponding defaultProps declaration
description: String,

Check failure on line 30 in next/components/thumbprint-roadmap/overview/overview.jsx

View workflow job for this annotation

GitHub Actions / ESLint

propType "description" is not required, but has no corresponding defaultProps declaration
status: String,

Check failure on line 31 in next/components/thumbprint-roadmap/overview/overview.jsx

View workflow job for this annotation

GitHub Actions / ESLint

propType "status" is not required, but has no corresponding defaultProps declaration
Expand Down Expand Up @@ -68,7 +68,7 @@ export const ComponentTable = ({ children }) => (
<Text size={2}>Status</Text>
</th>
<th
className="pt3 ph2 pb2 v-top top0 bg-white"
className="pt3 ph2 pb2 v-top top0 bg-white nowrap"
style={{
position: 'sticky',
boxShadow: `0px 2px 0px 0px ${tpColorGray300}`,
Expand Down
37 changes: 21 additions & 16 deletions next/pages/overview/roadmap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ interface Implementation {
'Development status': string;
'Design status': string;
'Documentation status': string;
Objective: string;
Problem: string;
Status: string;
'End Date': string;
};
}

Expand All @@ -49,10 +53,10 @@ interface Roadmap {
type: string;
updatedAt: string;
values: {
Task: string;
Description: string;
Objective: string;
Problem: string;
Status: string;
'Release Date': string;
'End Date': string;
};
}

Expand Down Expand Up @@ -84,13 +88,12 @@ export default function Components({

<ComponentTable>
{roadmaps.map(item => {

return (
<ComponentRow
task={item.values.Task}
description={item.values.Description}
task={item.values.Objective}
description={item.values.Problem}
status={item.values.Status}
releaseDate={item.values['Release Date']}
releaseDate={item.values['End Date']}
/>
);
})}
Expand All @@ -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}`,
Expand All @@ -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,
},
};
};

0 comments on commit 1dc5f8d

Please sign in to comment.