mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-23 17:47:24 +00:00
Styles for new Settings Page
This commit is contained in:
parent
9d663b3789
commit
4cac3b286d
3 changed files with 95 additions and 0 deletions
2
ui/component/settingsRow/index.js
Normal file
2
ui/component/settingsRow/index.js
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import SettingsRow from './view';
|
||||||
|
export default SettingsRow;
|
35
ui/component/settingsRow/view.jsx
Normal file
35
ui/component/settingsRow/view.jsx
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
// @flow
|
||||||
|
import React from 'react';
|
||||||
|
import classnames from 'classnames';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
title: string,
|
||||||
|
subtitle?: string,
|
||||||
|
multirow?: boolean, // Displays the Value widget(s) below the Label instead of on the right.
|
||||||
|
useVerticalSeparator?: boolean, // Show a separator line between Label and Value. Useful when there are multiple Values.
|
||||||
|
children?: React$Node,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function SettingsRow(props: Props) {
|
||||||
|
const { title, subtitle, multirow, useVerticalSeparator, children } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={classnames('card__main-actions settings__row', {
|
||||||
|
'section__actions--between': !multirow,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<div className="settings__row--title">
|
||||||
|
<p>{title}</p>
|
||||||
|
{subtitle && <p className="settings__row--subtitle">{subtitle}</p>}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className={classnames('settings__row--value', {
|
||||||
|
'settings__row--value--vertical-separator': useVerticalSeparator,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
{children && children}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
|
@ -203,3 +203,61 @@
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.settings__row {
|
||||||
|
&:first-child,
|
||||||
|
&:only-child {
|
||||||
|
border-top: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings__row--title {
|
||||||
|
min-width: 100%;
|
||||||
|
align-self: flex-start;
|
||||||
|
|
||||||
|
@media (min-width: $breakpoint-small) {
|
||||||
|
min-width: 60%;
|
||||||
|
max-width: 60%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings__row--subtitle {
|
||||||
|
@extend .section__subtitle;
|
||||||
|
font-size: var(--font-small);
|
||||||
|
margin-top: calc(var(--spacing-xxs) / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings__row--value {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
fieldset-section:not(:only-child) {
|
||||||
|
margin-top: var(--spacing-s);
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset-section.radio {
|
||||||
|
margin-top: var(--spacing-s);
|
||||||
|
}
|
||||||
|
|
||||||
|
fieldset-group {
|
||||||
|
margin-top: var(--spacing-m);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: $breakpoint-small) {
|
||||||
|
width: 40%;
|
||||||
|
margin-left: var(--spacing-m);
|
||||||
|
padding-left: var(--spacing-m);
|
||||||
|
|
||||||
|
.button,
|
||||||
|
.checkbox {
|
||||||
|
&:only-child {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings__row--value--vertical-separator {
|
||||||
|
@media (min-width: $breakpoint-small) {
|
||||||
|
border-left: 1px solid var(--color-border);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue