mapcomplete/UI/BigComponents/LicensePicker.ts

20 lines
852 B
TypeScript
Raw Normal View History

2021-06-11 22:51:45 +02:00
import {DropDown} from "../Input/DropDown";
import Translations from "../i18n/Translations";
2021-06-14 19:21:33 +02:00
import {UIEventSource} from "../../Logic/UIEventSource";
2021-12-21 18:35:31 +01:00
import {OsmConnection} from "../../Logic/Osm/OsmConnection";
2021-06-11 22:51:45 +02:00
export default class LicensePicker extends DropDown<string> {
2021-12-21 18:35:31 +01:00
constructor(state: {osmConnection: OsmConnection}) {
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-12-21 18:35:31 +01:00
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
}