-
Notifications
You must be signed in to change notification settings - Fork 0
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
Statistics - Numbers chart #14
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
The data shouldnt be coupled with the "dietary restrictions" It should be able to render dynamic sets of data, so I think just the naming of things should be generalized. Also, we need to have nested labels ie. the dietary one in the figma design should be able to have: Note the indents ^ |
src/components/Stats/StatsTable.tsx
Outdated
} | ||
|
||
const StatsTable: React.FC<StatsTableProps> = ({ | ||
title = "Dietary Restrictions", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
general
src/components/Stats/StatsTable.tsx
Outdated
<br /> | ||
<div className="grid grid-cols-2 gap-2 text-pale-blue"> | ||
{Object.entries(data).map( | ||
([restriction, count], index) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
general
src/components/Stats/StatsTable.tsx
Outdated
{Object.entries(data).map( | ||
([restriction, count], index) => ( | ||
<> | ||
<div className="col-span-1">{restriction}</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
general
src/components/Stats/StatsTable.tsx
Outdated
|
||
const StatsTable: React.FC<StatsTableProps> = ({ title, data }) => { | ||
const renderData = (data: Object, marginValue: number = 0): JSX.Element[] => { | ||
return Object.entries(data).map(([restriction, count]) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restriction -> label
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/components/Stats/StatsTable.tsx
Outdated
className="col-span-2" | ||
style={{ marginLeft: `${marginValue}px` }} | ||
> | ||
{restriction} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label
src/components/Stats/StatsTable.tsx
Outdated
className="col-span-2" | ||
style={{ marginLeft: `${marginValue}px` }} | ||
> | ||
{restriction} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label
ποΈ Ticket: Statistics - Numbers chart
π· Changes: Added a grid that maps an object's data (for example dietary restrictions).
π Notes: