diff --git a/documentation/compose/ui-acl-with-zk.yaml b/documentation/compose/ui-acl-with-zk.yaml index 2f7928f92..97aad1791 100644 --- a/documentation/compose/ui-acl-with-zk.yaml +++ b/documentation/compose/ui-acl-with-zk.yaml @@ -18,7 +18,7 @@ services: KAFKA_CLUSTERS_0_PROPERTIES_SASL_JAAS_CONFIG: 'org.apache.kafka.common.security.plain.PlainLoginModule required username="admin" password="admin-secret";' zookeeper: - image: wurstmeister/zookeeper:3.4.6 + image: zookeeper:3.8 environment: JVMFLAGS: "-Djava.security.auth.login.config=/etc/zookeeper/zookeeper_jaas.conf" volumes: diff --git a/frontend/src/components/common/Switch/Switch.styled.ts b/frontend/src/components/common/Switch/Switch.styled.ts index 0f4f2c1d1..780506569 100644 --- a/frontend/src/components/common/Switch/Switch.styled.ts +++ b/frontend/src/components/common/Switch/Switch.styled.ts @@ -1,13 +1,13 @@ import styled from 'styled-components'; interface Props { - isCheckedIcon?: boolean; + checked?: boolean; } -export const StyledLabel = styled.label` +export const StyledLabel = styled.label` position: relative; display: inline-block; - width: ${({ isCheckedIcon }) => (isCheckedIcon ? '40px' : '34px')}; + width: 34px; height: 20px; margin-right: 8px; `; @@ -32,14 +32,12 @@ export const StyledSlider = styled.span` left: 0; right: 0; bottom: 0; - background-color: ${({ isCheckedIcon, theme }) => - isCheckedIcon - ? theme.switch.checkedIcon.backgroundColor - : theme.switch.unchecked}; + background-color: ${({ checked, theme }) => + checked ? theme.switch.checked : theme.switch.unchecked}; transition: 0.4s; border-radius: 20px; - :hover { + &:hover { background-color: ${({ theme }) => theme.switch.hover}; } @@ -48,7 +46,7 @@ export const StyledSlider = styled.span` content: ''; height: 14px; width: 14px; - left: 3px; + left: ${({ checked }) => (checked ? '17px' : '3px')}; bottom: 3px; background-color: ${({ theme }) => theme.switch.circle}; transition: 0.4s; @@ -57,25 +55,8 @@ export const StyledSlider = styled.span` } `; -export const StyledInput = styled.input` +export const StyledInput = styled.input` opacity: 0; width: 0; height: 0; - - &:checked + ${StyledSlider} { - background-color: ${({ isCheckedIcon, theme }) => - isCheckedIcon - ? theme.switch.checkedIcon.backgroundColor - : theme.switch.checked}; - } - - &:focus + ${StyledSlider} { - box-shadow: 0 0 1px ${({ theme }) => theme.switch.checked}; - } - - :checked + ${StyledSlider}:before { - transform: translateX( - ${({ isCheckedIcon }) => (isCheckedIcon ? '20px' : '14px')} - ); - } `; diff --git a/frontend/src/components/common/Switch/Switch.tsx b/frontend/src/components/common/Switch/Switch.tsx index e1cb56d7a..3c6598c27 100644 --- a/frontend/src/components/common/Switch/Switch.tsx +++ b/frontend/src/components/common/Switch/Switch.tsx @@ -6,30 +6,17 @@ export interface SwitchProps { onChange(): void; checked: boolean; name: string; - checkedIcon?: React.ReactNode; - unCheckedIcon?: React.ReactNode; - bgCustomColor?: string; } -const Switch: React.FC = ({ - name, - checked, - onChange, - checkedIcon, - unCheckedIcon, -}) => { - const isCheckedIcon = !!(checkedIcon || unCheckedIcon); +const Switch: React.FC = ({ name, checked, onChange }) => { return ( - + - - {checkedIcon && {checkedIcon}} - {unCheckedIcon && {unCheckedIcon}} + ); };