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

feat: Icon Button to use light theme in dark mode #26884

Merged
merged 2 commits into from
Sep 4, 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: 3 additions & 1 deletion ui/components/ui/icon-button/icon-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export default function IconButton(props) {
>
{renderWrapper(
<>
<div className="icon-button__circle">{Icon}</div>
<div data-theme="light" className="icon-button__circle">
{Icon}
</div>
{label.length > 10 ? (
<Tooltip title={label} position="bottom">
<Text
Expand Down
8 changes: 6 additions & 2 deletions ui/components/ui/icon-button/icon-button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import IconButton from './icon-button';
import { TextVariant } from '../../../helpers/constants/design-system';
import {
IconColor,
TextVariant,
} from '../../../helpers/constants/design-system';
import Tooltip from '../tooltip/tooltip';
import { Icon, IconName } from '../../component-library';

const meta: Meta<typeof IconButton> = {
title: 'Components/UI/IconButton',
Expand All @@ -17,7 +21,7 @@ const meta: Meta<typeof IconButton> = {
},
args: {
onClick: () => {},
Icon: <div>Icon</div>,
Icon: <Icon name={IconName.Add} color={IconColor.primaryInverse} />,
disabled: false,
label: 'Icon Button',
tooltipRender: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ exports[`AssetPage should render a native asset 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -57,6 +58,7 @@ exports[`AssetPage should render a native asset 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -74,6 +76,7 @@ exports[`AssetPage should render a native asset 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -93,6 +96,7 @@ exports[`AssetPage should render a native asset 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -111,6 +115,7 @@ exports[`AssetPage should render a native asset 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -129,6 +134,7 @@ exports[`AssetPage should render a native asset 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -147,6 +153,7 @@ exports[`AssetPage should render a native asset 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand Down Expand Up @@ -342,6 +349,7 @@ exports[`AssetPage should render an ERC20 asset without prices 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -360,6 +368,7 @@ exports[`AssetPage should render an ERC20 asset without prices 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -378,6 +387,7 @@ exports[`AssetPage should render an ERC20 asset without prices 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -396,6 +406,7 @@ exports[`AssetPage should render an ERC20 asset without prices 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -413,6 +424,7 @@ exports[`AssetPage should render an ERC20 asset without prices 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -431,6 +443,7 @@ exports[`AssetPage should render an ERC20 asset without prices 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand Down Expand Up @@ -819,6 +832,7 @@ exports[`AssetPage should render an ERC20 token with prices 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -837,6 +851,7 @@ exports[`AssetPage should render an ERC20 token with prices 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -855,6 +870,7 @@ exports[`AssetPage should render an ERC20 token with prices 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -873,6 +889,7 @@ exports[`AssetPage should render an ERC20 token with prices 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -890,6 +907,7 @@ exports[`AssetPage should render an ERC20 token with prices 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand All @@ -908,6 +926,7 @@ exports[`AssetPage should render an ERC20 token with prices 1`] = `
>
<div
class="icon-button__circle"
data-theme="light"
>
<span
class="mm-box mm-icon mm-icon--size-md mm-box--display-inline-block mm-box--color-primary-inverse"
Expand Down