diff --git a/packages/main/plugins/Cardinality/DayPicker.tsx b/packages/main/plugins/Cardinality/DayPicker.tsx index 10b09a07..a0d00483 100644 --- a/packages/main/plugins/Cardinality/DayPicker.tsx +++ b/packages/main/plugins/Cardinality/DayPicker.tsx @@ -18,7 +18,6 @@ export const MenuButton = styled.button` background: ${(props: any) => props.theme.neutral}; border: 1px solid ${(props: any) => props.theme.accentNeutral}; color: ${(props: any) => props.theme.contrast}; - padding: 3px 12px; border-radius: 3px; font-size: 12px; cursor: pointer; diff --git a/packages/main/plugins/Raggix/LogsCounter.tsx b/packages/main/plugins/Raggix/LogsCounter.tsx index 848c6577..a0363d45 100644 --- a/packages/main/plugins/Raggix/LogsCounter.tsx +++ b/packages/main/plugins/Raggix/LogsCounter.tsx @@ -11,7 +11,7 @@ type Props = { loading: boolean; logs: any[]; theme: any; - openLog: Function; + openLog: any; showLabels: (e: any) => void; }; diff --git a/packages/main/qrynui/Buttons/styled.tsx b/packages/main/qrynui/Buttons/styled.tsx index 35bab628..b8c31845 100644 --- a/packages/main/qrynui/Buttons/styled.tsx +++ b/packages/main/qrynui/Buttons/styled.tsx @@ -13,7 +13,7 @@ export const HistoryButtonStyled: any = styled(BtnSmall)` color: ${(props: any) => props.theme.contrast}; background: ${(props: any) => props.theme.neutral}; border: 1px solid ${(props: any) => props.theme.accentNeutral}; - height: 28px; + height: 26px; span { margin-left: 5px; } @@ -30,7 +30,7 @@ export const ShowLabelsBtn: any = styled(BtnSmall)` padding-left: 6px; justify-content: flex-start; color: ${({ theme }: any) => theme.contrast}; - height: 28px; + height: 26px; &:hover { background: ${({ theme }: any) => theme.lightNeutral}; } @@ -48,6 +48,7 @@ export const QueryBarContainer: any = styled.div` margin-left: 0px; flex-wrap: wrap; border-radius: 3px; + margin-right:2px; `; export const ShowLogsBtn: any = styled(BtnSmall, { shouldForwardProp: (prop) => isPropValid(prop) && prop !== "loading", @@ -61,7 +62,7 @@ export const ShowLogsBtn: any = styled(BtnSmall, { justify-content: center; padding: 3px 12px; - height: 28px; + height: 26px; &:hover { background: ${(props: any) => props.theme.primaryLight}; } @@ -85,7 +86,7 @@ export const ShowSettingsBtn: any = styled(BtnSmall)` color: ${(props: any) => props.theme.contrast}; background: ${(props: any) => props.theme.neutral}; border: 1px solid ${(props: any) => props.theme.accentNeutral}; - height: 28px; + height: 26px; span { margin-left: 5px; } diff --git a/packages/main/qrynui/CustomSwitch/CustomSwitch.tsx b/packages/main/qrynui/CustomSwitch/CustomSwitch.tsx new file mode 100644 index 00000000..e9094313 --- /dev/null +++ b/packages/main/qrynui/CustomSwitch/CustomSwitch.tsx @@ -0,0 +1,95 @@ +import { css, cx } from "@emotion/css"; +import useTheme from "@ui/theme/useTheme"; +import { useState } from "react"; + +const CustomSwitchStyles = (theme: any) => { + return css` + .switch { + position: relative; + display: inline-block; + margin-right: 8px; + margin-left: 8px; + width: 28px; + height: 12px; + border-radius: 4px; + display: flex; + align-items: center; + } + .switch input { + opacity: 0; + width: 0; + height: 0; + } + .slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + height: 12px; + width: 28px; + display: flex; + aligin-items: center; + background-color: ${theme.shadow}; + border: 1px solid ${theme.neutral}; + -webkit-transition: 0.25s; + transition: 0.25s; + border-radius: 6px; + &.active { + background-color: ${theme.primaryAccent}; + border: 1px solid ${theme.primary}; + &:before { + background-color: ${theme.primaryLight}; + border-left: 4px solid ${theme.primary}; + left: 12px; + border-right: 0px; + } + } + } + .slider:before { + position: absolute; + content: ""; + height: 12px; + width: 12px; + left: 0px; + bottom: 0; + background-color: ${theme.contrastNeutral}; + -webkit-transition: 0.25s; + transition: 0.25s; + border-radius: 6px; + border-right: 4px solid ${theme.accentNeutral}; + } + `; +}; + +type CustomSwitchProps = { + defaultActive?: boolean; + onChange?: (e: any) => void; +}; + +const CustomSwitch = ({ defaultActive, onChange }: CustomSwitchProps) => { + const theme = useTheme(); + const classes = CustomSwitchStyles(theme); + const [active, setActive] = useState(defaultActive ?? false); + const onSwitchChange = (e: any) => { + if (onChange) onChange(e); + setActive((active) => !active); + }; + return ( +
{import.meta.env.VITE_APP_VERSION}
diff --git a/packages/main/views/ScreenLoader.tsx b/packages/main/views/ScreenLoader.tsx index a020d646..dba69fa8 100644 --- a/packages/main/views/ScreenLoader.tsx +++ b/packages/main/views/ScreenLoader.tsx @@ -1,6 +1,7 @@ -import useTheme from "@ui/theme/useTheme" +import useTheme from "@ui/theme/useTheme"; import { cx } from "@emotion/css"; import { QrynLogo } from "./DataSources/ui"; + import { LoaderCont, LogoCont, diff --git a/packages/main/views/User/UserRoles.tsx b/packages/main/views/User/UserRoles.tsx index 476b1249..fa68f483 100644 --- a/packages/main/views/User/UserRoles.tsx +++ b/packages/main/views/User/UserRoles.tsx @@ -2,7 +2,7 @@ import { useMemo, useState } from "react"; import { cx, css } from "@emotion/css"; import useTheme from "@ui/theme/useTheme"; import { nanoid } from "nanoid"; -import Avatar from '@mui/material/Avatar'; +import Avatar from "@mui/material/Avatar"; import CookieIcon from "@mui/icons-material/Cookie"; import { useCookies } from "react-cookie"; import { Switch } from "@mui/material"; @@ -140,7 +140,7 @@ const UserRolesStyles = (theme: any) => css` border-radius: 3px; background: ${theme.deep}; color: ${theme.contrast}; - height: 28px; + height: 26px; font-size: 12px; } @@ -197,9 +197,9 @@ const UserSelected = (theme: any, selected: boolean) => css` } `; -const QrynAvatar = ({name}:{name:string}) => ( -