Skip to content

Commit

Permalink
Merge pull request #273 from dymaptic/pro/76-white-label
Browse files Browse the repository at this point in the history
Pro/76 white label
  • Loading branch information
TimPurdum authored Dec 12, 2023
2 parents 5b5dbbd + fe53b2f commit f30101a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 10 deletions.
27 changes: 18 additions & 9 deletions src/dymaptic.GeoBlazor.Core/Components/Views/MapView.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,24 @@
<div class="map-container" id="@($"map-container-{Id}")">
@ChildContent
</div>
<div class="dymaptic-branding">
<a href="https://www.geoblazor.com">
<img height="12" src="_content/dymaptic.GeoBlazor.Core/images/Blazor-API-60px.png" /> GeoBlazor
</a>
by
<a href="https://www.dymaptic.com">
<img height="12" src="_content/dymaptic.GeoBlazor.Core/images/dymaptic-logo-circle-icon.png" /> dymaptic
</a>
</div>
@if (WhiteLabel is null || !IsPro())
{
<div class="dymaptic-branding">
<a href="https://www.geoblazor.com">
<img height="12" src="_content/dymaptic.GeoBlazor.Core/images/Blazor-API-60px.png" /> GeoBlazor
</a>
by
<a href="https://www.dymaptic.com">
<img height="12" src="_content/dymaptic.GeoBlazor.Core/images/dymaptic-logo-circle-icon.png" /> dymaptic
</a>
</div>
}
else
{
<div class="white-label">
@((MarkupString)WhiteLabel)
</div>
}
</div>
</CascadingValue>
</CascadingValue>
Expand Down
26 changes: 26 additions & 0 deletions src/dymaptic.GeoBlazor.Core/Components/Views/MapView.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ public Point? Center
/// </summary>
[Parameter]
public bool? PromptForOAuthLogin { get; set; }

[Parameter]
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
public string? WhiteLabel { get; set; }
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member

#endregion

Expand Down Expand Up @@ -2371,5 +2376,26 @@ protected List<string> GetActiveEventHandlers()
return activeHandlers;
}

private bool IsPro()
{
if (_isPro is null)
{
try
{
Assembly _ = Assembly.Load("dymaptic.GeoBlazor.Pro");

_isPro = true;
}
catch
{
_isPro = false;
}
}

return _isPro.Value;
}

private bool? _isPro;

#endregion
}
2 changes: 1 addition & 1 deletion src/dymaptic.GeoBlazor.Core/dymaptic.GeoBlazor.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<Exec Command="pwsh ./assetCopy.ps1" />
</Target>

<Target Name="Copy Assets Release" AfterTargets="PreBuildEvent" Condition="$(Configuration) == 'RELEASE' AND $(TargetFrameworks.StartsWith($(TargetFramework)))">
<Target Name="Copy Assets Release" AfterTargets="PreBuildEvent" Condition="$(Configuration) == 'RELEASE' AND $(TargetFrameworks.StartsWith($(TargetFramework))) AND '$(UpdateTemplates)' == 'true'">
<Message Importance="high" Text="Update Template Versions" />
<Exec Command="pwsh ./updateTemplates.ps1 $(CoreVersion)" />
</Target>
Expand Down

0 comments on commit f30101a

Please sign in to comment.