Skip to content

Commit

Permalink
chore: use correct colors for self-learning quiz wrapper (#2044)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriele-ct authored Jul 29, 2024
1 parent f9a0f73 commit 711806e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .changeset/lazy-rice-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@commercetools-docs/gatsby-theme-docs': patch
'@commercetools-docs/ui-kit': patch
---

Use correct colors for self learning quiz fail and default state
2 changes: 1 addition & 1 deletion cypress/e2e/self-learning-smoke-test/e2e.const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ export const EDITOR_TEST_USER_PASSWORD = 'Qwerty123!';

// FEEDBACK
export const WRONG_ANSWER_COLOR = 'rgb(218, 85, 78)';
export const CORRECT_ANSWER_COLOR = 'rgb(8, 94, 58)';
export const CORRECT_ANSWER_COLOR = 'rgb(23, 176, 105)';
export const WRONG_ANSWER_TEXT = 'Your answer is incorrect.';
export const CORRECT_ANSWER_TEXT = 'Your answer is correct.';
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { useState, useEffect, useCallback, useContext } from 'react';
import styled from '@emotion/styled';
import {
customProperties,
designTokens,
} from '@commercetools-uikit/design-system';
import { customProperties } from '@commercetools-uikit/design-system';
import { designSystem } from '@commercetools-docs/ui-kit';

import LoadingSpinner from '@commercetools-uikit/loading-spinner';
import { ContentNotification } from '@commercetools-uikit/notifications';
import LoginButton from '../../sso/components/login-button';
Expand Down Expand Up @@ -32,11 +31,11 @@ const QuizWrapper = styled.div<QuizOutcome>`
border-left-color: ${({ outcome }) => {
switch (outcome) {
case OUTCOME_CORRECT:
return designTokens.colorSuccess25;
return designSystem.colors.light.selfLearningQuizSuccess;
case OUTCOME_INCORRECT:
return designTokens.colorError;
return designSystem.colors.light.selfLearningQuizError;
default:
return customProperties.colorInfo;
return designSystem.colors.light.selfLearningQuizDefault;
}
}};
`;
Expand Down
6 changes: 6 additions & 0 deletions packages/ui-kit/src/design-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export type ThemeColorTokens = {
// Surfaces are used for backgrounds
selfLearningLoginButton: string;
selfLearningLoginButtonHover: string;
selfLearningQuizSuccess: string;
selfLearningQuizError: string;
selfLearningQuizDefault: string;
surfacePrimary: string;
surfaceSecondary1: string;
surfaceSecondary2: string;
Expand Down Expand Up @@ -110,6 +113,9 @@ export const colors: ThemeColors = {
// Surfaces are used for backgrounds
selfLearningLoginButton: designTokens.colorPrimary,
selfLearningLoginButtonHover: designTokens.colorPrimary40,
selfLearningQuizDefault: designTokens.colorPrimary,
selfLearningQuizError: designTokens.colorError,
selfLearningQuizSuccess: designTokens.colorSuccess,
surfacePrimary: designTokens.colorSurface,
surfaceSecondary1: designTokens.colorNeutral95,
surfaceSecondary2: designTokens.colorNeutral90,
Expand Down

0 comments on commit 711806e

Please sign in to comment.