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

Convert the add icon button in the collection selector to a text button #930

Merged
merged 2 commits into from
Jan 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
26 changes: 9 additions & 17 deletions src/components/collection/Selector/Add/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { IconButton, Tooltip, useTheme } from '@mui/material';
import { Button, Tooltip } from '@mui/material';
import AddDialog from 'components/shared/Entity/AddDialog';
import { useEntityType } from 'context/EntityContext';
import { disabledButtonText } from 'context/Theme';
import invariableStores from 'context/Zustand/invariableStores';
import { Plus } from 'iconoir-react';
import { ReactNode, useState } from 'react';
import { useIntl } from 'react-intl';
import { FormattedMessage, useIntl } from 'react-intl';
import { useStore } from 'zustand';

interface Props {
Expand All @@ -22,7 +20,6 @@ function BindingsEditorAdd({
selectedCollections,
}: Props) {
const intl = useIntl();
const theme = useTheme();
const entityType = useEntityType();

const [open, setOpen] = useState<boolean>(false);
Expand Down Expand Up @@ -67,22 +64,17 @@ function BindingsEditorAdd({
return (
<>
<Tooltip placement="top" title={tooltip}>
<IconButton
<Button
aria-controls={open ? DIALOG_ID : undefined}
aria-expanded={open ? 'true' : undefined}
aria-haspopup="true"
disabled={disabled}
onClick={toggleDialog}
sx={{ borderRadius: 0 }}
aria-controls={open ? DIALOG_ID : undefined}
aria-haspopup="true"
aria-expanded={open ? 'true' : undefined}
variant="text"
>
<Plus
style={{
color: disabled
? disabledButtonText[theme.palette.mode]
: theme.palette.primary.main,
}}
/>
</IconButton>
<FormattedMessage id="cta.add" />
</Button>
</Tooltip>
<AddDialog
entity="collection"
Expand Down
1 change: 1 addition & 0 deletions src/lang/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ const CTAs: ResolvedIntlConfig['messages'] = {
'cta.reload': `Reload`,
'cta.evolve': `Apply`,
'cta.support': `contact support`,
'cta.add': `Add`,
};

const Data: ResolvedIntlConfig['messages'] = {
Expand Down