-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Arkshine/modernize
COMPATIBILITY: Modernize the component
- Loading branch information
Showing
24 changed files
with
3,021 additions
and
1,085 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
< 3.3.0.beta1-dev: f3561ce7fd9dded965fb8e9a99229539c7af3aa1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require("@discourse/lint-configs/eslint-theme"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require("@discourse/lint-configs/prettier"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require("@discourse/lint-configs/template-lint"); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
javascripts/discourse/api-initializers/dropdown-header.gjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { apiInitializer } from "discourse/lib/api"; | ||
import CustomHeaderLinks from "../components/custom-header-links"; | ||
|
||
export default apiInitializer("1.29.0", (api) => { | ||
if (!settings.header_links) { | ||
return; | ||
} | ||
|
||
if (settings.links_position === "right") { | ||
api.headerButtons.add("dropdown-header", CustomHeaderLinks, { | ||
before: "auth", | ||
}); | ||
} else { | ||
api.renderAfterWrapperOutlet("home-logo", CustomHeaderLinks); | ||
} | ||
}); |
22 changes: 0 additions & 22 deletions
22
javascripts/discourse/api-initializers/dropdown-header.js.es6
This file was deleted.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
javascripts/discourse/components/custom-header-dropdown.gjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import Component from "@ember/component"; | ||
import { fn } from "@ember/helper"; | ||
import { on } from "@ember/modifier"; | ||
import { action } from "@ember/object"; | ||
import { service } from "@ember/service"; | ||
import DiscourseURL from "discourse/lib/url"; | ||
import CustomIcon from "./custom-icon"; | ||
|
||
export default class CustomHeaderDropdown extends Component { | ||
@service site; | ||
@service router; | ||
|
||
@action | ||
redirectToUrl(url, event) { | ||
if (this.site.mobileView) { | ||
this.toggleHeaderLinks(); | ||
} | ||
|
||
DiscourseURL.routeTo(url); | ||
|
||
event.stopPropagation(); | ||
} | ||
|
||
<template> | ||
<li | ||
class="custom-header-dropdown-link" | ||
title={{@item.title}} | ||
role="button" | ||
{{on "click" (fn this.redirectToUrl @item.url)}} | ||
> | ||
<CustomIcon @icon={{@item.icon}} /> | ||
<span class="custom-header-link-title">{{@item.title}}</span> | ||
{{#if @item.description}} | ||
<span class="custom-header-link-desc">{{@item.description}}</span> | ||
{{/if}} | ||
</li> | ||
</template> | ||
} |
Oops, something went wrong.