diff --git a/TSC2.Client/Pages/Home.razor b/TSC2.Client/Pages/Home.razor index 47bda00..edfe0f4 100644 --- a/TSC2.Client/Pages/Home.razor +++ b/TSC2.Client/Pages/Home.razor @@ -188,9 +188,11 @@ public async void OnMarkerClick(MapMarkerClickEventArgs args) { + var dataItem = args.DataItem as MarkerModel; - UpdateDrawer(); - await ToggleDrawer(); + CurrentSelection = dataItem.Title; + CurrentBlurb = dataItem.Blurb; + await ToggleModal(); Console.WriteLine(dataItem.Title); } @@ -204,15 +206,15 @@ private void InitializeMapMarkers(double[] coords) { - // Server call to load map markers into a list of tuples + // Server call to load map markers into a list of tuples List<(double[], string)> localMarkers = MapDriver.InitializeMarkers(coords); foreach (var current in localMarkers) { - MapMarkers.Add(new MarkerModel() - { + MapMarkers.Add(new MarkerModel() { LatLng = current.Item1, - Title = current.Item2 - }); + Title = current.Item2, + Blurb = string.Format("This is {0}'s blurb. This will be replaced when a lookup is created.", current.Item2) + }); } } @@ -220,7 +222,9 @@ { public double[] LatLng { get; set; } = [42.4649, -83.3684]; public string Title { get; set; } = ""; + public string Blurb { get; set; } = ""; } + private class LocationDetails { public string ip { get; set; } = ""; @@ -280,33 +284,56 @@
- - - - + + + @CurrentSelection + + + @CurrentBlurb +


+ + Visit Page + + +
+ + + +
@code{ - public TelerikDrawer? Drawer { get; set; } - public DrawerMode Mode { get; set; } - public IEnumerable Data { get; set; } = new List(); - public DrawerPosition Position = DrawerPosition.End; - public class DrawerItem { - public string? Text { get; set; } - public ISvgIcon? Icon { get; set; } - public bool Separator { get; set; } + public TelerikPopover? Popover { get; set; } + public string CurrentSelection { get; set; } = "123412341234onetwothreefour"; + public string CurrentBlurb { get; set; } = "This is a blurb for a shop. I believe it is rather dastardly."; + public bool isVisible = false; + + public async Task ToggleModal() + { + if (isVisible) + isVisible = false; + else + isVisible = true; + await Task.Delay(1); } - public void UpdateDrawer() - { - Data = new List - { - new DrawerItem { Text = "HelloWorld"}, - new DrawerItem { Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."}, - }; + public void VisitClickHandler() { + Console.WriteLine("Visiting page" + CurrentSelection); } - public async Task ToggleDrawer() => await Drawer.ToggleAsync(); }