This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref: Convert classes to functions on views
- Loading branch information
Eray C
committed
Nov 1, 2021
1 parent
23e8a8b
commit 7749d4a
Showing
5 changed files
with
76 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,33 @@ | ||
import * as React from "react"; | ||
import { BrowserRouter, Route, NavLink, Switch } from "react-router-dom"; | ||
|
||
import "../index.css"; | ||
|
||
import { IngredientBox } from "../components/IngredientBox"; | ||
import { Button } from "../components/Button"; | ||
|
||
import { defaultMeats } from "../data"; | ||
|
||
export class ChooseMeat extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { ...this.props.order }; | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className="flex flex-col items-center justify-center my-5"> | ||
<div className="my-3 text-3xl font-bold text-center text-red-1000"> | ||
Passons à la viande... ou au tofu ? | ||
</div> | ||
<div className="flex flex-row items-center justify-center mt-5 space-x-4"> | ||
{defaultMeats.map((meat) => ( | ||
<IngredientBox | ||
name={meat.name} | ||
image={meat.image} | ||
onSelected={ | ||
this.state.meat && this.state.meat === meat.name | ||
? true | ||
: false | ||
} | ||
/> | ||
))} | ||
</div> | ||
<div className="my-10"> | ||
<Button /> | ||
</div> | ||
export function ChooseBread(props) { | ||
return ( | ||
<div className="flex flex-col items-center justify-center my-5"> | ||
<div className="my-3 text-3xl font-bold text-center text-red-1000"> | ||
Passons à la viande... ou au tofu ? | ||
</div> | ||
<div className="flex flex-row items-center justify-center mt-5 space-x-4"> | ||
{defaultMeats.map((meat) => ( | ||
<IngredientBox | ||
name={meat.name} | ||
image={meat.image} | ||
onSelected={ | ||
this.state.meat && this.state.meat === meat.name ? true : false | ||
} | ||
/> | ||
))} | ||
</div> | ||
<div className="my-10"> | ||
<Button /> | ||
</div> | ||
); | ||
} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters