Skip to content

Commit 73494c9

Browse files
committed
Merge branch 'frontend-settings-values'
2 parents 2cf0ce2 + 6bc7de0 commit 73494c9

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

frontends/web/src/routes/settings/components/device-settings/root-fingerprint-setting.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
import { useTranslation } from 'react-i18next';
18-
import { SettingsItem } from '../settingsItem/settingsItem';
18+
import { SettingsItem, SettingsValue } from '../settingsItem/settingsItem';
1919

2020
type TProps = {
2121
rootFingerprint: string;
@@ -27,7 +27,9 @@ const RootFingerprintSetting = ({ rootFingerprint }: TProps) => {
2727
<SettingsItem
2828
settingName={'Root fingerprint'}
2929
secondaryText={t('deviceSettings.deviceInformation.rootFingerprint.description')}
30-
displayedValue={rootFingerprint}
30+
displayedValue={
31+
<SettingsValue>{rootFingerprint}</SettingsValue>
32+
}
3133
/>
3234
);
3335
};

frontends/web/src/routes/settings/components/settingsItem/settingsItem.module.css

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.container {
2-
height: var(--item-height-xlarge);
2+
min-height: var(--item-height-xlarge);
33
width: 100%;
44
min-width: 230px;
55
display: flex;
@@ -56,11 +56,15 @@
5656
text-overflow: ellipsis;
5757
}
5858

59+
.nowrap {
60+
white-space: nowrap;
61+
}
62+
5963
@media (max-width: 768px) {
6064
.container {
61-
height: auto;
62-
margin-bottom: 5px;
63-
min-width: 100%;
65+
min-height: auto;
66+
margin-bottom: 5px;
67+
min-width: 100%;
6468
}
6569

6670
.secondaryText {

frontends/web/src/routes/settings/components/settingsItem/settingsItem.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import styles from './settingsItem.module.css';
2020
type TProps = {
2121
className?: string
2222
collapseOnSmall?: boolean;
23-
displayedValue?: string;
23+
displayedValue?: string | ReactNode;
2424
extraComponent?: ReactNode;
2525
hideDisplayedValueOnSmall?: boolean;
2626
onClick?: () => void;
@@ -84,3 +84,18 @@ export const SettingsItem = ({
8484
</>
8585
);
8686
};
87+
88+
type TSettingsValueProps = {
89+
children: ReactNode;
90+
wrap?: boolean;
91+
}
92+
93+
export const SettingsValue = ({
94+
children,
95+
wrap,
96+
}: TSettingsValueProps) => {
97+
const classNames = wrap ? '' : styles.nowrap;
98+
return (
99+
<span className={classNames}>{children}</span>
100+
);
101+
};

0 commit comments

Comments
 (0)