ISSUE-028 - Improved the spacing of Toggle component. Slight reorganization to the OverlayControl component.
This commit is contained in:
1 parent
d575e1c15c
commit
83dec9d782
5 files changed
+21
-21
No files matched your search
@@ -2,7 +2,7 @@ import styled from "styled-components";
|
||||
|
||||
export const SlotWindow = styled.div`
|
||||
position: relative;
|
||||
height: 1.7em;
|
||||
height: 1.5em;
|
||||
width: auto;
|
||||
|
||||
border-radius: 0.6em;
|
||||
@@ -22,6 +22,7 @@ export const SlotText = styled.span`
|
||||
display: block;
|
||||
margin-left: .4em;
|
||||
font-family: ${p => p.theme.fonts.f1Regular};
|
||||
font-size: 0.9em;
|
||||
color: ${p => p.theme.colors.darkGrey};
|
||||
user-select: none;
|
||||
`;
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
ToggleLabel,
|
||||
ToggleBackground,
|
||||
ToggleCircle,
|
||||
ToggleLabelText,
|
||||
} from "./styles";
|
||||
|
||||
export type ToggleProps = {
|
||||
@@ -27,7 +28,7 @@ export const Toggle = ({
|
||||
const [hovered, setHovered] = useState(false);
|
||||
return (
|
||||
<ToggleContainer>
|
||||
{label}{" "}
|
||||
<ToggleLabelText>{label}</ToggleLabelText>
|
||||
<ToggleBody>
|
||||
<ToggleInput
|
||||
type="checkbox"
|
||||
|
||||
@@ -4,7 +4,8 @@ type ToggleContainerProps = {
|
||||
fontSize?: string;
|
||||
}
|
||||
export const ToggleContainer = styled.div<ToggleContainerProps>`
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-size: ${({ fontSize = "inherit" }) => fontSize};
|
||||
`;
|
||||
ToggleContainer.displayName = "ToggleContainer";
|
||||
@@ -13,7 +14,6 @@ export const ToggleBody = styled.div`
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
top: 0.5em;
|
||||
`;
|
||||
ToggleBody.displayName = "ToggleBody";
|
||||
|
||||
@@ -22,6 +22,10 @@ export const ToggleInput = styled.input`
|
||||
`;
|
||||
ToggleInput.displayName = "ToggleInput";
|
||||
|
||||
export const ToggleLabelText = styled.span`
|
||||
margin-right: 1ch;
|
||||
`;
|
||||
|
||||
export const ToggleLabel = styled.label`
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -32,27 +32,23 @@ export function OverlayControl() {
|
||||
};
|
||||
|
||||
return (
|
||||
<Stack gutter="sm">
|
||||
<Inline gutter="sm" stretch="end">
|
||||
<Stack as={PadBox} gutter="md" padding="sm">
|
||||
<Inline gutter="md" stretch="end">
|
||||
<Toggle
|
||||
label="Show Overlay"
|
||||
toggled={visible}
|
||||
onToggle={onToggle}
|
||||
/>
|
||||
<PadBox padding="sm">
|
||||
<SlotSelector
|
||||
items={overlayIds}
|
||||
onChange={(value) => dispatch(setCurrentOverlayId(value))}
|
||||
removePrefix
|
||||
formatter={(value) => value.replace(/(\.png)|(\.jpg)$/, "")}
|
||||
/>
|
||||
</PadBox>
|
||||
<SlotSelector
|
||||
items={overlayIds}
|
||||
onChange={(value) => dispatch(setCurrentOverlayId(value))}
|
||||
removePrefix
|
||||
formatter={(value) => value.replace(/(\.png)|(\.jpg)$/, "")}
|
||||
/>
|
||||
</Inline>
|
||||
<PadBox padding="sm">
|
||||
<MockupBlock color="green" height="1.5rem" width="100%">
|
||||
<MockupBlock color="green" height="1.5rem" width="100%">
|
||||
Opacity Slider
|
||||
</MockupBlock>
|
||||
</PadBox>
|
||||
</MockupBlock>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
@@ -22,9 +22,7 @@ export const WorkspaceControls = () => {
|
||||
dispatch(setAnimatedBG(value));
|
||||
}} />
|
||||
</PadBox>
|
||||
<PadBox padding="sm">
|
||||
<OverlayControl />
|
||||
</PadBox>
|
||||
<OverlayControl />
|
||||
</Grid>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user