Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme not correctly applied to sidebar tab #886

Merged
merged 6 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Editor input not focussing on iPad (#898)

### Fixed

- Sidebar selected option styling (#886)

## [0.21.1] - 2024-01-11

### Added
Expand Down
5 changes: 4 additions & 1 deletion src/assets/stylesheets/Sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
border-radius: $space-0-5 0 0 $space-0-5;
border-block: 1px solid var(--sidebar-border);
border-inline-start: 1px solid var(--sidebar-border);

.sidebar__bar-option {
border: 2px solid var(--sidebar-option-selected-border);
}
}
}

Expand All @@ -106,7 +110,6 @@
}

&--selected {
border: 2px solid var(--sidebar-option-selected-border);
background-color: var(--sidebar-option-selected-background);

svg {
Expand Down
33 changes: 17 additions & 16 deletions src/components/Button/Button.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import "../../assets/stylesheets/Button.scss";

import React from "react";
import { confirmAlert } from "react-confirm-alert";
import "react-confirm-alert/src/react-confirm-alert.css";
import { Link } from "react-router-dom";
import classNames from "classnames";

import "../../assets/stylesheets/Button.scss";

const Button = (props) => {
const {
Expand All @@ -25,9 +26,9 @@ const Button = (props) => {
buttonIconPosition = "left",
} = props;

const buttonClass = `btn${className ? ` ${className}` : ""}${
buttonText ? "" : " btn--svg-only"
}`;
const buttonClass = classNames("btn", className, {
"btn--svg-only": !buttonText,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yesssssss nice

});

const onButtonClick = (e) => {
if (!confirmText) {
Expand Down Expand Up @@ -64,10 +65,10 @@ const Button = (props) => {
onClick={buttonOuter ? null : onButtonClick}
onKeyDown={onKeyDown}
>
{buttonImage ? <img src={buttonImage} alt={buttonImageAltText} /> : null}
{ButtonIcon && buttonIconPosition === "left" ? <ButtonIcon /> : null}
{text ? <span>{text}</span> : null}
{ButtonIcon && buttonIconPosition === "right" ? <ButtonIcon /> : null}
{buttonImage && <img src={buttonImage} alt={buttonImageAltText} />}
{ButtonIcon && buttonIconPosition === "left" && <ButtonIcon />}
{text && <span>{text}</span>}
{ButtonIcon && buttonIconPosition === "right" && <ButtonIcon />}
</Link>
) : (
<button
Expand All @@ -80,19 +81,19 @@ const Button = (props) => {
onClick={buttonOuter ? null : onButtonClick}
onKeyDown={onKeyDown}
>
{buttonImage ? <img src={buttonImage} alt={buttonImageAltText} /> : null}
{ButtonIcon && buttonIconPosition === "left" ? <ButtonIcon /> : null}
{buttonText ? <span>{buttonText}</span> : null}
{ButtonIcon && buttonIconPosition === "right" ? <ButtonIcon /> : null}
{buttonImage && <img src={buttonImage} alt={buttonImageAltText} />}
{ButtonIcon && buttonIconPosition === "left" && <ButtonIcon />}
{buttonText && <span>{buttonText}</span>}
{ButtonIcon && buttonIconPosition === "right" && <ButtonIcon />}
</button>
);

if (buttonOuter) {
return (
<div
className={`btn-outer${
buttonOuterClassName ? ` ${buttonOuterClassName}` : ""
}`}
className={classNames("btn-outer", {
buttonOuterClassName,
})}
onClick={onButtonClick}
>
{button}
Expand Down
Loading