Skip to content

Commit 4714932

Browse files
Theme export format
1 parent 86bc4b4 commit 4714932

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

src/common/hooks/use-app-theme.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { useCallback, useEffect, useState } from 'react'
22
import { useDispatch, useSelector } from 'react-redux'
33
import { AnyAction } from 'redux'
44
import get from 'lodash/get'
5-
import isEmpty from 'lodash/isEmpty'
65

76
export type UseAppThemeType = {
87
getTheme: (url: string) => any
@@ -32,7 +31,8 @@ export function useAppTheme(options: UseAppThemeType) {
3231
themes[Object.keys(t)[0]] = t
3332
})
3433

35-
if (appStore.configuration?.theme === '' || appStore.configuration?.theme !== themeData.defaultTheme) {
34+
// if (appStore.configuration?.theme === '' || appStore.configuration?.theme !== themeData.defaultTheme) {
35+
if (appStore.configuration?.theme === '') {
3636
dispatch(setTheme(themeData.defaultTheme))
3737
}
3838

@@ -51,10 +51,6 @@ export function useAppTheme(options: UseAppThemeType) {
5151

5252
const getThemeData = useCallback(
5353
(currentTheme: string) => {
54-
// if (!isEmpty(appStore.configuration.previewTheme)) {
55-
// return appStore.configuration.previewTheme
56-
// }
57-
5854
if (appTheme) {
5955
const index = appTheme.findIndex((i: any) => Object.keys(i)[0] === currentTheme)
6056
if (index >= 0) {
@@ -64,7 +60,7 @@ export function useAppTheme(options: UseAppThemeType) {
6460

6561
return {}
6662
},
67-
[appStore.configuration.previewTheme, appTheme]
63+
[appTheme]
6864
)
6965

7066
return [appTheme, themeError, getThemeData]

src/components/Atomic/Switch/Switch.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React, { FC } from 'react'
1+
import React, { forwardRef } from 'react'
22
import { Props, defaultProps } from './Switch.types'
33
import * as styles from './Switch.styles'
44

5-
const Switch: FC<Props> = (props) => {
5+
const Switch = forwardRef<HTMLInputElement, Props>((props, ref) => {
66
const { id, label, labelBefore, size, defaultChecked, className, disabled, loading, ...rest } = { ...defaultProps, ...props }
77
const Slider = styles.slider as any
88

@@ -14,14 +14,15 @@ const Switch: FC<Props> = (props) => {
1414
css={(theme) => [styles.input(theme, size || 'big', disabled || false), loading && styles.loading]}
1515
defaultChecked={defaultChecked}
1616
disabled={disabled || loading}
17+
ref={ref}
1718
type='checkbox'
1819
/>
1920
<Slider css={[(styles.sliderStyle(size || 'big'), disabled && styles.disabled)]} size={size} />
2021
</div>
2122
{label && <div css={[styles.label, labelBefore && styles.labelBeforeSwitch]}>{label}</div>}
2223
</label>
2324
)
24-
}
25+
})
2526

2627
Switch.displayName = 'Switch'
2728
Switch.defaultProps = defaultProps

src/components/Atomic/_utils/colors.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,27 @@ export const uiColorMap = {
5050
disabled: '#D7D8DA', // TODO
5151
},
5252
siemens: {
53+
primaryDarken: '#00adb4',
5354
primary: '#00adb4',
55+
primaryHover: '#00adb4',
5456
primaryBonus: '#00BEDC',
57+
primaryBright: '#00adb4',
5558
yellow: '#ffd732',
5659
red: '#ef0137',
5760
green: '#00d7a0',
5861
info: '#5FBDEB',
5962
neutral900: '#000028',
6063
neutral800: '#23233c',
6164
neutral700: '#353640',
65+
neutral600: '#000028',
6266
neutral500: '#81868D',
67+
neutral400: '#000028',
68+
neutral300: '#000028',
69+
neutral200: '#000028',
70+
neutral100: '#000028',
6371
neutral000: '#FFFFFF',
72+
secondary: '#D7D8DA',
73+
tertiary: '#D7D8DA',
6474
disabled: '#D7D8DA',
6575
},
6676
}

0 commit comments

Comments
 (0)