Skip to content

Commit c7be38a

Browse files
committed
fix setup
1 parent c76a501 commit c7be38a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+491
-440
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,3 +398,4 @@ FodyWeavers.xsd
398398

399399
# JetBrains Rider
400400
*.sln.iml
401+
.idea

ghost-chat/App.xaml renamed to app/App.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
33
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4-
xmlns:local="clr-namespace:ghost_chat_v4"
5-
x:Class="ghost_chat_v4.App">
4+
xmlns:local="clr-namespace:app"
5+
x:Class="app.App">
66
<Application.Resources>
77
<ResourceDictionary>
88

app/App.xaml.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace app;
2+
3+
public partial class App
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
}
9+
10+
protected override Window CreateWindow(IActivationState? activationState)
11+
{
12+
return new Window(new MainPage()) { Title = "app" };
13+
}
14+
}

ghost-chat/Components/Layout/MainLayout.razor renamed to app/Components/Layout/MainLayout.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<div class="page">
44
<div class="sidebar">
5-
<NavMenu />
5+
<NavMenu/>
66
</div>
77

88
<main>

ghost-chat/Components/Layout/MainLayout.razor.css renamed to app/Components/Layout/MainLayout.razor.css

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,29 @@ main {
2121
align-items: center;
2222
}
2323

24-
.top-row ::deep a, .top-row ::deep .btn-link {
25-
white-space: nowrap;
26-
margin-left: 1.5rem;
27-
text-decoration: none;
28-
}
24+
.top-row ::deep a, .top-row ::deep .btn-link {
25+
white-space: nowrap;
26+
margin-left: 1.5rem;
27+
text-decoration: none;
28+
}
2929

30-
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
31-
text-decoration: underline;
32-
}
30+
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
31+
text-decoration: underline;
32+
}
3333

34-
.top-row ::deep a:first-child {
35-
overflow: hidden;
36-
text-overflow: ellipsis;
37-
}
34+
.top-row ::deep a:first-child {
35+
overflow: hidden;
36+
text-overflow: ellipsis;
37+
}
3838

3939
@media (max-width: 640.98px) {
4040
.top-row {
4141
justify-content: space-between;
4242
}
4343

44-
.top-row ::deep a, .top-row ::deep .btn-link {
45-
margin-left: 0;
46-
}
44+
.top-row ::deep a, .top-row ::deep .btn-link {
45+
margin-left: 0;
46+
}
4747
}
4848

4949
@media (min-width: 641px) {
@@ -64,11 +64,11 @@ main {
6464
z-index: 1;
6565
}
6666

67-
.top-row.auth ::deep a:first-child {
68-
flex: 1;
69-
text-align: right;
70-
width: 0;
71-
}
67+
.top-row.auth ::deep a:first-child {
68+
flex: 1;
69+
text-align: right;
70+
width: 0;
71+
}
7272

7373
.top-row, article {
7474
padding-left: 2rem !important;

ghost-chat/Components/Layout/NavMenu.razor renamed to app/Components/Layout/NavMenu.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<div class="top-row ps-3 navbar navbar-dark">
22
<div class="container-fluid">
3-
<a class="navbar-brand" href="">ghost-chat</a>
3+
<a class="navbar-brand" href="">app</a>
44
</div>
55
</div>
66

7-
<input type="checkbox" title="Navigation menu" class="navbar-toggler" />
7+
<input type="checkbox" title="Navigation menu" class="navbar-toggler"/>
88

99
<div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
1010
<nav class="flex-column">

ghost-chat/Components/Layout/NavMenu.razor.css renamed to app/Components/Layout/NavMenu.razor.css

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
1212
}
1313

14-
.navbar-toggler:checked {
15-
background-color: rgba(255, 255, 255, 0.5);
16-
}
14+
.navbar-toggler:checked {
15+
background-color: rgba(255, 255, 255, 0.5);
16+
}
1717

1818
.top-row {
1919
height: 3.5rem;
20-
background-color: rgba(0,0,0,0.4);
20+
background-color: rgba(0, 0, 0, 0.4);
2121
}
2222

2323
.navbar-brand {
@@ -51,32 +51,32 @@
5151
padding-bottom: 0.5rem;
5252
}
5353

54-
.nav-item:first-of-type {
55-
padding-top: 1rem;
56-
}
54+
.nav-item:first-of-type {
55+
padding-top: 1rem;
56+
}
5757

58-
.nav-item:last-of-type {
59-
padding-bottom: 1rem;
60-
}
58+
.nav-item:last-of-type {
59+
padding-bottom: 1rem;
60+
}
6161

62-
.nav-item ::deep a {
63-
color: #d7d7d7;
64-
border-radius: 4px;
65-
height: 3rem;
66-
display: flex;
67-
align-items: center;
68-
line-height: 3rem;
69-
}
62+
.nav-item ::deep a {
63+
color: #d7d7d7;
64+
border-radius: 4px;
65+
height: 3rem;
66+
display: flex;
67+
align-items: center;
68+
line-height: 3rem;
69+
}
7070

71-
.nav-item ::deep a.active {
72-
background-color: rgba(255,255,255,0.37);
73-
color: white;
74-
}
71+
.nav-item ::deep a.active {
72+
background-color: rgba(255, 255, 255, 0.37);
73+
color: white;
74+
}
7575

76-
.nav-item ::deep a:hover {
77-
background-color: rgba(255,255,255,0.1);
78-
color: white;
79-
}
76+
.nav-item ::deep a:hover {
77+
background-color: rgba(255, 255, 255, 0.1);
78+
color: white;
79+
}
8080

8181
.nav-scrollable {
8282
display: none;

ghost-chat/Components/Pages/Counter.razor renamed to app/Components/Pages/Counter.razor

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
<h1>Counter</h1>
44

5-
<p role="status">Current count: @currentCount</p>
5+
<p role="status">Current count: @_currentCount</p>
66

77
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
88

99
@code {
10-
private int currentCount = 0;
10+
private int _currentCount;
1111

1212
private void IncrementCount()
1313
{
14-
currentCount++;
14+
_currentCount++;
1515
}
16+
1617
}

ghost-chat/Components/Pages/Weather.razor renamed to app/Components/Pages/Weather.razor

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ else
1212
{
1313
<table class="table">
1414
<thead>
15-
<tr>
16-
<th>Date</th>
17-
<th>Temp. (C)</th>
18-
<th>Temp. (F)</th>
19-
<th>Summary</th>
20-
</tr>
15+
<tr>
16+
<th>Date</th>
17+
<th>Temp. (C)</th>
18+
<th>Temp. (F)</th>
19+
<th>Summary</th>
20+
</tr>
2121
</thead>
2222
<tbody>
23-
@foreach (var forecast in forecasts)
24-
{
25-
<tr>
26-
<td>@forecast.Date.ToShortDateString()</td>
27-
<td>@forecast.TemperatureC</td>
28-
<td>@forecast.TemperatureF</td>
29-
<td>@forecast.Summary</td>
30-
</tr>
31-
}
23+
@foreach (var forecast in forecasts)
24+
{
25+
<tr>
26+
<td>@forecast.Date.ToShortDateString()</td>
27+
<td>@forecast.TemperatureC</td>
28+
<td>@forecast.TemperatureF</td>
29+
<td>@forecast.Summary</td>
30+
</tr>
31+
}
3232
</tbody>
3333
</table>
3434
}
@@ -58,4 +58,5 @@ else
5858
public string? Summary { get; set; }
5959
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
6060
}
61+
6162
}

app/Components/Routes.razor

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@using app.Components.Layout
2+
<Router AppAssembly="@typeof(MauiProgram).Assembly">
3+
<Found Context="routeData">
4+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/>
5+
<FocusOnNavigate RouteData="@routeData" Selector="h1"/>
6+
</Found>
7+
</Router>

ghost-chat/Components/_Imports.razor renamed to app/Components/_Imports.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
@using Microsoft.AspNetCore.Components.Web
66
@using Microsoft.AspNetCore.Components.Web.Virtualization
77
@using Microsoft.JSInterop
8-
@using ghost_chat_v4
9-
@using ghost_chat_v4.Components
8+
@using app
9+
@using app.Components

ghost-chat/MainPage.xaml renamed to app/MainPage.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
33
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4-
xmlns:local="clr-namespace:ghost_chat_v4"
5-
x:Class="ghost_chat_v4.MainPage">
4+
xmlns:local="clr-namespace:app"
5+
x:Class="app.MainPage">
66

77
<BlazorWebView x:Name="blazorWebView" HostPage="wwwroot/index.html">
88
<BlazorWebView.RootComponents>

app/MainPage.xaml.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace app;
2+
3+
public partial class MainPage
4+
{
5+
public MainPage()
6+
{
7+
InitializeComponent();
8+
}
9+
}

app/MauiProgram.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Microsoft.Extensions.Logging;
2+
3+
namespace app;
4+
5+
public static class MauiProgram
6+
{
7+
public static MauiApp CreateMauiApp()
8+
{
9+
var builder = MauiApp.CreateBuilder();
10+
builder
11+
.UseMauiApp<App>()
12+
.ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); });
13+
14+
builder.Services.AddMauiBlazorWebView();
15+
16+
#if DEBUG
17+
builder.Services.AddBlazorWebViewDeveloperTools();
18+
builder.Logging.AddDebug();
19+
#endif
20+
21+
return builder.Build();
22+
}
23+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Foundation;
2+
3+
namespace app;
4+
5+
[Register("AppDelegate")]
6+
public class AppDelegate : MauiUIApplicationDelegate
7+
{
8+
protected override MauiApp CreateMauiApp()
9+
{
10+
return MauiProgram.CreateMauiApp();
11+
}
12+
}

app/Platforms/MacCatalyst/Info.plist

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<!-- The Mac App Store requires you specify if the app uses encryption. -->
6+
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/itsappusesnonexemptencryption -->
7+
<!-- <key>ITSAppUsesNonExemptEncryption</key> -->
8+
<!-- Please indicate <true/> or <false/> here. -->
9+
10+
<!-- Specify the category for your app here. -->
11+
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype -->
12+
<!-- <key>LSApplicationCategoryType</key> -->
13+
<!-- <string>public.app-category.YOUR-CATEGORY-HERE</string> -->
14+
<key>UIDeviceFamily</key>
15+
<array>
16+
<integer>2</integer>
17+
</array>
18+
<key>UIRequiredDeviceCapabilities</key>
19+
<array>
20+
<string>arm64</string>
21+
</array>
22+
<key>UISupportedInterfaceOrientations</key>
23+
<array>
24+
<string>UIInterfaceOrientationPortrait</string>
25+
<string>UIInterfaceOrientationLandscapeLeft</string>
26+
<string>UIInterfaceOrientationLandscapeRight</string>
27+
</array>
28+
<key>UISupportedInterfaceOrientations~ipad</key>
29+
<array>
30+
<string>UIInterfaceOrientationPortrait</string>
31+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
32+
<string>UIInterfaceOrientationLandscapeLeft</string>
33+
<string>UIInterfaceOrientationLandscapeRight</string>
34+
</array>
35+
<key>XSAppIconAssets</key>
36+
<string>Assets.xcassets/appicon.appiconset</string>
37+
</dict>
38+
</plist>

app/Platforms/MacCatalyst/Program.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UIKit;
2+
3+
namespace app;
4+
5+
public class Program
6+
{
7+
// This is the main entry point of the application.
8+
private static void Main(string[] args)
9+
{
10+
// if you want to use a different Application Delegate class from "AppDelegate"
11+
// you can specify it here.
12+
UIApplication.Main(args, null, typeof(AppDelegate));
13+
}
14+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<maui:MauiWinUIApplication
2-
x:Class="ghost_chat_v4.WinUI.App"
2+
x:Class="app.WinUI.App"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:maui="using:Microsoft.Maui"
6-
xmlns:local="using:ghost_chat_v4.WinUI">
6+
xmlns:local="using:app.WinUI">
77

88
</maui:MauiWinUIApplication>

0 commit comments

Comments
 (0)