mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-10 02:15:11 +00:00
Merge branch 'main' into dm_fix
This commit is contained in:
commit
28dc62d44c
|
@ -81,6 +81,7 @@
|
|||
}
|
||||
|
||||
.vote-bar {
|
||||
min-width: 5ch;
|
||||
margin-top: -6.5px;
|
||||
}
|
||||
|
||||
|
|
|
@ -473,7 +473,7 @@ export class MarkdownTextArea extends Component<
|
|||
// Keybind handler
|
||||
// Keybinds inspired by github comment area
|
||||
handleKeyBinds(i: MarkdownTextArea, event: KeyboardEvent) {
|
||||
if (event.ctrlKey) {
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
switch (event.key) {
|
||||
case "k": {
|
||||
i.handleInsertLink(i, event);
|
||||
|
|
|
@ -174,7 +174,7 @@ export class VoteButtons extends Component<VoteButtonsProps, VoteButtonsState> {
|
|||
|
||||
render() {
|
||||
return (
|
||||
<div className="vote-bar pe-0 small text-center">
|
||||
<div className="vote-bar small text-center">
|
||||
<button
|
||||
type="button"
|
||||
className={`btn-animate btn btn-link p-0 ${
|
||||
|
@ -193,7 +193,7 @@ export class VoteButtons extends Component<VoteButtonsProps, VoteButtonsState> {
|
|||
</button>
|
||||
{showScores() ? (
|
||||
<div
|
||||
className="unselectable pointer text-muted px-1 post-score"
|
||||
className="unselectable pointer text-muted post-score"
|
||||
data-tippy-content={tippy(this.props.counts)}
|
||||
>
|
||||
{numToSI(this.props.counts.score)}
|
||||
|
|
|
@ -333,7 +333,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
|||
return (
|
||||
<button
|
||||
type="button"
|
||||
className="thumbnail rounded overflow-hidden d-inline-block position-relative p-0 border-0"
|
||||
className="thumbnail rounded overflow-hidden d-inline-block position-relative p-0 border-0 bg-transparent"
|
||||
data-tippy-content={I18NextService.i18n.t("expand_here")}
|
||||
onClick={linkEvent(this, this.handleImageExpandClick)}
|
||||
aria-label={I18NextService.i18n.t("expand_here")}
|
||||
|
|
|
@ -38,6 +38,7 @@ export class UserService {
|
|||
secure: isHttps(),
|
||||
domain: location.hostname,
|
||||
sameSite: true,
|
||||
path: "/",
|
||||
});
|
||||
this.#setJwtInfo();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import setDefaultOptions from "date-fns/setDefaultOptions";
|
||||
import { I18NextService } from "../../services";
|
||||
|
||||
const EN_US = "en-US";
|
||||
|
||||
export default async function () {
|
||||
let lang = I18NextService.i18n.language;
|
||||
if (lang === "en") {
|
||||
lang = "en-US";
|
||||
lang = EN_US;
|
||||
}
|
||||
|
||||
// if lang and country are the same, then date-fns expects only the lang
|
||||
|
@ -17,12 +19,26 @@ export default async function () {
|
|||
}
|
||||
}
|
||||
|
||||
const locale = (
|
||||
await import(
|
||||
/* webpackExclude: /\.js\.flow$/ */
|
||||
`date-fns/locale/${lang}`
|
||||
)
|
||||
).default;
|
||||
let locale;
|
||||
|
||||
try {
|
||||
locale = (
|
||||
await import(
|
||||
/* webpackExclude: /\.js\.flow$/ */
|
||||
`date-fns/locale/${lang}`
|
||||
)
|
||||
).default;
|
||||
} catch (e) {
|
||||
console.log(
|
||||
`Could not load locale ${lang} from date-fns, falling back to ${EN_US}`
|
||||
);
|
||||
locale = (
|
||||
await import(
|
||||
/* webpackExclude: /\.js\.flow$/ */
|
||||
`date-fns/locale/${EN_US}`
|
||||
)
|
||||
).default;
|
||||
}
|
||||
setDefaultOptions({
|
||||
locale,
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue