Skip to content

Commit

Permalink
Fix food group legend bottom spacing (#242)
Browse files Browse the repository at this point in the history
Make them less packed.
  • Loading branch information
ZengLawrence authored Nov 16, 2024
1 parent 1637c7f commit 366876d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "diet-diary",
"version": "2.30.0",
"version": "2.30.1",
"private": true,
"homepage": ".",
"dependencies": {
Expand Down
5 changes: 3 additions & 2 deletions src/components/FoodGroupLegend.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import _ from "lodash";
import { displayName, FoodGroup } from "../model/Food";
import { FoodGroupLabelBadge } from "./badge";
import { Legend } from "./Legend";

export const FoodGroupLegend = (props: { foodGroup: FoodGroup; }) => {
export const FoodGroupLegend = (props: { foodGroup: FoodGroup; className?: string }) => {
const { foodGroup } = props;
return (
<Legend className="d-flex flex-nowrap">
<Legend className={_.join(["d-flex", "flex-nowrap", props.className], " ")}>
<FoodGroupLabelBadge foodGroup={foodGroup} />{displayName(foodGroup)}
</Legend>
);
Expand Down
6 changes: 3 additions & 3 deletions src/components/day-page/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ const Icons8Referral = () => {
const FoodGroupLegends = () => (
<div className="d-flex justify-content-between flex-wrap grid">
<div className="column">
<FoodGroupLegend foodGroup="vegetable" />
<FoodGroupLegend foodGroup="vegetable" className="mb-1" />
<FoodGroupLegend foodGroup="proteinDiary" />
</div>
<div className="column">
<FoodGroupLegend foodGroup="fruit" />
<FoodGroupLegend foodGroup="fruit" className="mb-1" />
<FoodGroupLegend foodGroup="fat" />
</div>
<div className="column">
<FoodGroupLegend foodGroup="carbohydrate" />
<FoodGroupLegend foodGroup="carbohydrate" className="mb-1" />
<FoodGroupLegend foodGroup="sweet" />
</div>
</div>
Expand Down

0 comments on commit 366876d

Please sign in to comment.