Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Commit

Permalink
refactor: misc tooltip improvements (#895)
Browse files Browse the repository at this point in the history
* refactor: improve tooltip text

* refactor: fix project edit button tooltip position

* refactor: fix header docs link tooltip position
  • Loading branch information
olav authored Apr 21, 2022
1 parent f6371c2 commit 8c1efaf
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const FeatureStrategyRemove = ({
disabled={disabled}
permission={DELETE_FEATURE_STRATEGY}
data-testid={STRATEGY_FORM_REMOVE_ID}
tooltip="Delete strategy"
tooltip="Remove strategy"
type="button"
>
<Delete />
Expand All @@ -87,20 +87,20 @@ export const FeatureStrategyRemove = ({
variant="text"
type="button"
>
Delete strategy
Remove strategy
</PermissionButton>
}
/>
<Dialogue
title="Are you sure you want to delete this strategy?"
open={openDialogue}
primaryButtonText="Delete strategy"
primaryButtonText="Remove strategy"
secondaryButtonText="Cancel"
onClick={onRemove}
onClose={() => setOpenDialogue(false)}
>
<Alert severity="error">
Deleting the strategy will change which users receive access
Removing the strategy will change which users receive access
to the feature.
</Alert>
</Dialogue>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const FeatureOverviewEnvironmentStrategy = ({
projectId={projectId}
component={Link}
to={editStrategyPath}
tooltip="Edit"
tooltip="Edit strategy"
>
<Edit />
</PermissionIconButton>
Expand Down
2 changes: 1 addition & 1 deletion src/component/feature/FeatureView/FeatureView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const FeatureView = () => {
data-loading
component={Link}
to={`/projects/${projectId}/features/${featureId}/strategies/copy`}
tooltip="Copy feature"
tooltip="Copy feature toggle"
>
<FileCopy />
</PermissionIconButton>
Expand Down
12 changes: 0 additions & 12 deletions src/component/menu/Header/Header.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,4 @@ export const useStyles = makeStyles(theme => ({
display: 'flex',
color: '#000',
},
docsLink: {
color: '#000',
textDecoration: 'none',
padding: '0.25rem 0.8rem',
display: 'flex',
alignItems: 'center',
},
docsIcon: {
color: '#6C6C6C',
height: '25px',
width: '25px',
},
}));
13 changes: 5 additions & 8 deletions src/component/menu/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,14 @@ const Header = () => {
/>
</div>
<div className={styles.userContainer}>
<Tooltip title="Go to the documentation">
<a
<Tooltip title="Documentation">
<IconButton
href="https://docs.getunleash.io/"
target="_blank"
rel="noopener noreferrer"
className={styles.docsLink}
>
<MenuBookIcon className={styles.docsIcon} />
</a>
<MenuBookIcon />
</IconButton>
</Tooltip>
<ConditionallyRender
condition={admin}
Expand All @@ -139,9 +138,7 @@ const Header = () => {
setAnchorEl(e.currentTarget)
}
>
<SettingsIcon
className={styles.docsIcon}
/>
<SettingsIcon />
</IconButton>
</Tooltip>
}
Expand Down
24 changes: 13 additions & 11 deletions src/component/project/Project/ProjectInfo/ProjectInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,19 @@ const ProjectInfo = ({
[styles.permissionButtonShortDesc]: isShortDescription,
});
const permissionButton = (
<PermissionIconButton
permission={UPDATE_PROJECT}
projectId={id}
component={Link}
className={permissionButtonClass}
data-loading
to={`/projects/${id}/edit`}
tooltip="Edit description"
>
<Edit />
</PermissionIconButton>
<div>
<PermissionIconButton
permission={UPDATE_PROJECT}
projectId={id}
component={Link}
className={permissionButtonClass}
data-loading
to={`/projects/${id}/edit`}
tooltip="Edit description"
>
<Edit />
</PermissionIconButton>
</div>
);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/component/project/ProjectCard/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const ProjectCard = ({
className={styles.actionsBtn}
data-loading
onClick={handleClick}
tooltip="Menu"
tooltip="Options"
>
<MoreVertIcon />
</PermissionIconButton>
Expand Down

0 comments on commit 8c1efaf

Please sign in to comment.