[Bug Fix] Fix scene markers editor mobile UI (#1718)

* Fix mobile layout
This commit is contained in:
liquid-flow
2021-09-14 17:07:53 +07:00
committed by GitHub
parent b78060d361
commit 612ecb72fc
5 changed files with 57 additions and 37 deletions

View File

@@ -10,3 +10,6 @@
### 🎨 Improvements ### 🎨 Improvements
* Added sv-SE language option. ([#1691](https://github.com/stashapp/stash/pull/1691)) * Added sv-SE language option. ([#1691](https://github.com/stashapp/stash/pull/1691))
### 🐛 Bug fixes
* Fix Create Marker form on small devices. ([#1718](https://github.com/stashapp/stash/pull/1718))

View File

@@ -68,30 +68,26 @@ export const SceneMarkerForm: React.FC<ISceneMarkerForm> = ({
.catch((err) => Toast.error(err)); .catch((err) => Toast.error(err));
}; };
const renderTitleField = (fieldProps: FieldProps<string>) => ( const renderTitleField = (fieldProps: FieldProps<string>) => (
<div className="col-10 col-xl-12"> <MarkerTitleSuggest
<MarkerTitleSuggest initialMarkerTitle={fieldProps.field.value}
initialMarkerTitle={fieldProps.field.value} onChange={(query: string) =>
onChange={(query: string) => fieldProps.form.setFieldValue("title", query)
fieldProps.form.setFieldValue("title", query) }
} />
/>
</div>
); );
const renderSecondsField = (fieldProps: FieldProps<string>) => ( const renderSecondsField = (fieldProps: FieldProps<string>) => (
<div className="col-3 col-xl-12"> <DurationInput
<DurationInput onValueChange={(s) => fieldProps.form.setFieldValue("seconds", s)}
onValueChange={(s) => fieldProps.form.setFieldValue("seconds", s)} onReset={() =>
onReset={() => fieldProps.form.setFieldValue(
fieldProps.form.setFieldValue( "seconds",
"seconds", Math.round(JWUtils.getPlayer()?.getPosition() ?? 0)
Math.round(JWUtils.getPlayer()?.getPosition() ?? 0) )
) }
} numericValue={Number.parseInt(fieldProps.field.value ?? "0", 10)}
numericValue={Number.parseInt(fieldProps.field.value ?? "0", 10)} mandatory
mandatory />
/>
</div>
); );
const renderPrimaryTagField = (fieldProps: FieldProps<string>) => ( const renderPrimaryTagField = (fieldProps: FieldProps<string>) => (
@@ -100,7 +96,7 @@ export const SceneMarkerForm: React.FC<ISceneMarkerForm> = ({
fieldProps.form.setFieldValue("primaryTagId", tags[0]?.id) fieldProps.form.setFieldValue("primaryTagId", tags[0]?.id)
} }
ids={fieldProps.field.value ? [fieldProps.field.value] : []} ids={fieldProps.field.value ? [fieldProps.field.value] : []}
noSelectionString="Select or create tag..." noSelectionString="Select/create tag..."
/> />
); );
@@ -114,7 +110,7 @@ export const SceneMarkerForm: React.FC<ISceneMarkerForm> = ({
) )
} }
ids={fieldProps.field.value} ids={fieldProps.field.value}
noSelectionString="Select or create tags..." noSelectionString="Select/create tags..."
/> />
); );
@@ -133,28 +129,48 @@ export const SceneMarkerForm: React.FC<ISceneMarkerForm> = ({
<FormikForm> <FormikForm>
<div> <div>
<Form.Group className="row"> <Form.Group className="row">
<Form.Label htmlFor="title" className="col-2 col-xl-12"> <Form.Label
Scene Marker Title htmlFor="title"
className="col-sm-3 col-md-2 col-xl-12 col-form-label"
>
Marker Title
</Form.Label> </Form.Label>
<Field name="title">{renderTitleField}</Field> <div className="col-sm-9 col-md-10 col-xl-12">
<Field name="title">{renderTitleField}</Field>
</div>
</Form.Group> </Form.Group>
<Form.Group className="row"> <Form.Group className="row">
<Form.Label htmlFor="primaryTagId" className="col-2 col-xl-12"> <Form.Label
htmlFor="primaryTagId"
className="col-sm-3 col-md-2 col-xl-12 col-form-label"
>
Primary Tag Primary Tag
</Form.Label> </Form.Label>
<div className="col-6 col-xl-12"> <div className="col-sm-4 col-md-6 col-xl-12 mb-3 mb-sm-0 mb-xl-3">
<Field name="primaryTagId">{renderPrimaryTagField}</Field> <Field name="primaryTagId">{renderPrimaryTagField}</Field>
</div> </div>
<Form.Label htmlFor="seconds" className="col-1 col-xl-12 mt-2"> <div className="col-sm-5 col-md-4 col-xl-12">
Time <div className="row">
</Form.Label> <Form.Label
<Field name="seconds">{renderSecondsField}</Field> htmlFor="seconds"
className="col-sm-4 col-md-4 col-xl-12 col-form-label text-sm-right text-xl-left"
>
Time
</Form.Label>
<div className="col-sm-8 col-xl-12">
<Field name="seconds">{renderSecondsField}</Field>
</div>
</div>
</div>
</Form.Group> </Form.Group>
<Form.Group className="row"> <Form.Group className="row">
<Form.Label htmlFor="tagIds" className="col-2 col-xl-12"> <Form.Label
htmlFor="tagIds"
className="col-sm-3 col-md-2 col-xl-12 col-form-label"
>
Tags Tags
</Form.Label> </Form.Label>
<div className="col-10 col-xl-12"> <div className="col-sm-9 col-md-10 col-xl-12">
<Field name="tagIds">{renderTagsField}</Field> <Field name="tagIds">{renderTagsField}</Field>
</div> </div>
</Form.Group> </Form.Group>

View File

@@ -93,7 +93,7 @@ export const DurationInput: React.FC<IProps> = (props: IProps) => {
} }
return ( return (
<Form.Group className={`duration-input ${props.className}`}> <div className={`duration-input ${props.className}`}>
<InputGroup> <InputGroup>
<Form.Control <Form.Control
className="duration-control text-input" className="duration-control text-input"
@@ -122,6 +122,6 @@ export const DurationInput: React.FC<IProps> = (props: IProps) => {
{renderButtons()} {renderButtons()}
</InputGroup.Append> </InputGroup.Append>
</InputGroup> </InputGroup>
</Form.Group> </div>
); );
}; };

View File

@@ -217,6 +217,7 @@ div.react-select__control {
border-color: $secondary; border-color: $secondary;
color: $text-color; color: $text-color;
cursor: pointer; cursor: pointer;
white-space: nowrap;
.react-select__single-value, .react-select__single-value,
.react-select__input { .react-select__input {

View File

@@ -78,7 +78,7 @@ hr {
.nav-tabs { .nav-tabs {
border: none; border: none;
margin: auto; margin: auto;
margin-bottom: 0.5rem; margin-bottom: 1.5rem;
.nav-link { .nav-link {
border: none; border: none;