Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
code formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
s-vamshi committed Oct 16, 2022
1 parent 0f78bca commit 609b5dd
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 48 deletions.
10 changes: 8 additions & 2 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,14 @@ function App() {
<Route path="/admin/users" component={UsersListScreen} />
<Route path="/admin/user/:id" component={UserEditScreen} />
<Route path="/admin/productlist" component={ProductListScreen} />
<Route path="/admin/createproduct" component={CreateProductScreen} />
<Route path="/admin/product/:id/edit" component={ProductEditScreen} />
<Route
path="/admin/createproduct"
component={CreateProductScreen}
/>
<Route
path="/admin/product/:id/edit"
component={ProductEditScreen}
/>
<Route path="/admin/orderlist" component={OrderListScreen} />
<Route path="/admin/carousellist" component={CarouselListScreen} />
<Route
Expand Down
40 changes: 21 additions & 19 deletions frontend/src/screens/CreateProductScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const CreateProductScreen = ({ history }) => {
const [description, setDescription] = useState('')
const [uploading, setUploading] = useState(false)


const dispatch = useDispatch()

const productCreate = useSelector((state) => state.productCreate)
Expand Down Expand Up @@ -186,24 +185,27 @@ const CreateProductScreen = ({ history }) => {
></Form.Control>
</Form.Group>

<Form.Group controlId="Category">
<Form.Label>Category</Form.Label>
<Form.Control
className='form-select'
as="select"
value={category}
onChange={e => {
setCategory(e.target.value);
}}
>
<option value="">--Select One--</option>
{
categories && categories.map((category)=>{
return <option key={category._id} value={category.name}>{Capitalizer(category.name)}</option>
})
}
</Form.Control>
</Form.Group>
<Form.Group controlId="Category">
<Form.Label>Category</Form.Label>
<Form.Control
className="form-select"
as="select"
value={category}
onChange={(e) => {
setCategory(e.target.value)
}}
>
<option value="">--Select One--</option>
{categories &&
categories.map((category) => {
return (
<option key={category._id} value={category.name}>
{Capitalizer(category.name)}
</option>
)
})}
</Form.Control>
</Form.Group>

<Form.Group controlId="description">
<Form.Label>Description</Form.Label>
Expand Down
20 changes: 10 additions & 10 deletions frontend/src/screens/Error404Screen.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import React from 'react'
import {Row,Col,Button} from 'react-bootstrap'
import { Row, Col, Button } from 'react-bootstrap'
import { LinkContainer } from 'react-router-bootstrap'

function Error404Screen() {
return (
<>
<br />
<center className='mt-5 '>
<Row className='g-0 d-flex align-items-center'>
<br />
<center className="mt-5 ">
<Row className="g-0 d-flex align-items-center">
<Col xs={5} md={6}>
<div className="text-dark display-1 float-end">404</div>
<div className="text-dark display-1 float-end">404</div>
</Col>
<Col xs={7} md={6}>
<p className="text-dark float-start pt-2 pt-md-3"><b>Page not found</b></p>
<p className="text-dark float-start pt-2 pt-md-3">
<b>Page not found</b>
</p>
</Col>
</Row>
<LinkContainer to="/">
<Button className='mt-1 px-5'>
Take me home
</Button>
<Button className="mt-1 px-5">Take me home</Button>
</LinkContainer>
</center>
</>
)
}

export default Error404Screen
export default Error404Screen
37 changes: 20 additions & 17 deletions frontend/src/screens/ProductEditScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,23 +205,26 @@ const ProductEditScreen = ({ match, history }) => {
></Form.Control>
</Form.Group>

<Form.Group controlId="Category">
<Form.Label>Category</Form.Label>
<Form.Control
className='form-select'
as="select"
value={category}
onChange={e => {
setCategory(e.target.value);
}}
>
{
categories && categories.map((category)=>{
return <option key={category._id} value={category.name}>{Capitalizer(category.name)}</option>
})
}
</Form.Control>
</Form.Group>
<Form.Group controlId="Category">
<Form.Label>Category</Form.Label>
<Form.Control
className="form-select"
as="select"
value={category}
onChange={(e) => {
setCategory(e.target.value)
}}
>
{categories &&
categories.map((category) => {
return (
<option key={category._id} value={category.name}>
{Capitalizer(category.name)}
</option>
)
})}
</Form.Control>
</Form.Group>

<Form.Group controlId="description">
<Form.Label>Description</Form.Label>
Expand Down

0 comments on commit 609b5dd

Please sign in to comment.