mapcomplete/UI/BigComponents/LicensePicker.ts

20 lines
793 B
TypeScript
Raw Normal View History

2021-06-11 22:51:45 +02:00
import {DropDown} from "../Input/DropDown";
import Translations from "../i18n/Translations";
import State from "../../State";
2021-06-14 19:21:33 +02:00
import {UIEventSource} from "../../Logic/UIEventSource";
2021-06-11 22:51:45 +02:00
export default class LicensePicker extends DropDown<string> {
2021-06-11 22:51:45 +02:00
constructor() {
2021-06-15 00:55:12 +02:00
super(Translations.t.image.willBePublished.Clone(),
2021-06-11 22:51:45 +02:00
[
2021-06-15 00:55:12 +02:00
{value: "CC0", shown: Translations.t.image.cco.Clone()},
{value: "CC-BY-SA 4.0", shown: Translations.t.image.ccbs.Clone()},
{value: "CC-BY 4.0", shown: Translations.t.image.ccb.Clone()}
2021-06-11 22:51:45 +02:00
],
2021-06-14 19:21:33 +02:00
State.state?.osmConnection?.GetPreference("pictures-license") ?? new UIEventSource<string>("CC0")
2021-06-11 22:51:45 +02:00
)
this.SetClass("flex flex-col sm:flex-row").SetStyle("float:left");
2021-06-11 22:51:45 +02:00
}
2021-06-11 22:51:45 +02:00
}