Skip to content

Commit

Permalink
Merge pull request #634 from frontendnetwork/staging
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
philipbrembeck authored Feb 5, 2024
2 parents 65207af + 1de9a95 commit c5e5bb0
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@dbef88086f6cef02e264edb7dbf63250c17cef6c
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@dbef88086f6cef02e264edb7dbf63250c17cef6c
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"dependencies": {
"@ducanh2912/next-pwa": "^9.7.2",
"@ericblade/quagga2": "^1.8.4",
"@frontendnetwork/veganify": "^1.1.49",
"@types/node": "20.11.0",
"@frontendnetwork/veganify": "^1.1.53",
"@types/node": "20.11.16",
"@types/react-dom": "18.2.18",
"eslint-config-sznm": "^2.0.2",
"jest-worker": "^29.7.0",
Expand Down
21 changes: 14 additions & 7 deletions src/components/check.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Veganify from "@frontendnetwork/veganify";
import Image from "next/image";
import { useTranslations } from "next-intl";
import React, { useState, useEffect, useRef } from "react";
import React, { useState, useEffect, useRef, FormEvent } from "react";

import ModalWrapper from "@/components/elements/modalwrapper";
import ShareButton from "@/components/elements/share";
Expand Down Expand Up @@ -43,7 +43,7 @@ const ProductSearch = () => {
}, []);

/* Submitting */
const handleSubmit = async (barcode: string, event?: React.FormEvent) => {
const handleSubmit = async (barcode: string, event?: FormEvent) => {
event?.preventDefault();
setShowTimeoutFinal(false);
setShowTimeout(false);
Expand All @@ -60,8 +60,13 @@ const ProductSearch = () => {
);
setLoading(false);
if (data.status === 200) {
setResult(data.product);
setSources(data.sources);

if ("product" in data) {
setResult(data.product);
}
if ("sources" in data) {
setSources(data.sources);
}
setShowFound(true);
setShowTimeout(false);
} else if (data.status === 404) {
Expand Down Expand Up @@ -183,7 +188,9 @@ const ProductSearch = () => {
onDetected={(barcode) => setBarcode(barcode)}
handleSubmit={(barcode) => handleSubmit(barcode)}
/>
<label htmlFor="barcodeInput" className="hidden">{t("enterbarcode")}</label>
<label htmlFor="barcodeInput" className="hidden">
{t("enterbarcode")}
</label>
<input
type="number"
name="barcode"
Expand Down Expand Up @@ -368,8 +375,8 @@ const ProductSearch = () => {
GNU FDL
</a>
.<br />
&copy; Veganify Contributors and Hamed Montazeri,
licensed under{" "}
&copy; Veganify Contributors and Hamed Montazeri, licensed
under{" "}
<a href="https://github.com/JokeNetwork/vegan-ingredients-api/blob/master/LICENSE">
MIT License
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/components/elements/container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface ContainerProps {
children: React.ReactNode;
}

export default function Container(props: ContainerProps) {
export default function Container(props: Readonly<ContainerProps>) {
const hasHeading = props.heading ? "true" : "false";
const headingStyle = props.headingstyle ?? undefined;

Expand Down
4 changes: 2 additions & 2 deletions src/components/ingredientscheck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ const IngredientsCheck = () => {
<span className="non-vegan icon-cancel"></span>
</div>
</div>
{flagged.map((item, index) => (
{flagged.map((item) => (
<div className="Grid" key={item}>
<div className="Grid-cell description" key={index}>
<div className="Grid-cell description" key={item}>
{item.charAt(0).toUpperCase() + item.slice(1)}
</div>
<div className="Grid-cell icons">
Expand Down
2 changes: 1 addition & 1 deletion src/styles/_globals/_roots.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:root {
font-size: 16px;

--bg-color: #141414;
--bg-color: #000;
--fg-color: #ccc;
--body-font: "MonaSans", Fallback, sans-serif;
--body-fontweight: 400;
Expand Down

0 comments on commit c5e5bb0

Please sign in to comment.