Skip to content

Commit

Permalink
Make sticky an optional dependency, remove old modal override (#158)
Browse files Browse the repository at this point in the history
* fix: sticky should be an optional dependency

Fixes #146

Signed-off-by: Alexander Skvortsov <[email protected]>

* fix: remove hacky modal override

stacking modals is now in core, and this implementation is buggy

Signed-off-by: Alexander Skvortsov <[email protected]>

* Update js/src/forum/components/FeaturedBlogItem.tsx

---------

Signed-off-by: Alexander Skvortsov <[email protected]>
Co-authored-by: David Wheatley <[email protected]>
  • Loading branch information
askvortsov1 and davwheat authored May 14, 2023
1 parent c67238a commit 63eefad
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 237 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"color": "#ffffff"
},
"optional-dependencies": [
"flarum/sticky",
"fof/discussion-language",
"askvortsov/flarum-rich-text"
]
Expand Down
4 changes: 3 additions & 1 deletion js/src/forum/components/FeaturedBlogItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export default class FeaturedBlogItem extends Component<Attrs> {
100
);

if (article.isSticky()) {
// Sticky is an optional dependency, so we can't
// assume method existence.
if (article.isSticky?.()) {
items.add('sticky', <span class="BlogFeatured-list-item-isSticky dataItem">{icon('fas fa-thumbtack')}</span>, 80);
}

Expand Down
11 changes: 0 additions & 11 deletions js/src/forum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ import addSidebarNav from './utils/addSidebarNav';

import BlogItem from './pages/BlogItem';

// Create our own modal manager
import OverrideModalState from './states/OverrideModalState';
import overrideModalManager from './utils/overrideModalManager';

// Register Flarum Blog
app.initializers.add(
'v17development-flarum-blog',
Expand Down Expand Up @@ -57,13 +53,6 @@ app.initializers.add(

// Add a link to the blog to the IndexPage sidebar, if enabled.
addSidebarNav();

/**
* Notice from V17: Temporary override due to lack of multi-dialogs!
*
* We'll open a PR to support multi-dialog to the Flarum main repo
*/
overrideModalManager();
},
-100000
);
Expand Down
141 changes: 0 additions & 141 deletions js/src/forum/states/OverrideModalState.ts

This file was deleted.

84 changes: 0 additions & 84 deletions js/src/forum/utils/overrideModalManager.js

This file was deleted.

0 comments on commit 63eefad

Please sign in to comment.