Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
datlechin committed Sep 28, 2024
1 parent a502e34 commit 035075b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions framework/core/js/dist-typings/common/Application.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion framework/core/js/src/admin/components/EditGroupModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default class EditGroupModal<CustomAttrs extends IEditGroupModalAttrs = I
<div className="Form-group">
<label>{app.translator.trans('core.admin.edit_group.icon_label')}</label>
<div className="helpText">
{app.translator.trans('core.admin.edit_group.icon_text', { a: <a href="https://fontawesome.com/v6/search?m=free" tabindex="-1" /> })}
{app.translator.trans('core.admin.edit_group.icon_text', { a: <a href={app.refs.fontawesome} tabindex="-1" /> })}
</div>
<input className="FormControl" placeholder="fas fa-bolt" bidi={this.icon} />
</div>,
Expand Down
5 changes: 5 additions & 0 deletions framework/core/js/src/common/Application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import IExtender from './extenders/IExtender';
import AccessToken from './models/AccessToken';
import SearchManager from './SearchManager';
import { ColorScheme } from './components/ThemeMode';
import references from './references';

export type FlarumScreens = 'phone' | 'tablet' | 'desktop' | 'desktop-hd';

Expand Down Expand Up @@ -248,6 +249,8 @@ export default class Application {

allowUserColorScheme!: boolean;

refs: Record<string, unknown> = {};

private _title: string = '';
private _titleCount: number = 0;

Expand Down Expand Up @@ -320,6 +323,8 @@ export default class Application {
this.initialRoute = window.location.href;

caughtInitializationErrors.forEach((handler) => handler());

references(this);
}

protected beforeMount(): void {
Expand Down
10 changes: 10 additions & 0 deletions framework/core/js/src/common/references.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Application from './Application';

/**
* The `references` initializer defines references to external resources.
*/
export default function (app: Application) {
app.refs = {
fontawesome: 'https://fontawesome.com/v6/icons?o=r&m=free',
};
}

0 comments on commit 035075b

Please sign in to comment.