Skip to content
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

NW6| Rabia Avci | React Module Project | Feature Restaurant-State - Week2 #41

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

RbAvci
Copy link
Owner

@RbAvci RbAvci commented Mar 5, 2024

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

  • Rendered the component in App.js
  • Added new state variable 'orders' with useState
  • Updated component to use 'orders' for ordering functionality
  • Deleted the old 'pizzas' variable
  • Added tests for number of pizzas!

Questions

Ask any questions you have for your reviewer.

RbAvci added 2 commits March 5, 2024 09:22
Updated component to use 'orders' for ordering functionality
Deleted the old 'pizzas' variable
@RbAvci RbAvci requested review from Ara225 and zelihapala March 5, 2024 09:44
Copy link

netlify bot commented Mar 5, 2024

Deploy Preview for cyf-react-hotel-project ready!

Name Link
🔨 Latest commit 9274804
🔍 Latest deploy log https://app.netlify.com/sites/cyf-react-hotel-project/deploys/65e6e97f6f791000081726d4
😎 Deploy Preview https://deploy-preview-41--cyf-react-hotel-project.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@zelihapala zelihapala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general good work!

Comment on lines 3 to +6
const Restaurant = () => {
const pizzas = 0;
const [orders, setOrders] = useState(0);
const handleAddOrder = () => {
setOrders(orders + 1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think nothing would change if you omit the const pizzas = 0; Since the pizzas variable is not used anywhere in the component, removing it would simplify the code without affecting its functionality.

@zelihapala
Copy link
Collaborator

Good Work!

@RbAvci RbAvci merged commit 584e113 into main Mar 5, 2024
4 checks passed
@RbAvci RbAvci deleted the feature/Restaurant branch March 9, 2024 14:38
@RbAvci RbAvci restored the feature/Restaurant branch March 9, 2024 14:38
@RbAvci RbAvci linked an issue Mar 9, 2024 that may be closed by this pull request
Orders: {orders}
<button className="button restaurant__button" onClick={handleAddOrder}>
Add
</button>
</li>
</ul>
</section>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Add more pizzas
3 participants