Professional Documents
Culture Documents
No : 13 React Roll:no210701127
AIM :
PROCEDURE:
1. Define a simple controller: In React, there are no controllers. Instead, you create components
to manage the UI and its behavior.
2. After creating modules and controllers, use them in your HTML: In React, you'll import and
use components in your JavaScript files, not in the HTML directly.
3. Include React script and the JavaScript file where you build your React app.
4. Specify the root element in your HTML where the React app will be mounted using the
ReactDOM.render() method.
5. Start working on adding single page application support: React naturally supports single-page
applications (SPAs) as it updates the DOM efficiently without full page reloads.
6. Create a single-page application by developing various components that represent different
pages within your app.
7. Implement client-side routing using a routing library like React Router.
8. Include React Router in your project by installing the react-router-dom package.
9. Define your layout components, such as a header and footer, that will be common to every
page.
10. Create a placeholder in your layout components where the content of each page will be
rendered.
11. Configure your routes using React Router's Route components to specify which component
should be rendered for each URL.
12. Define your routes using Route components and specify the path and the associated
component for each route.
13. Build components for each route that correspond to the pages you want to display.
14. Implement a 404 Not Found page by adding a Route with a wildcard path (*) to catch
undefined routes and redirect to your desired error page.
Build the necessary components for each route, ensuring they have the required functionality and
UI.
PROGRAM:
// App.jsx import React from "react";
return (
<div className="bg-#FoEBE4">
<Routes>
</Routes>
</div>
);
};
//Account.jsx
import { Container, Card, Col, Row, Button } from "react-bootstrap"; import Header
from '../home/Header'; import Footer from '../home/Footer'; import General from
'./GeneralInfo'; import Content from './Content'; const Account = () => {
return (
<div>
<Header />
<Content />
<Footer />
</div>
//Booking.jsx
return (
<>
<Header />
<Content />
<Container className='mt-5'>
</Container>
<Footer />
</>
)}
//Content.jsx
return (
<Container className='mt-5'>
<Nav.Item>
</Nav.Item>
<Nav.Item>
</Nav>
</Container>
return (
<Container className="mt-5">
<Row>
<Col>
<Col sm={1}>Flights</Col>
<Col sm={1}>
<a href="/account">
<AiOutlineUser />
</a>
</Col>
</Row>
</Container>
);
};
];
return (
<Container>
<Card.Text>
<Container>
<Row>
<Col>
<p>
<h3>
</h3>
</p>
</Col>
<Col>
</Col>
</Row>
</Container>
</Card.Text>
<Card.Text>
<Form>
<Container>
<Row>
<Col>
<Form.Label>From</Form.Label>
<Form.Select>
{option}
</option>
))}
</Form.Select>
</Col>
<Col>
<Form.Label>To</Form.Label>
<Form.Select>
{option}
</option>
))}
</Form.Select>
</Col>
<Col>
<Form.Label>Tickets</Form.Label>
<Form.Select>
<option value="1">1</option>
</Col>
<Col>
<Form.Label>Departure</Form.Label>
<DatePicker className="mt-1"
selected={startDate}
onChange={(date) => setStartDate(date)}
/>
</Col>
<Col>
</Button>
</Col>
</Row>
</Container>
</Form>
</Card.Text>
</Card.Body>
</Card>
</Container>
);
};
//TopFlight.jsx
return (
<Container className="mt-5">
<Row>
<Col>
<h6>Top Flights</h6>
</Col>
<Col>
</Col>
</Row>
<Row>
<Col md={4}>
<TopFlightsCard id={showCard}/>
</Col>
<Col>
<Container>
<Row>
<Col>
<Button variant="dark">Book</Button>
</Col>
</Row>
</Container>
</Accordion.Header>
<Accordion.Body>
<Row>
<Col>New Delhi</Col>
<Col>Departure</Col>
<Col>02h 15m</Col>
<Col>Arrival</Col>
<Col>Mumbai</Col>
</Row>
<Row>
<hr />
</Row>
<Row>
<Col>DEL </Col>
<Col>
</Col>
<Col>BOM </Col>
</Row>
</Accordion.Body>
</Accordion.Item>
<Container>
<Row>
<Col>Mumbai -Chennai</Col>
<Col>
<Button variant="dark">Book</Button>
</Col>
</Row>
</Container>
</Accordion.Header>
<Accordion.Body>
<Row>
<Col>Mumbai</Col>
<Col>Departure</Col>
<Col>02h 15m</Col>
<Col>Arrival</Col>
<Col>Chennai</Col>
</Row>
<Row>
<hr />
</Row>
<Row>
<Col>BOM </Col>
<Col>
</Col>
<Col>MAA </Col>
</Row>
</Accordion.Body>
</Accordion.Item>
<Container>
<Row>
<Col>Chennai -Bengaluru</Col>
<Col>
<Button variant="dark">Book</Button>
</Col>
</Row>
</Container>
</Accordion.Header>
<Accordion.Body>
<Row>
<Col>Chennai</Col>
<Col>Departure</Col>
<Col>02h 15m</Col>
<Col>Arrival</Col>
<Col>Bengaluru</Col>
</Row>
<Row>
<hr />
</Row>
<Row>
<Col>MAA </Col>
<Col>
</Col>
<Col>BLR </Col>
</Row>{" "}
</Accordion.Body>
</Accordion.Item>
</Accordion>
</Col>
</Row>
</Container>
);
};
export default TopFlights;
return (
<Row><h6>Why Us</h6></Row>
<Row>
<Col>
</Col>
<Col>
</Col>
<Col>
</Col>
</Row>
</Container>
);
};
RESULT:
Thus the given design was successfully developed and output was verified.