(core) Mark 'Compare to Original' menu item with the 'beta' tag

Test Plan: Manually checked the tweaked look.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D2674
This commit is contained in:
Dmitry S 2020-11-25 21:44:07 -05:00
parent 840f46d051
commit 32f3d03c3d

View File

@ -12,7 +12,7 @@ import {buildUrlId, parseUrlId} from 'app/common/gristUrls';
import * as roles from 'app/common/roles';
import {Document} from 'app/common/UserAPI';
import {dom, DomContents, styled} from 'grainjs';
import {MenuCreateFunc} from 'popweasel';
import {cssMenuItem, MenuCreateFunc} from 'popweasel';
function buildOriginalUrlId(urlId: string, isSnapshot: boolean): string {
const parts = parseUrlId(urlId);
@ -155,6 +155,7 @@ function menuOriginal(doc: Document, appModel: AppModel, isSnapshot: boolean) {
testId('replace-original'),
),
menuItemLink({href: originalUrlComparison, target: '_blank'}, `Compare to ${termToUse}`,
cssAnnotateMenuItem('Beta'),
testId('compare-original'),
),
];
@ -296,3 +297,17 @@ const cssMenuIconLink = styled('a', `
const cssMenuIcon = styled(icon, `
display: block;
`);
const cssAnnotateMenuItem = styled('span', `
color: ${colors.lightGreen};
text-transform: uppercase;
font-size: 8px;
vertical-align: super;
margin-top: -4px;
margin-left: 4px;
font-weight: bold;
.${cssMenuItem.className}-sel > & {
color: white;
}
`);