* Remove trending communities card from home.
- This proved after time to be pointless. I thought about keeping the
create and explore communities buttons, but these are already in the
navbar, and so just take up more pointless space.
- Fixes#2027
- Fixes#2007
* Forgot to remove trending loading skeleton.
* Prevent broken logo from crashing site
* Cache icons in memory to make site less vulnerable to DOS attacks
* Swap try and if blocks for apple touch icon
Browsers without size property for URLSearchParams always returned an
empty string.
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
* Allow create post page form inputs to be populated from query params
* Fix issue with cross post params.
---------
Co-authored-by: Dessalines <tyhou13@gmx.com>
* AdminSettings remove unused currentTab state
* Fix amAdmin check in reports fetchInitialData
* Make CreatePost render earlier
* Include children of auth and anonymous guard in first render.
* Convert DidMount to WillMount where things don't depend on the DOM
`componentDidMount` is called after the first render. A lot of
components used it to call `setState`, which causes a second render.
* Keep route components mounted during same route navigation
Not sure why this wasn't the case without this change. The only
difference here is that the same array is reused in every render.
* Disable mounted same route navigation by default
* Enable mounted same route navigation for some routes
* Render more while loading
* Prettier markup
* Make Post use query params and reload comments independently
* Fix issue with <Prompt /> for forms that remain mounted after "leaving".
* Make Search not rerender the results on every keystroke
* Discard old requests
These used to (mostly) arrive at the old already unmounted components.
Now they would render briefly until the latest response is received.
* Move non breaking space to modlog
* Make show optional for modals
* Fix leap year issue
* Show same cake day date independent of timezone (#2455)
* Show same cake day date independent of timezone
* Remove commented out assertions
---------
Co-authored-by: matc-pub <161147791+matc-pub@users.noreply.github.com>
* Content warning fixups
- Require consent of logged in existing users.
- Prevent link clicks in blurred areas.
- Enable tippy again.
- Prevent stacking of countdowns for Back button.
- Fix auto expand blocking for images.
* Hide content warning for logged in users
* Make confirm popup for adult consent
* Fix import
* Fix blur and adjust user settings
* Make confirmation popup more stylish
* Add setting to site settings form
* Fix modal bug
* Put adult consent logic all in one place
* Make modal use markdown
* Fix consent modal showing up for currently logged in admin
* Add go-back redirect countdown
* Center modal title
* Handle enable_nsfw correctly
* Blur background of modal to hide spicy things
* Add translations
* Avoid destroyed tippy warning
Tippy doesn't remove its onDocumentPress listener when destroyed.
Instead the listener removes itself after calling hide for hideOnClick.
It doesn't look like there is a way to reliable work around this.
This skips the warning for the first hide call on a destroyed tippy
instance.
Cleanup is only performed after at least ten tippy instances have been
created.
* Hide tooltips for elements that are no longer connected to the document
* Only render action modals after first show
* Only render action dropdown after first show
* Modals fix for quick unmount
Modals use `await import("bootstrap/js/dist/modal")` when being mounted.
This means its possible that the component unmounts before the promise
resolves.
* bind() dropdown toggle click handler
* Modal mixin
* Add hide post UI
* Add toggle to home and community feeds to show hidden posts
* Add i18n (and add lockfile to prettier ignore)
* Change show hidden style
* Tippy
* Enable @babel/plugin-proposal-decorators
Dependency already exists
* Use tippy.js delegate addon, cleanup tippy instances from a mixin.
The delegate addon creates tippy instances from mouse and touch events
with a matching `event.target`. This is initially significantly cheaper
than creating all instances at once. The addon keeps all created tippy
instances alive until it is destroyed itself.
`tippyMixin` destroys the addon instance after every render, as long as
all instances are hidden. This drops some tippy instances that may have
to be recreated later (e.g when the mouse moves over the trigger again),
but is otherwise fairly cheap (creates one tippy instance).
* Restore scroll positions when resource loading settles.
The history module generates a random string (`location.key`) for every
browser history entry. The names for saved positions include this key.
The position is saved before a route component unmounts or before the
`location.key` changes.
The `scrollMixin` tires to restore the scroll position after every
change of `location.key`. It only does so after the first render for
which the route components `loadingSettled()` returns true.
Things like `scrollToComments` should only scroll when `history.action`
is not "POP".
* Drop individual scrollTo calls
* Scroll to comments without reloading post
---------
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
The same code is reused for the "show context" button as for the "link
to self" button. I'm not sure that's such a good idea in the long run.
There was a const `parentCommentId` that was always set even when not
having the `showContext` prop, causing the bug #2401.