use bg colors from theme

This commit is contained in:
Matthew Russell 2022-03-01 16:26:51 -08:00
parent 62187b38dd
commit 375697a18a
3 changed files with 38 additions and 18 deletions

View File

@ -2,7 +2,7 @@ import { useRouter } from 'next/router';
import classNames from 'classnames'; import classNames from 'classnames';
export const Navbar = () => { export const Navbar = () => {
const navClasses = classNames('border-black border-b'); const navClasses = classNames('border-neutral-200 border-b');
return ( return (
<nav className={navClasses}> <nav className={navClasses}>
{[ {[
@ -23,7 +23,8 @@ interface NavLinkProps {
const NavLink = ({ name, path }: NavLinkProps) => { const NavLink = ({ name, path }: NavLinkProps) => {
const router = useRouter(); const router = useRouter();
const className = classNames('inline-block', 'p-8', { const className = classNames('inline-block', 'p-8', {
'text-vega-pink': router.asPath === path, // Handle direct math and child page matches
'text-vega-pink': router.asPath === path || router.asPath.startsWith(path),
}); });
return ( return (

View File

@ -66,7 +66,7 @@ interface TradeGridProps {
const TradeGrid = ({ market }: TradeGridProps) => { const TradeGrid = ({ market }: TradeGridProps) => {
return ( return (
<div className="h-full max-h-full grid gap-[1px] bg-[#ddd] grid-cols-[1fr_325px_325px] grid-rows-[min-content_1fr_200px]"> <div className="h-full max-h-full grid gap-[1px] bg-neutral-200 grid-cols-[1fr_325px_325px] grid-rows-[min-content_1fr_200px]">
<header className="col-start-1 col-end-2 row-start-1 row-end-1 bg-white p-8"> <header className="col-start-1 col-end-2 row-start-1 row-end-1 bg-white p-8">
<h1>Market: {market.name}</h1> <h1>Market: {market.name}</h1>
</header> </header>
@ -134,14 +134,20 @@ const GridTabs = ({ children, group }: GridTabsProps) => {
return ( return (
<div className="h-full grid grid-rows-[min-content_1fr]"> <div className="h-full grid grid-rows-[min-content_1fr]">
{/* the tabs */} {/* the tabs */}
<div className="flex gap-[2px] bg-[#ddd]" role="tablist"> <div className="flex gap-[2px] bg-neutral-200" role="tablist">
{Children.map(children, (child) => { {Children.map(children, (child) => {
if (!isValidElement(child)) return null; if (!isValidElement(child)) return null;
const isActive = query[group] === child.props.name; const isActive = query[group] === child.props.name;
const buttonClass = classNames('py-4 px-12 capitalize', { const buttonClass = classNames(
'py-4',
'px-12',
'border-t border-neutral-200',
'capitalize',
{
'text-vega-pink': isActive, 'text-vega-pink': isActive,
'bg-white': isActive, 'bg-white': isActive,
}); }
);
return ( return (
<button <button
className={buttonClass} className={buttonClass}
@ -224,16 +230,28 @@ const TradePanels = ({ market }: TradePanelsProps) => {
)} )}
</AutoSizer> </AutoSizer>
</div> </div>
<div className="flex flex-nowrap gap-2 border-t overflow-x-auto"> <div className="flex flex-nowrap gap-2 bg-neutral-200 border-neutral-200 border-t overflow-x-auto">
{Object.keys(Views).map((key: View) => ( {Object.keys(Views).map((key: View) => {
const className = classNames(
'p-8',
'border-t',
'border-neutral-200',
'capitalize',
{
'text-vega-pink': view === key,
'bg-white': view === key,
}
);
return (
<button <button
onClick={() => setView(key)} onClick={() => setView(key)}
className="p-12 capitalize" className={className}
key={key} key={key}
> >
{key} {key}
</button> </button>
))} );
})}
</div> </div>
</div> </div>
); );

View File

@ -90,6 +90,7 @@ module.exports = {
black: '#000', black: '#000',
white: theme('colors.white'), white: theme('colors.white'),
danger: theme('colors.intent.background.danger'), danger: theme('colors.intent.background.danger'),
'neutral-200': theme('colors.neutral.200'),
}), }),
borderWidth: { borderWidth: {
DEFAULT: '1px', DEFAULT: '1px',