Skip to content

Commit 7ad0fa4

Browse files
feat: updating styling for the watcher-card and queue-card components (#106)
* feat: adding title property to ButtonInputs * feat: updating preset card styling * feat: updating watcher card styling * feat: display 'N/A' if there are no rules on a watcher
1 parent 5dc67bc commit 7ad0fa4

File tree

7 files changed

+266
-202
lines changed

7 files changed

+266
-202
lines changed

client/src/components/base/inputs/button/button-input.tsx

+15-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,26 @@ type Params = {
44
label?: string;
55
icon?: string;
66
color?: string;
7+
title?: string;
78
disabled?: boolean;
89
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
910
};
1011

11-
export default function ButtonInput({ label, icon, color, disabled = false, onClick }: Params) {
12+
export default function ButtonInput({
13+
label,
14+
icon,
15+
color,
16+
title,
17+
disabled = false,
18+
onClick,
19+
}: Params) {
1220
return (
13-
<button className={`controlled-button ${color}`} onClick={onClick} disabled={disabled}>
21+
<button
22+
className={`controlled-button ${color}`}
23+
onClick={onClick}
24+
disabled={disabled}
25+
title={title}
26+
>
1427
{icon && <i className={`button-icon bi ${icon}`} />}
1528
{label && <span className='button-label'>{label}</span>}
1629
</button>

client/src/components/cards/preset-card/preset-card.scss

+45-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@use 'src/style/modules/colors';
22
@use 'src/style/modules/font';
3+
@use 'src/style/modules/sizing';
34

45
.preset-card {
56
padding: 1rem;
@@ -19,7 +20,6 @@
1920
flex-grow: 1;
2021
margin: 0;
2122
padding: 0.5rem 0;
22-
// border-bottom: 0.2rem solid hsla(0, 0%, 100%, 0.1);
2323
}
2424

2525
.preset-buttons {
@@ -36,29 +36,58 @@
3636

3737
.preset-body {
3838
.preset-tabs {
39-
button {
40-
padding: 0.5rem 1rem;
41-
border: none;
42-
border-radius: 0;
43-
font-family: font.$font-family-primary;
44-
font-size: 1.25rem;
45-
background-color: colors.$transparent-light-tertiary;
46-
color: colors.$text-color-tertiary;
47-
48-
&.current {
49-
background-color: colors.$transparent-light-primary;
50-
color: colors.$text-color-secondary;
39+
display: flex;
40+
flex-flow: row wrap;
41+
42+
.tab-button-container {
43+
max-height: 2.75rem;
44+
45+
button {
46+
height: 200%;
47+
padding: 0.5rem 1rem;
48+
border: none;
49+
border-radius: 0;
50+
font-family: font.$font-family-primary;
51+
font-size: 1.25rem;
52+
border-right: 0.2rem solid colors.$background-five;
53+
border-radius: 1rem 1rem 0 0;
54+
background-color: colors.$background-four;
55+
color: colors.$text-color-tertiary;
56+
display: inline-flex;
57+
58+
&.current {
59+
background-color: colors.$background-five;
60+
color: colors.$text-color-secondary;
61+
}
62+
63+
&:hover {
64+
background-color: colors.$background-five;
65+
border-right: 0.2rem solid colors.$background-six;
66+
}
67+
68+
.tab-button-label {
69+
// max-height: 2.75rem;
70+
}
5171
}
72+
}
5273

53-
&:hover {
54-
background-color: colors.$transparent-light-secondary;
74+
@media screen and (max-width: sizing.$small-max-width) {
75+
.tab-button-container {
76+
flex-grow: 1;
77+
button {
78+
width: 100%;
79+
border-top: 0.2rem solid colors.$background-five;
80+
}
5581
}
5682
}
5783
}
5884

5985
.current-tab {
60-
background-color: colors.$transparent-light-primary;
86+
background-color: colors.$background-five;
6187
padding: 1rem;
88+
border-radius: 1rem;
89+
position: relative;
90+
z-index: 1;
6291

6392
.preset-card-section {
6493
max-width: 100%;

client/src/components/cards/preset-card/preset-card.tsx

+8-7
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ export default function PresetCard({ preset, handleRemovePreset }: Params) {
5050
<div className='preset-body'>
5151
<div className='preset-tabs'>
5252
{tabs.map((tab, index) => (
53-
<button
54-
className={index == currentTab ? 'current' : undefined}
55-
key={tab}
56-
onClick={() => setCurrentTab(index)}
57-
>
58-
{tab}
59-
</button>
53+
<div className='tab-button-container' key={tab}>
54+
<button
55+
className={index == currentTab ? 'current' : undefined}
56+
onClick={() => setCurrentTab(index)}
57+
>
58+
<span className='tab-button-label'>{tab}</span>
59+
</button>
60+
</div>
6061
))}
6162
</div>
6263
<div className='current-tab'>

client/src/components/cards/watcher-card/components/watcher-card-rule.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ export default function WatcherCardRule({
113113
<i className='bi bi-floppy2-fill' />
114114
</button>
115115
)}
116-
<button className='remove-button' onClick={() => handleRemoveRule(id)}>
116+
<button
117+
className='remove-button'
118+
onClick={() => handleRemoveRule(id)}
119+
title='Remove Watcher Rule'
120+
>
117121
<i className='bi bi-trash-fill' />
118122
</button>
119123
</div>

0 commit comments

Comments
 (0)