SelectTableField mobile changes

This commit is contained in:
Justin Edmund 2023-02-03 14:39:11 -08:00
parent 85d5ba075b
commit bba5da187f
2 changed files with 58 additions and 9 deletions

View file

@ -1,17 +1,47 @@
.TableField { .TableField {
align-items: center; align-items: center;
display: grid; display: grid;
gap: $unit * 2; gap: $unit-2x;
grid-template-columns: 1fr auto; grid-template-columns: 1fr auto;
&.Image { @include breakpoint(phone) {
grid-template-columns: 1fr auto 1fr; align-items: flex-start;
display: flex;
flex-direction: column;
} }
.Left { .Left {
display: flex; display: flex;
flex-direction: column; flex-direction: row;
gap: calc($unit / 2); gap: $unit;
width: 100%;
.Info {
display: flex;
flex-direction: column;
flex-grow: 1;
justify-content: center;
gap: $unit-half;
}
.Image {
display: none;
.preview {
$diameter: $unit-5x;
width: $diameter;
height: $diameter;
img {
width: $diameter;
height: $diameter;
}
}
@include breakpoint(phone) {
display: block;
}
}
label { label {
color: var(--text-tertiary); color: var(--text-tertiary);
@ -30,6 +60,23 @@
} }
} }
.Right {
display: flex;
flex-direction: row;
gap: $unit-2x;
width: 100%;
@include breakpoint(phone) {
.Image {
display: none;
}
}
.SelectTrigger {
width: 100%;
}
}
.preview { .preview {
$diameter: $unit * 6; $diameter: $unit * 6;
background-color: $grey-90; background-color: $grey-90;

View file

@ -44,13 +44,15 @@ const SelectTableField = (props: Props) => {
return ( return (
<div className={classNames({ TableField: true }, props.className)}> <div className={classNames({ TableField: true }, props.className)}>
<div className="Left"> <div className="Left">
<h3>{props.label}</h3> <div className="Info">
<p>{props.description}</p> <h3>{props.label}</h3>
<p>{props.description}</p>
</div>
<div className="Image">{image()}</div>
</div> </div>
{image()}
<div className="Right"> <div className="Right">
<div className="Image">{image()}</div>
<Select <Select
name={props.name} name={props.name}
open={props.open} open={props.open}