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