summaryrefslogtreecommitdiffhomepage
path: root/gui/src
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2023-12-15 11:53:00 +0100
committerOskar Nyberg <oskar@mullvad.net>2024-01-29 09:33:49 +0100
commit7a16c4b1fd1b210699dbeb8d72c64ebda9e55251 (patch)
tree880f19d2b2c048564ca539ba58103415903759b8 /gui/src
parent5cb2625d8c56e9803d3a0b5df6f2d8a621039fc4 (diff)
downloadmullvadvpn-7a16c4b1fd1b210699dbeb8d72c64ebda9e55251.tar.xz
mullvadvpn-7a16c4b1fd1b210699dbeb8d72c64ebda9e55251.zip
Add support for sublabels in cells
Diffstat (limited to 'gui/src')
-rw-r--r--gui/src/renderer/components/cell/Label.tsx27
1 files changed, 27 insertions, 0 deletions
diff --git a/gui/src/renderer/components/cell/Label.tsx b/gui/src/renderer/components/cell/Label.tsx
index 3a64908315..b72f698255 100644
--- a/gui/src/renderer/components/cell/Label.tsx
+++ b/gui/src/renderer/components/cell/Label.tsx
@@ -12,6 +12,13 @@ const StyledLabel = styled.div<{ disabled: boolean }>(buttonText, (props) => ({
flex: 1,
color: props.disabled ? colors.white40 : colors.white,
textAlign: 'left',
+
+ [`${LabelContainer} &&`]: {
+ marginTop: '5px',
+ marginBottom: 0,
+ height: '20px',
+ lineHeight: '20px',
+ },
}));
const StyledSubText = styled.span<{ disabled: boolean }>(tinyText, (props) => ({
@@ -38,6 +45,21 @@ const StyledTintedIcon = styled(ImageView).attrs((props: IImageViewProps) => ({
},
}));
+const StyledSubLabel = styled.div<{ disabled: boolean }>(tinyText, {
+ display: 'flex',
+ alignItems: 'center',
+ color: colors.white60,
+ marginBottom: '5px',
+ lineHeight: '14px',
+ height: '14px',
+});
+
+export const LabelContainer = styled.div({
+ display: 'flex',
+ flexDirection: 'column',
+ flex: 1,
+});
+
export function Label(props: React.HTMLAttributes<HTMLDivElement>) {
const disabled = useContext(CellDisabledContext);
return <StyledLabel disabled={disabled} {...props} />;
@@ -74,3 +96,8 @@ export function Icon(props: IImageViewProps) {
</StyledIconContainer>
);
}
+
+export function SubLabel(props: React.HTMLAttributes<HTMLDivElement>) {
+ const disabled = useContext(CellDisabledContext);
+ return <StyledSubLabel disabled={disabled} {...props} />;
+}