failed the script when bundle:default fails and cleanup "alpha" (#8580)
This commit is contained in:
@@ -3,10 +3,6 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/Tooltip';
|
||||
import { defineMessages, useIntl } from '../../i18n';
|
||||
|
||||
const i18n = defineMessages({
|
||||
alpha: {
|
||||
id: 'environmentBadge.alpha',
|
||||
defaultMessage: 'Alpha',
|
||||
},
|
||||
dev: {
|
||||
id: 'environmentBadge.dev',
|
||||
defaultMessage: 'Dev',
|
||||
@@ -19,18 +15,13 @@ interface EnvironmentBadgeProps {
|
||||
|
||||
const EnvironmentBadge: React.FC<EnvironmentBadgeProps> = ({ className = '' }) => {
|
||||
const intl = useIntl();
|
||||
const isAlpha = process.env.ALPHA;
|
||||
const isDevelopment = import.meta.env.DEV;
|
||||
|
||||
// Don't show badge in production
|
||||
if (!isDevelopment && !isAlpha) {
|
||||
if (!isDevelopment) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const tooltipText = isAlpha
|
||||
? intl.formatMessage(i18n.alpha)
|
||||
: intl.formatMessage(i18n.dev);
|
||||
const bgColor = isAlpha ? 'bg-purple-600' : 'bg-orange-400';
|
||||
const tooltipText = intl.formatMessage(i18n.dev);
|
||||
|
||||
return (
|
||||
<Tooltip>
|
||||
@@ -41,13 +32,13 @@ const EnvironmentBadge: React.FC<EnvironmentBadgeProps> = ({ className = '' }) =
|
||||
aria-label={tooltipText}
|
||||
>
|
||||
<div className="absolute -inset-1" />
|
||||
<div className={`${bgColor} w-2 h-2 rounded-full`} />
|
||||
<div className="bg-orange-400 w-2 h-2 rounded-full" />
|
||||
</div>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent
|
||||
side="bottom"
|
||||
className={bgColor}
|
||||
arrowClassName={isAlpha ? 'fill-purple-600 bg-purple-600' : 'fill-orange-400 bg-orange-400'}
|
||||
className="bg-orange-400"
|
||||
arrowClassName="fill-orange-400 bg-orange-400"
|
||||
>
|
||||
{tooltipText}
|
||||
</TooltipContent>
|
||||
|
||||
@@ -932,9 +932,6 @@
|
||||
"envVarsSection.variableName": {
|
||||
"defaultMessage": "Variable name"
|
||||
},
|
||||
"environmentBadge.alpha": {
|
||||
"defaultMessage": "Alpha"
|
||||
},
|
||||
"environmentBadge.dev": {
|
||||
"defaultMessage": "Dev"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user