Skip to content

Commit

Permalink
fix(NavButton): revert colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiri Kolarik committed Feb 4, 2022
1 parent 38b040c commit ddb1e2d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions src/button-group/button-group.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useStyletron } from "baseui";
import { SIZE } from "baseui/button";
import { NavButton } from "..";
import Button, {
ButtonAppearance,
ButtonProps,
Expand All @@ -14,6 +15,7 @@ export default function ButtonGroup(props: {
appearance?: ButtonAppearance;
size?: SIZE[keyof SIZE];
outline?: boolean;
navigation?: boolean;
}) {
const [, theme] = useStyletron();

Expand Down Expand Up @@ -59,6 +61,24 @@ export default function ButtonGroup(props: {
<>
{props.buttons.map((prop, i) => {
if (prop.to) {
if (props.navigation) {
return (
<NavButton
{...prop}
to={prop.to}
target={prop.target}
appearance={props.appearance || prop.appearance}
outline={props.outline || prop.outline}
size={props.size}
style={{
...prop.style,
...getBorderRadius(i),
...getBorderWidth(i),
}}
/>
);
}

return (
<LinkButton
{...prop}
Expand Down
4 changes: 2 additions & 2 deletions src/link/nav-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export type NavButtonProps = {
export default function NavButton(props: PropsWithChildren<NavButtonProps>) {
const {
to,
active = ButtonAppearance.outline,
appearance = ButtonAppearance.secondary,
active = ButtonAppearance.secondary,
appearance = ButtonAppearance.outline,
...rest
} = props;
const { pathname } = useLocation();
Expand Down

0 comments on commit ddb1e2d

Please sign in to comment.