UNPKG

sanity-plugin-seo-tools

Version:

> Upgrading from V2 to V3 is a breaking change. The `seo-tools` input has been replaced by a SEO pane which needs to be set-up using a custom desk structure as per the installation guide. Secondly, the previously automatically provided fields (focus keywo

22 lines (21 loc) 1.06 kB
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; import React, { useMemo } from 'react'; import styled from 'styled-components'; import { Box } from '@sanity/ui'; var StyledBubbleBox = styled(Box)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-radius: 9999px;\n margin-top: .4rem;\n width: .8rem;\n height: .8rem;\n"], ["\n border-radius: 9999px;\n margin-top: .4rem;\n width: .8rem;\n height: .8rem;\n"]))); export var SeoRatingBubble = function (_a) { var rating = _a.rating; var color = useMemo(function () { switch (rating) { case 'good': return '#7ad03a'; case 'ok': return '#ee7c1b'; case 'bad': return '#dc3232'; default: return '#888'; } }, [rating]); return (React.createElement(StyledBubbleBox, { style: { backgroundColor: color } })); }; var templateObject_1;