mukaschultze / nativescript-windowed-modal

Consistent modals for Android and iOS
https://www.npmjs.com/package/nativescript-windowed-modal
Apache License 2.0
47 stars 18 forks source link

Apply dimAmount to background color applied to ModalStack #26

Closed Tyler-V closed 4 years ago

Tyler-V commented 4 years ago

PR Checklist

What is the current behavior?

What is the new behavior?

Fixes/Implements/Closes #25.

Tyler-V commented 4 years ago

Used as:

  showMapLayers() {
    const options = {
      viewContainerRef: this.vcRef,
      animated: false,
      fullscreen: true,
      dimAmount: 0.5,
    };

    return this.modalDialogService.showModal(MapStylesComponent, options);
  }
<ModalStack dismissEnabled="true" class="modal-container" backgroundColor="transparent">
  <StackLayout class="modal">
    <AbsoluteLayout width="100%" height="50" style="border-bottom-color: #DDD; border-bottom-width: 1;">
      <StackLayout orientation="horizontal" width="100%" height="100%">
        <Label text="Map Styles" fontSize="20" fontWeight="bold" width="100%" textAlignment="center" verticalAlignment="center"></Label>
      </StackLayout>
    </AbsoluteLayout>
    <StackLayout class="p-10">
      <StackLayout>
        <Button text="Streets" class="-primary" (tap)="setStyle(MapStyle.MAPBOX_STREETS)"></Button>
        <Button text="Terrain" class="-primary" (tap)="setStyle(MapStyle.OUTDOORS)"></Button>
        <Button text="Satellite" class="-primary" (tap)="setStyle(MapStyle.SATELLITE_STREETS)"></Button>
      </StackLayout>
    </StackLayout>
  </StackLayout>
</ModalStack>
.modal {
  margin: 20;
  margin-top: 35;
  border-radius: 8;
  horizontal-align: center;
  vertical-align: middle;
  background-color: white;
}

.modal-container {
  padding: 25;
  padding-bottom: 10;
}
Tyler-V commented 4 years ago

image image