2022-02-14 01:51:52 +01:00
|
|
|
@page "/settings"
|
2022-12-15 20:03:40 +01:00
|
|
|
@inherits LocalizableComponentBase
|
|
|
|
|
<Title>@Localizer["Settings"]</Title>
|
2022-02-14 01:51:52 +01:00
|
|
|
|
2026-10-03 12:08:11 +02:00
|
|
|
<section class="block relative w-full h-full neo-inset neo-xs rounded-xl">
|
2022-02-14 01:51:52 +01:00
|
|
|
|
2026-10-03 12:08:11 +02:00
|
|
|
<div class="flex flex-col gap-4 p-4 md:p-5 w-full h-full absolute overflow-y-auto">
|
2022-02-14 01:51:52 +01:00
|
|
|
|
2026-10-03 12:43:07 +02:00
|
|
|
<DCollapse Icon="DCollapseIcon.Arrow" IsOpen="true">
|
2026-10-03 12:08:11 +02:00
|
|
|
<Header>
|
|
|
|
|
<p class="inline-flex items-center gap-2">
|
2022-12-15 20:03:40 +01:00
|
|
|
<i class="ion-md-cog text-xl"></i> <span>@Localizer["General"]</span>
|
2022-02-14 01:51:52 +01:00
|
|
|
</p>
|
2026-10-03 12:08:11 +02:00
|
|
|
</Header>
|
|
|
|
|
<ChildContent>
|
2026-10-03 12:43:07 +02:00
|
|
|
@* Every theme setting; NavMenu's toggle and slider are shortcuts to the dark and hue ones. *@
|
|
|
|
|
<div class="flex flex-col gap-4 w-full p-3 md:p-4">
|
2026-10-03 15:26:21 +02:00
|
|
|
<DToggle LabelText="@Localizer["Follow the system's light or dark setting"]" Value="CascadingState.PublicCacheData.PageSettings.PreferSystemTheming"
|
|
|
|
|
ValueChanged="v => Update(s => s.PreferSystemTheming = v)" ValueExpression="() => CascadingState.PublicCacheData.PageSettings.PreferSystemTheming" />
|
2026-10-03 12:43:07 +02:00
|
|
|
<DToggle LabelText="@Localizer["Dark mode"]" Value="IsDark"
|
|
|
|
|
ValueChanged="v => Update(s => s.SetDarkMode(v))" ValueExpression="() => IsDark" />
|
|
|
|
|
<DToggle LabelText="@Localizer["Grey"]" Value="IsGray"
|
|
|
|
|
ValueChanged="v => Update(s => s.SetGray(v, IsDark))" ValueExpression="() => IsGray" />
|
2026-10-03 15:26:21 +02:00
|
|
|
<label class="flex flex-col gap-2 max-w-md">
|
|
|
|
|
<span class="text-sm">@Localizer["Language"]</span>
|
|
|
|
|
@* Language names stay in their own language. Changing it reloads the app with the new culture. *@
|
|
|
|
|
<DSelect TValue="string" class="w-full" Value="CascadingState.PublicCacheData.PageSettings.CurrentLanguageCode"
|
|
|
|
|
ValueChanged="ChangeLanguage" ValueExpression="() => CascadingState.PublicCacheData.PageSettings.CurrentLanguageCode">
|
|
|
|
|
<option value="en">English</option>
|
|
|
|
|
<option value="it">Italiano</option>
|
|
|
|
|
</DSelect>
|
|
|
|
|
</label>
|
2026-10-03 12:43:07 +02:00
|
|
|
<label class="flex flex-col gap-2 max-w-md">
|
|
|
|
|
<span class="text-sm">@Localizer["Light theme colour"]</span>
|
|
|
|
|
<DRange TValue="short" class="neo-hue-track w-full" Size="DSize.Xs" Min="0" Max="359" Step="1"
|
2026-10-03 15:26:21 +02:00
|
|
|
Value="CascadingState.PublicCacheData.PageSettings.LightThemeIndexColour" ValueChanged="v => Update(s => s.SetHue(false, v))"
|
|
|
|
|
ValueExpression="() => CascadingState.PublicCacheData.PageSettings.LightThemeIndexColour" />
|
2026-10-03 12:43:07 +02:00
|
|
|
</label>
|
|
|
|
|
<label class="flex flex-col gap-2 max-w-md">
|
|
|
|
|
<span class="text-sm">@Localizer["Dark theme colour"]</span>
|
|
|
|
|
<DRange TValue="short" class="neo-hue-track w-full" Size="DSize.Xs" Min="0" Max="359" Step="1"
|
2026-10-03 15:26:21 +02:00
|
|
|
Value="CascadingState.PublicCacheData.PageSettings.DarkThemeIndexColour" ValueChanged="v => Update(s => s.SetHue(true, v))"
|
|
|
|
|
ValueExpression="() => CascadingState.PublicCacheData.PageSettings.DarkThemeIndexColour" />
|
2026-10-03 12:43:07 +02:00
|
|
|
</label>
|
2022-02-14 01:51:52 +01:00
|
|
|
</div>
|
2026-10-03 12:08:11 +02:00
|
|
|
</ChildContent>
|
|
|
|
|
</DCollapse>
|
2022-02-14 01:51:52 +01:00
|
|
|
|
2026-10-05 03:10:27 +02:00
|
|
|
<DCollapse Icon="DCollapseIcon.Arrow">
|
|
|
|
|
<Header>
|
|
|
|
|
<p class="inline-flex items-center gap-2">
|
|
|
|
|
<i class="ion-md-funnel text-xl"></i> <span>@Localizer["Filters"]</span>
|
|
|
|
|
</p>
|
|
|
|
|
</Header>
|
|
|
|
|
<ChildContent>
|
|
|
|
|
<div class="flex flex-wrap items-center gap-3 w-full p-3 md:p-4">
|
|
|
|
|
<p class="flex-1 min-w-48 text-sm">@Localizer["Words, phrases and posts this persona would rather not see, and where."]</p>
|
|
|
|
|
<a class="btn btn-sm" href="filters"><i class="ion-md-funnel"></i><span>@Localizer["Manage filters"]</span></a>
|
|
|
|
|
</div>
|
|
|
|
|
</ChildContent>
|
|
|
|
|
</DCollapse>
|
|
|
|
|
|
2026-10-03 12:08:11 +02:00
|
|
|
<DCollapse Icon="DCollapseIcon.Arrow">
|
|
|
|
|
<Header>
|
|
|
|
|
<p class="inline-flex items-center gap-2">
|
2022-12-15 20:03:40 +01:00
|
|
|
<i class="ion-md-person text-xl"></i> <span>@Localizer["Profile"]</span>
|
2022-02-14 01:51:52 +01:00
|
|
|
</p>
|
2026-10-03 12:08:11 +02:00
|
|
|
</Header>
|
|
|
|
|
<ChildContent>
|
2022-02-14 01:51:52 +01:00
|
|
|
<div class="block w-full p-3 md:p-4">
|
|
|
|
|
<p class="w-full text-center text-lg">
|
2022-12-15 20:03:40 +01:00
|
|
|
<i class="ion-ios-remove-circle-outline"></i> @Localizer["Empty"]
|
2022-02-14 01:51:52 +01:00
|
|
|
</p>
|
|
|
|
|
</div>
|
2026-10-03 12:08:11 +02:00
|
|
|
</ChildContent>
|
|
|
|
|
</DCollapse>
|
2022-02-14 01:51:52 +01:00
|
|
|
|
2026-10-03 12:08:11 +02:00
|
|
|
<DCollapse Icon="DCollapseIcon.Arrow">
|
|
|
|
|
<Header>
|
|
|
|
|
<p class="inline-flex items-center gap-2">
|
2022-12-15 20:03:40 +01:00
|
|
|
<i class="ion-md-archive text-xl"></i> <span>@Localizer["Data import/export"]</span>
|
2022-02-14 01:51:52 +01:00
|
|
|
</p>
|
2026-10-03 12:08:11 +02:00
|
|
|
</Header>
|
|
|
|
|
<ChildContent>
|
2022-02-14 01:51:52 +01:00
|
|
|
<div class="block w-full p-3 md:p-4">
|
|
|
|
|
<p class="w-full text-center text-lg">
|
2022-12-15 20:03:40 +01:00
|
|
|
<i class="ion-ios-remove-circle-outline"></i> @Localizer["Empty"]
|
2022-02-14 01:51:52 +01:00
|
|
|
</p>
|
|
|
|
|
</div>
|
2026-10-03 12:08:11 +02:00
|
|
|
</ChildContent>
|
|
|
|
|
</DCollapse>
|
2022-02-14 01:51:52 +01:00
|
|
|
|
2026-10-03 12:08:11 +02:00
|
|
|
<DCollapse Icon="DCollapseIcon.Arrow">
|
|
|
|
|
<Header>
|
|
|
|
|
<p class="inline-flex items-center gap-2">
|
2022-12-15 20:03:40 +01:00
|
|
|
<i class="ion-md-eye-off text-xl"></i> <span>@Localizer["Mutes/Blocks"]</span>
|
2022-02-14 01:51:52 +01:00
|
|
|
</p>
|
2026-10-03 12:08:11 +02:00
|
|
|
</Header>
|
|
|
|
|
<ChildContent>
|
2022-02-14 01:51:52 +01:00
|
|
|
<div class="block w-full p-3 md:p-4">
|
|
|
|
|
<p class="w-full text-center text-lg">
|
2022-12-15 20:03:40 +01:00
|
|
|
<i class="ion-ios-remove-circle-outline"></i> @Localizer["Empty"]
|
2022-02-14 01:51:52 +01:00
|
|
|
</p>
|
|
|
|
|
</div>
|
2026-10-03 12:08:11 +02:00
|
|
|
</ChildContent>
|
|
|
|
|
</DCollapse>
|
2022-02-14 01:51:52 +01:00
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
@code {
|
2026-10-03 12:43:07 +02:00
|
|
|
|
|
|
|
|
bool IsDark => CascadingState.Status.IsDarkTheme();
|
2026-10-03 15:26:21 +02:00
|
|
|
bool IsGray => CascadingState.PublicCacheData.PageSettings.IsGray();
|
2026-10-03 12:43:07 +02:00
|
|
|
|
|
|
|
|
Task Update(Action<PageSettings> change) => CascadingState.UpdatePageSettings(change).AsTask();
|
2026-10-03 15:26:21 +02:00
|
|
|
|
|
|
|
|
async Task ChangeLanguage(string languageCode)
|
|
|
|
|
{
|
|
|
|
|
await Update(settings => settings.CurrentLanguageCode = languageCode);
|
|
|
|
|
Navigation.NavigateTo(Navigation.Uri, forceLoad: true);
|
|
|
|
|
}
|
2022-02-14 01:51:52 +01:00
|
|
|
}
|