Skip to content

Commit

Permalink
Merge branch 'frontend-settings-values'
Browse files Browse the repository at this point in the history
  • Loading branch information
thisconnect committed Mar 19, 2024
2 parents 2cf0ce2 + 6bc7de0 commit 73494c9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

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

type TProps = {
rootFingerprint: string;
Expand All @@ -27,7 +27,9 @@ const RootFingerprintSetting = ({ rootFingerprint }: TProps) => {
<SettingsItem
settingName={'Root fingerprint'}
secondaryText={t('deviceSettings.deviceInformation.rootFingerprint.description')}
displayedValue={rootFingerprint}
displayedValue={
<SettingsValue>{rootFingerprint}</SettingsValue>
}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.container {
height: var(--item-height-xlarge);
min-height: var(--item-height-xlarge);
width: 100%;
min-width: 230px;
display: flex;
Expand Down Expand Up @@ -56,11 +56,15 @@
text-overflow: ellipsis;
}

.nowrap {
white-space: nowrap;
}

@media (max-width: 768px) {
.container {
height: auto;
margin-bottom: 5px;
min-width: 100%;
min-height: auto;
margin-bottom: 5px;
min-width: 100%;
}

.secondaryText {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import styles from './settingsItem.module.css';
type TProps = {
className?: string
collapseOnSmall?: boolean;
displayedValue?: string;
displayedValue?: string | ReactNode;
extraComponent?: ReactNode;
hideDisplayedValueOnSmall?: boolean;
onClick?: () => void;
Expand Down Expand Up @@ -84,3 +84,18 @@ export const SettingsItem = ({
</>
);
};

type TSettingsValueProps = {
children: ReactNode;
wrap?: boolean;
}

export const SettingsValue = ({
children,
wrap,
}: TSettingsValueProps) => {
const classNames = wrap ? '' : styles.nowrap;
return (
<span className={classNames}>{children}</span>
);
};

0 comments on commit 73494c9

Please sign in to comment.