diff --git a/app/components/Button.tsx b/app/components/Button.tsx index ff7caea04..6e68961f1 100644 --- a/app/components/Button.tsx +++ b/app/components/Button.tsx @@ -31,7 +31,7 @@ const RealButton = styled.button<{ !props.borderOnHover && ` svg { - fill: ${props.iconColor || props.theme.buttonText}; + fill: ${props.iconColor || "currentColor"}; } `} @@ -69,7 +69,7 @@ const RealButton = styled.button<{ props.borderOnHover ? "" : `svg { - fill: ${props.iconColor || props.theme.buttonNeutralText}; + fill: ${props.iconColor || "currentColor"}; }` } @@ -89,7 +89,7 @@ const RealButton = styled.button<{ color: ${props.theme.textTertiary}; svg { - fill: ${props.theme.textTertiary}; + fill: currentColor; } } `} @@ -162,7 +162,7 @@ const Button = ( {hasIcon && icon} {hasText && } - {disclosure && } + {disclosure && } ); diff --git a/app/components/GroupListItem.tsx b/app/components/GroupListItem.tsx index 259f44e06..eb7b3e2e7 100644 --- a/app/components/GroupListItem.tsx +++ b/app/components/GroupListItem.tsx @@ -61,7 +61,7 @@ class GroupListItem extends React.Component { } actions={ - + {showFacepile && ( { overflow={overflow} /> )} -   {renderActions({ openMembersModal: this.handleMembersModalOpen, })} diff --git a/app/components/HelpText.ts b/app/components/HelpText.ts index 375a17c7d..b2a15ddf9 100644 --- a/app/components/HelpText.ts +++ b/app/components/HelpText.ts @@ -3,7 +3,7 @@ import styled from "styled-components"; const HelpText = styled.p<{ small?: boolean }>` margin-top: 0; color: ${(props) => props.theme.textSecondary}; - font-size: ${(props) => (props.small ? "13px" : "inherit")}; + font-size: ${(props) => (props.small ? "14px" : "inherit")}; `; export default HelpText; diff --git a/app/components/Input.tsx b/app/components/Input.tsx index 073361806..e8135f6cd 100644 --- a/app/components/Input.tsx +++ b/app/components/Input.tsx @@ -88,6 +88,7 @@ export const Outline = styled(Flex)<{ font-weight: normal; align-items: center; overflow: hidden; + background: ${(props) => props.theme.background}; `; export const LabelText = styled.div` diff --git a/app/components/Switch.tsx b/app/components/Switch.tsx index dce8e14d6..bd2e0d84b 100644 --- a/app/components/Switch.tsx +++ b/app/components/Switch.tsx @@ -1,20 +1,35 @@ import * as React from "react"; import styled from "styled-components"; +import HelpText from "~/components/HelpText"; import { LabelText } from "~/components/Input"; -type Props = { +type Props = React.HTMLAttributes & { width?: number; height?: number; label?: string; + name?: string; + note?: React.ReactNode; checked?: boolean; disabled?: boolean; onChange: (event: React.ChangeEvent) => unknown; id?: string; }; -function Switch({ width = 38, height = 20, label, disabled, ...props }: Props) { +function Switch({ + width = 32, + height = 18, + label, + disabled, + className, + note, + ...props +}: Props) { const component = ( - + - + ); if (label) { return ( - + + + {note && {note}} + ); } return component; } +const Wrapper = styled.div` + padding-bottom: 8px; +`; + +const InlineLabelText = styled(LabelText)` + padding-bottom: 0; +`; + const Label = styled.label<{ disabled?: boolean }>` display: flex; align-items: center; ${(props) => (props.disabled ? `opacity: 0.75;` : "")} `; -const Wrapper = styled.label<{ width: number; height: number }>` +const Input = styled.label<{ width: number; height: number }>` position: relative; display: inline-block; width: ${(props) => props.width}px; height: ${(props) => props.height}px; - margin-bottom: 4px; margin-right: 8px; + flex-shrink: 0; `; const Slider = styled.span<{ width: number; height: number }>` diff --git a/app/components/Toggle.tsx b/app/components/Toggle.tsx deleted file mode 100644 index ef1375771..000000000 --- a/app/components/Toggle.tsx +++ /dev/null @@ -1,104 +0,0 @@ -import * as React from "react"; -import { VisuallyHidden } from "reakit/VisuallyHidden"; -import styled from "styled-components"; -import HelpText from "~/components/HelpText"; - -export type Props = { - checked?: boolean; - label?: React.ReactNode; - labelHidden?: boolean; - className?: string; - name?: string; - disabled?: boolean; - onChange: (event: React.ChangeEvent) => unknown; - note?: React.ReactNode; -}; - -const LabelText = styled.span` - font-weight: 500; - margin-left: 10px; -`; - -const Wrapper = styled.div` - padding-bottom: 8px; - width: 100%; -`; - -const Label = styled.label` - display: flex; - align-items: center; - user-select: none; -`; - -const SlideToggle = styled.label` - cursor: pointer; - text-indent: -9999px; - width: 26px; - height: 14px; - background: ${(props) => props.theme.slate}; - display: block; - border-radius: 10px; - position: relative; - - &:after { - content: ""; - position: absolute; - top: 2px; - left: 2px; - width: 10px; - height: 10px; - background: ${(props) => props.theme.white}; - border-radius: 5px; - transition: width 100ms ease-in-out; - } - - &:active:after { - width: 12px; - } -`; - -const HiddenInput = styled.input` - height: 0; - width: 0; - visibility: hidden; - - &:checked + ${SlideToggle} { - background: ${(props) => props.theme.primary}; - } - - &:checked + ${SlideToggle}:after { - left: calc(100% - 2px); - transform: translateX(-100%); - } -`; - -let inputId = 0; - -export default function Toggle({ - label, - labelHidden, - note, - className, - ...rest -}: Props) { - const wrappedLabel = {label}; - const [id] = React.useState(`checkbox-input-${inputId++}`); - - return ( - <> - - - {note && {note}} - - - ); -} diff --git a/app/menus/DocumentMenu.tsx b/app/menus/DocumentMenu.tsx index 2f94a9838..a648e20bf 100644 --- a/app/menus/DocumentMenu.tsx +++ b/app/menus/DocumentMenu.tsx @@ -38,7 +38,7 @@ import Separator from "~/components/ContextMenu/Separator"; import Template from "~/components/ContextMenu/Template"; import Flex from "~/components/Flex"; import Modal from "~/components/Modal"; -import Toggle from "~/components/Toggle"; +import Switch from "~/components/Switch"; import { actionToMenuItem } from "~/actions"; import { pinDocument, @@ -453,10 +453,12 @@ function DocumentMenu({