Skip to content

Commit

Permalink
refactor: refactor to show origin resolved value
Browse files Browse the repository at this point in the history
  • Loading branch information
robinhoodie0823 committed Oct 13, 2023
1 parent 9243b85 commit c539919
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/app/components/TokenTooltip/TokenTooltipContentValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ export const TokenTooltipContentValue: React.FC<Props> = ({ token }) => {
tokensContext.resolvedTokens,
]);

console.log('token in token tool tip: ', token);
console.log('resolvedValue: ', resolvedValue);

if (isSingleTypographyToken(token)) {
return (
<SingleTypographyValueDisplay
Expand Down
1 change: 1 addition & 0 deletions src/app/components/Tokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function Tokens({ isActive }: { isActive: boolean }) {
})),
[tokens, usedTokenSet, activeTokenSet],
);

const tokenType = useSelector(tokenTypeSelector);

const [error, setError] = React.useState<string | null>(null);
Expand Down
1 change: 1 addition & 0 deletions src/app/store/models/tokenState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ export const tokenState = createModel<RootModel>()({
],
};
}

return {
...state,
tokens: {
Expand Down
3 changes: 2 additions & 1 deletion src/utils/TokenResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit c539919

Please sign in to comment.