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

FR | image files #2

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open

Conversation

Farah-Rashid
Copy link

No description provided.

@@ -0,0 +1,118 @@
import styled from "styled-components";
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is some } missing in this file. Please check it.

@@ -0,0 +1,141 @@
import React, { useState } from "react";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Refactor this component to smaller components and separate logic from presentation.

@@ -0,0 +1,74 @@
import React from "react";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Adjust the modal styling to always be in the center.

@@ -0,0 +1,16 @@
import React from 'react'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please rename the file to be more specific may be like SeatIcon or SeatComponent. Since this is a react component, change extension to jsx to stay consistent with naming and move it with other react components.

<MoviePic src={imgUrl + param.path} alt="movie" />

<article>
<h3>Seats:</h3>
Copy link
Collaborator

Choose a reason for hiding this comment

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

The seats text is not as per the design. Please check and update.

src/App.js Outdated
<>
<Routes>
<Route path="/" element={<HomePage/>}/>
<Route path="/bookingseat/:id/:path" element={<BookingSeat/>}/>
Copy link
Collaborator

@hhkk28 hhkk28 Aug 1, 2022

Choose a reason for hiding this comment

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

The redirected url when a movie is clicked - http://localhost:3000/bookingseat/438148/wKiOkZTN9lUUUNZLmtnwubZYONg.jpg The url should be - http://localhost:3000/book/438148/minions-the-rise-of-gru

@hhkk28
Copy link
Collaborator

hhkk28 commented Aug 1, 2022

Please use tool to format the code to have even indents and consistent spacing.

function handleSeats(id) {
if (selected.includes(id)) {
alert("already selected");
let data = selectedSeats.filter((item) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Conflicting variable names. Please fix it.

setSelectedSeats={setSelectedSeats}
/>
<ConfirmButton onClick={modalHandle}>Confirm booking</ConfirmButton>
<article>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove this article tag.

const [selectedSeats, setSelectedSeats] = useState([]);

let param = useParams();
let selected = [];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please elaborate the difference between the variable names selectedSeats and selected array.

},
[])

async function getMovies(url) {
Copy link
Collaborator

@hhkk28 hhkk28 Aug 1, 2022

Choose a reason for hiding this comment

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

Please declare function before calling the function.

setMovies(result);
}

const submit = (e) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please be consistent with syntax. either choose function keyword and use it across the app or choose arrow function syntax and use it across the app. Do not mix both.


import close from "../Asset/Xclose.png";
import { useParams } from "react-router";
const imgUrl = "https://image.tmdb.org/t/p/w500/";
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is already a constant file to maintain all the urls, please move this variable to that file.


return (
<>
<GlobalStyles />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add global styles in the index.js file instead of using it in a particular component.

[])

async function getMovies(url) {
const response = await axios.get(url);
Copy link
Member

Choose a reason for hiding this comment

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

Please add error handling. Always wrap the API calls inside try catch block and handle errors if any.

align-items: center;
position: relative;

${ButtonStyle} {
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 This is how we should be using styled components to style nested components.

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.

3 participants