Skip to content

Commit 80ab9e7

Browse files
committed
design upd
1 parent a6bfb2f commit 80ab9e7

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

src/App.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,15 @@
5050
transform: rotate(360deg);
5151
}
5252
}
53+
54+
.palitra-blackOnHover:hover {
55+
color: black !important;
56+
}
57+
58+
.palitra-blackOnHover {
59+
border-color: lightgray !important;
60+
}
61+
62+
.palitra-btn:focus {
63+
box-shadow: 0 0 0 0.2rem rgb(216 217 219 / 50%) !important;
64+
}

src/Cards/AddCard.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ function AddCard({ onCreate, onDeleteAll }) {
2020

2121
const defColor = colors[0]
2222
const [color, setColor] = React.useState(defColor)
23+
const blackOnHover = () => {
24+
switch (color) {
25+
case colors[0]:
26+
case colors[2]:
27+
case colors[3]:
28+
case colors[4]:
29+
case colors[6]:
30+
case colors[8]:
31+
return true
32+
default:
33+
return false
34+
}
35+
}
2336

2437
function submitHandler() {
2538
if (String(input.value()).trim() && String(color).trim()) {
@@ -33,7 +46,7 @@ function AddCard({ onCreate, onDeleteAll }) {
3346
<div className="container">
3447
<div className="row my-2 text-center">
3548

36-
<div className="col-lg-12 col-md-12 p-1">
49+
<div className="col-lg-9 col-md-10 col-12 p-1">
3750
<TextareaAutosize type="text" className="form-control" placeholder="Card name" id="Text"
3851
{...input.bind}
3952
style={{ resize: "none" }}
@@ -43,16 +56,15 @@ function AddCard({ onCreate, onDeleteAll }) {
4356
/>
4457
</div>
4558

46-
<div className="col-lg-8 col-md-6 col-sm-4 p-1">
47-
<Palette setColor={setColor} className="btn btn-outline-secondary" style={{ width: "100%" }}></Palette>
48-
</div>
49-
50-
<div className="col-lg-2 col-md-3 col-sm-4 col-6 p-1">
51-
<button disabled={!input.value().trim()} className="btn btn-success btn-block" onClick={submitHandler}><i className="bi bi-clipboard-plus"></i> Add card</button>
59+
<div className="col-lg-1 col-md-1 col-sm-3 col-4 p-1">
60+
<Palette setColor={setColor} className={`btn btn-outline-secondary palitra-btn ${blackOnHover() ? "palitra-blackOnHover" : ""}`} style={{ width: "100%", background: color }}></Palette>
5261
</div>
5362

54-
<div className="col-lg-2 col-md-3 col-sm-4 col-6 p-1">
55-
<button className="btn btn-danger btn-block" onClick={onDeleteAll}><i className="bi bi-x-square"></i> Delete All</button>
63+
<div className="col-lg-2 col-md-1 col p-1">
64+
<button disabled={!input.value().trim()} className="btn btn-success btn-block" onClick={submitHandler}>
65+
<i className="bi bi-clipboard-plus"></i>
66+
<span className='d-lg-inline d-none'> Add card</span>
67+
</button>
5668
</div>
5769

5870
</div>

src/Cards/palette.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from "react";
22
import PropTypes from 'prop-types'
33

44
export const colors = [
5+
"#f8f9fa",
56
"#F38181",
67
"#FCE38A",
78
"#EAFFD0",

0 commit comments

Comments
 (0)