Skip to content

Commit

Permalink
Added skeleton loader.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbeutler committed Oct 22, 2022
1 parent 2f79b34 commit e87e5b2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
10 changes: 5 additions & 5 deletions components/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const Content = () => {
fontSize: "$sm",
}}
>
{item.kcal} kcal
12x
</Text>
</Row>
</Card.Footer>
Expand All @@ -185,7 +185,7 @@ export const Content = () => {
<Grid.Container justify="center" gap={1}>
<Grid xs={6}>
<Text size={18} weight="bold" css={{ verticalAlign: "middle" }}>
{selected.length} selected
{selected.length} ausgewählt
</Text>
</Grid>
<Grid xs={6}>
Expand All @@ -196,7 +196,7 @@ export const Content = () => {
style={{ width: "100%" }}
onPress={() => handleSubmit()}
>
Go
Suchen
</Button>
</Grid>
</Grid.Container>
Expand All @@ -213,7 +213,7 @@ export const Content = () => {
>
<Modal.Header>
<Text id="modal-name" size={18}>
Recommended Recipes
Empfohlene Rezepte
</Text>
</Modal.Header>
<Modal.Body>
Expand All @@ -227,7 +227,7 @@ export const Content = () => {
</Modal.Body>
<Modal.Footer>
<Button flat auto color="error" onClick={() => setVisible(false)}>
Close
Schliessen
</Button>
</Modal.Footer>
</Modal>
Expand Down
20 changes: 8 additions & 12 deletions components/IngredientsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from "react";
import { Grid, Input, Table } from "@nextui-org/react";
import { Button, Grid, Input, Table } from "@nextui-org/react";
import { Ingredient } from "../models/ingredient";

export interface IngredientsTableProps {
Expand All @@ -14,15 +14,7 @@ const IngredientsTable: React.FC<IngredientsTableProps> = ({
const [persons, setPersons] = useState<number>(p);

return (
<Grid.Container gap={2}>
<Grid xs={12}>
<Input
label="Personen"
type="number"
placeholder={persons.toString()}
onInput={(e) => setPersons(Number(e.currentTarget.value))}
/>
</Grid>
<Grid.Container gap={1}>
<Grid xs={12}>
<Table
css={{
Expand All @@ -31,8 +23,12 @@ const IngredientsTable: React.FC<IngredientsTableProps> = ({
}}
>
<Table.Header>
<Table.Column>Anzahl</Table.Column>
<Table.Column>Zutat</Table.Column>
<Table.Column>
<Grid.Container>
<Grid>Anzahl</Grid>
</Grid.Container>
</Table.Column>
<Table.Column>Zutaten</Table.Column>
</Table.Header>
<Table.Body>
{ingredients.map((ingredient) => (
Expand Down
1 change: 1 addition & 0 deletions components/RecipeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const RecipeCard: React.FC<RecipeCardProps> = ({ recipe }) => {
width="100%"
height={150}
alt={recipe.name}
showSkeleton
/>
</Card>
);
Expand Down

0 comments on commit e87e5b2

Please sign in to comment.