Adjust table header/row coloring (#3655)

* Adjust table header/row coloring

* calnedra rows
This commit is contained in:
Jaco Greeff 2020-09-11 08:55:43 +02:00 committed by GitHub
parent daee6e86e8
commit 57dc4d560d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 31 additions and 17 deletions

View File

@ -257,6 +257,7 @@ function Endpoints ({ className = '', offset, onClose }: Props): React.ReactElem
}
export default React.memo(styled(Endpoints)`
color: #4e4e4e;
padding-top: 3.5rem;
.customButton {

View File

@ -21,7 +21,7 @@ function Grouping ({ className = '', name, routes }: Props): React.ReactElement<
if (routes.length === 1) {
return (
<Item
className='topLevel'
isToplevel
route={routes[0]}
/>
);

View File

@ -11,17 +11,18 @@ import { useToggle } from '@polkadot/react-hooks';
interface Props {
className?: string;
isToplevel?: boolean;
route: ItemRoute;
}
const DUMMY_COUNTER = () => 0;
function Item ({ className = '', route: { Modal, href, icon, name, text, useCounter = DUMMY_COUNTER } }: Props): React.ReactElement<Props> {
function Item ({ className = '', isToplevel, route: { Modal, href, icon, name, text, useCounter = DUMMY_COUNTER } }: Props): React.ReactElement<Props> {
const [isModalVisible, toggleModal] = useToggle();
const count = useCounter();
return (
<li className={`${className}${count ? ' withCounter' : ''} highlight--hover-color`}>
<li className={`${className}${count ? ' withCounter' : ''}${isToplevel ? ' topLevel' : ''} highlight--hover-color`}>
<a
href={Modal ? undefined : (href || `#/${name}`)}
onClick={Modal ? toggleModal : undefined}

View File

@ -147,7 +147,7 @@ function Menu ({ className = '' }: Props): React.ReactElement<Props> {
<ul className='menuItems'>
{externalRef.current.map((route): React.ReactNode => (
<Item
className='topLevel'
isToplevel
key={route.name}
route={route}
/>

View File

@ -64,7 +64,7 @@ function Day ({ className, date, hasNextDay, now, scheduled, setNextDay, setPrev
/>
</Button.Group>
</h1>
<div className='hoursContainer'>
<div className='hoursContainer highlight--bg-faint'>
{HOURS.map((hour, index): React.ReactNode =>
<DayHour
date={date}
@ -90,4 +90,8 @@ export default React.memo(styled(Day)`
justify-content: space-between;
padding: 1rem 1.5rem 0;
}
.hoursContainer {
z-index: 1;
}
`);

View File

@ -58,9 +58,9 @@ export default React.memo(styled(DayHour)`
position: relative;
z-index: 2;
&:nth-child(even) {
background: #faf8f6;
}
// &:nth-child(even) {
// background: #faf8f6;
// }
&:nth-child(odd) {
background: white;

View File

@ -150,12 +150,12 @@ export default React.memo(styled(Body)`
}
tr {
&:nth-child(odd) {
background: #faf8f6;
}
// &:nth-child(odd) {
// background: #faf8f6;
// }
&:nth-child(even) {
background: rgba(255, 254, 253, 1);
&:nth-child(odd) {
background: white;
}
&:first-child {

View File

@ -35,6 +35,6 @@ export default React.memo(styled(Foot)`
}
tr {
background: transparent;
background: #f5f3f1;
}
`);

View File

@ -35,7 +35,7 @@ function Head ({ className = '', filter, header, isEmpty }: Props): React.ReactE
onClick={onClick}
>
{index === 0
? <h1>{label}</h1>
? <h1 className='highlight--color'>{label}</h1>
: isEmpty
? ''
: label

View File

@ -36,7 +36,7 @@ function Table ({ children, className = '', empty, emptySpinner, filter, footer,
return (
<div className={`ui--Table ${className}`}>
<table className={`${(isFixed && !isEmpty) ? 'isFixed' : 'isNotFixed'}`}>
<table className={`${(isFixed && !isEmpty) ? 'isFixed' : 'isNotFixed'} highlight--bg-faint`}>
<Head
filter={filter}
header={header}

View File

@ -39,6 +39,7 @@ export default createGlobalStyle<Props>`
background: ${getHighlight} !important;
}
.highlight--bg-faint,
.highlight--bg-light {
background: white;
position: relative;
@ -48,7 +49,6 @@ export default createGlobalStyle<Props>`
bottom: 0;
content: ' ';
left: 0;
opacity: 0.09;
position: absolute;
right: 0;
top: 0;
@ -56,6 +56,14 @@ export default createGlobalStyle<Props>`
}
}
.highlight--bg-faint:before {
opacity: 0.025;
}
.highlight--bg-light:before {
opacity: 0.09;
}
.highlight--border {
border-color: ${getHighlight} !important;
}