Styling tweaks

This commit is contained in:
pietervdvn 2022-04-19 23:43:28 +02:00
parent bce8ae3e34
commit 9c6811b06e
5 changed files with 12 additions and 9 deletions

View file

@ -17,7 +17,10 @@ export default class LicensePicker extends DropDown<string> {
{value: LicensePicker.ccbysa, shown: Translations.t.image.ccbs.Clone()},
{value: LicensePicker.ccby, shown: Translations.t.image.ccb.Clone()}
],
state?.osmConnection?.GetPreference("pictures-license") ?? new UIEventSource<string>("CC0")
state?.osmConnection?.GetPreference("pictures-license") ?? new UIEventSource<string>("CC0"),
{
select_class:"w-min bg-indigo-100 p-1 rounded hover:bg-indigo-200"
}
)
this.SetClass("flex flex-col sm:flex-row").SetStyle("float:left");
}

View file

@ -138,16 +138,16 @@ export class ImageUploadFlow extends Toggle {
if (l == 0) {
return undefined
}
return t.uploadFailed.Clone().SetClass("alert");
return new Loading(t.uploadFailed).SetClass("alert");
})),
new VariableUiElement(uploadedCount.map(l => {
if (l == 0) {
return undefined;
}
if (l == 1) {
return t.uploadDone.Clone().SetClass("thanks");
return t.uploadDone.Clone().SetClass("thanks block");
}
return t.uploadMultipleDone.Subs({count: l}).SetClass("thanks")
return t.uploadMultipleDone.Subs({count: l}).SetClass("thanks block")
})),
fileSelector,

View file

@ -47,7 +47,7 @@ export class DropDown<T> extends InputElement<T> {
}
options = options ?? {}
options.select_class = options.select_class ?? 'bg-indigo-100 p-1 rounded hover:bg-indigo-200'
options.select_class = options.select_class ?? 'w-full bg-indigo-100 p-1 rounded hover:bg-indigo-200'
{

View file

@ -194,7 +194,7 @@ ${Utils.special_visualizations_importRequirementDocs}
importFlow,
isImported
),
t.zoomInMore.SetClass("alert"),
t.zoomInMore.SetClass("alert block"),
state.locationControl.map(l => l.zoom >= 18)
),
pleaseLoginButton,

View file

@ -51,7 +51,7 @@ export default class TagRenderingQuestion extends Combine {
const applicableMappingsSrc =
UIEventSource.ListStabilized(tags.map(tags => {
const applicableMappings: { if: TagsFilter, then: any, ifnot?: TagsFilter, addExtraTags: Tag[] }[] = []
const applicableMappings: { if: TagsFilter, icon?: string, then: any, ifnot?: TagsFilter, addExtraTags: Tag[] }[] = []
for (const mapping of configuration.mappings ?? []) {
if (mapping.hideInAnswer === true) {
continue
@ -158,7 +158,7 @@ export default class TagRenderingQuestion extends Combine {
private static GenerateInputElement(
state,
configuration: TagRenderingConfig,
applicableMappings: { if: TagsFilter, then: any, ifnot?: TagsFilter, addExtraTags: Tag[] }[],
applicableMappings: { if: TagsFilter, then: any, icon?: string, ifnot?: TagsFilter, addExtraTags: Tag[] }[],
applicableUnit: Unit,
tagsSource: UIEventSource<any>,
feedback: UIEventSource<Translation>
@ -168,7 +168,7 @@ export default class TagRenderingQuestion extends Combine {
const ff = TagRenderingQuestion.GenerateFreeform(state, configuration, applicableUnit, tagsSource, feedback);
const hasImages = applicableMappings.findIndex(mapping => mapping.then.icon !== undefined) >= 0
const hasImages = applicableMappings.findIndex(mapping => mapping.icon !== undefined) >= 0
let inputEls: InputElement<TagsFilter>[];
const ifNotsPresent = applicableMappings.some(mapping => mapping.ifnot !== undefined)