Skip to content

Commit

Permalink
style(ui): update styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Valik3201 committed Jan 22, 2024
1 parent c00b99c commit 6981b99
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 20 deletions.
3 changes: 1 addition & 2 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" data-bs-theme="dark">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
Expand Down
1 change: 0 additions & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
4 changes: 3 additions & 1 deletion src/components/ContactForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class ContactForm extends Component {
const { name, number } = this.state;

return (
<Form onSubmit={this.handleFormSubmit}>
<Form onSubmit={this.handleFormSubmit} autoComplete="off">
<Row>
<Col>
<FloatingLabel
Expand All @@ -75,6 +75,7 @@ export class ContactForm extends Component {
name="name"
value={name}
onChange={this.handleChange}
autoComplete="off"
pattern="^[a-zA-Zа-яА-Я]+(([' -][a-zA-Zа-яА-Я ])?[a-zA-Zа-яА-Я]*)*$"
title="Name may contain only letters, apostrophe, dash and spaces. For example Adrian, Jacob Mercer, Charles de Batz de Castelmore d'Artagnan"
placeholder="Name"
Expand All @@ -93,6 +94,7 @@ export class ContactForm extends Component {
name="number"
value={number}
onChange={this.handleChange}
autoComplete="off"
pattern="\+?\d{1,4}?[-.\s]?\(?\d{1,3}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}"
title="Phone number must be digits and can contain spaces, dashes, parentheses and can start with +"
placeholder="+48 123-456-789"
Expand Down
37 changes: 21 additions & 16 deletions src/components/ContactList.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import PropTypes from 'prop-types';
import ListGroup from 'react-bootstrap/ListGroup';
import Button from 'react-bootstrap/Button';
import Col from 'react-bootstrap/Col';
import Row from 'react-bootstrap/Row';

/**
* ContactList component for displaying a list of contacts.
Expand Down Expand Up @@ -33,22 +35,25 @@ export const ContactList = ({ contacts, onDeleteContact }) => {
*/
const ContactListItem = ({ contact, onDeleteContact }) => {
return (
<ListGroup.Item
as="li"
className="d-flex justify-content-between align-items-start"
>
<div className="fw-bold">{contact.name}</div>

<div className="ms-4 me-auto">{contact.number}</div>

<Button
variant="outline-danger"
size="sm"
type="button"
onClick={() => onDeleteContact(contact.id)}
>
Delete
</Button>
<ListGroup.Item as="li">
<Row>
<Col>
<div className="fw-bold">{contact.name}</div>
</Col>
<Col className="text-start">
<div className="me-auto">{contact.number}</div>
</Col>
<Col className="text-end">
<Button
variant="outline-danger"
size="sm"
type="button"
onClick={() => onDeleteContact(contact.id)}
>
Delete
</Button>
</Col>
</Row>
</ListGroup.Item>
);
};
Expand Down

0 comments on commit 6981b99

Please sign in to comment.