Skip to content

Commit

Permalink
fix hybrid rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Strehle committed Nov 3, 2023
1 parent d33eafa commit 9325966
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app.dx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Localization Example",
icon: "https://cdn.unyt.org/unyt-resources/logos/unyt/square-dark-background.png";
icon: https://cdn.unyt.org/unyt-resources/logos/unyt/square-dark-background.png;

plugin git_deploy (
prod: (
Expand Down
1 change: 0 additions & 1 deletion backend/entrypoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ import { renderBackend, renderHybrid, renderStatic } from "uix/base/render-metho
export default {
'/': null,
'/static': () => renderStatic(<Main/>),
'/backend': () => renderBackend(<Main/>),
'/hybrid': () => renderHybrid(<Main/>),
} satisfies Entrypoint;
7 changes: 4 additions & 3 deletions common/components/Main.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { UIX } from "uix";
import { include } from "uix/base/decorators.ts";
import { Component } from "uix/components/Component.ts";
import { template } from "uix/html/template.ts";
import { always, Datex } from "unyt_core/datex.ts";
import { use } from "uix/base/decorators.ts";

const languages = {
"en": "🇺🇸",
Expand All @@ -15,7 +16,7 @@ const languages = {
{
Object.entries(languages).map(([lang, flag]) =>
<div
data-active={always(() => use(lang) && Datex.Runtime.ENV.LANG === lang)}
data-active={always(() => Datex.Runtime.ENV.LANG === lang)}
onclick:frontend={() => use(lang) && (Datex.Runtime.ENV.LANG = lang)} class="toggle">
{flag}
</div>
Expand All @@ -25,5 +26,5 @@ const languages = {
</div>
})
export class Main extends Component {
@use("../data.dx") declare strings: {[key: string]: string};
@include("../data.dx") declare strings: {[key: string]: string};
}

0 comments on commit 9325966

Please sign in to comment.