From c5399194de6d892f3ed1204a1cc34236087d8dd6 Mon Sep 17 00:00:00 2001 From: hiroshi Date: Fri, 13 Oct 2023 08:03:31 -0400 Subject: [PATCH] refactor: refactor to show origin resolved value --- src/app/components/TokenTooltip/TokenTooltipContentValue.tsx | 3 --- src/app/components/Tokens.tsx | 1 + src/app/store/models/tokenState.tsx | 1 + src/utils/TokenResolver.ts | 3 ++- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/components/TokenTooltip/TokenTooltipContentValue.tsx b/src/app/components/TokenTooltip/TokenTooltipContentValue.tsx index 33903dbf3..d6e0e21c9 100644 --- a/src/app/components/TokenTooltip/TokenTooltipContentValue.tsx +++ b/src/app/components/TokenTooltip/TokenTooltipContentValue.tsx @@ -33,9 +33,6 @@ export const TokenTooltipContentValue: React.FC = ({ token }) => { tokensContext.resolvedTokens, ]); - console.log('token in token tool tip: ', token); - console.log('resolvedValue: ', resolvedValue); - if (isSingleTypographyToken(token)) { return ( (null); diff --git a/src/app/store/models/tokenState.tsx b/src/app/store/models/tokenState.tsx index f351baf12..57919699d 100644 --- a/src/app/store/models/tokenState.tsx +++ b/src/app/store/models/tokenState.tsx @@ -216,6 +216,7 @@ export const tokenState = createModel()({ ], }; } + return { ...state, tokens: { diff --git a/src/utils/TokenResolver.ts b/src/utils/TokenResolver.ts index 033764316..1fcfdef0d 100644 --- a/src/utils/TokenResolver.ts +++ b/src/utils/TokenResolver.ts @@ -8,6 +8,7 @@ import { ColorModifierTypes } from '@/constants/ColorModifierTypes'; import { convertModifiedColorToHex } from './convertModifiedColorToHex'; import { getPathName } from './getPathName'; import { ResolveTokenValuesResult } from './tokenHelpers'; +import { TokenTypes } from '@/constants/TokenTypes'; class TokenResolver { private tokens: SingleToken[]; @@ -45,7 +46,7 @@ class TokenResolver { const resolvedTokens: ResolveTokenValuesResult[] = []; for (const token of this.tokens) { - const resolvedValue = this.resolveReferences(token); + const resolvedValue = token.type === TokenTypes.TEXT ? token : this.resolveReferences(token); resolvedTokens.push({ ...resolvedValue,