mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 20:31:13 +00:00
Fixing an issue with browser theme.
This commit is contained in:
parent
397db2f1db
commit
dcb52b5c47
1 changed files with 12 additions and 12 deletions
|
@ -9,33 +9,33 @@ interface Props {
|
||||||
export class Theme extends Component<Props> {
|
export class Theme extends Component<Props> {
|
||||||
render() {
|
render() {
|
||||||
const { user } = this.props;
|
const { user } = this.props;
|
||||||
const userTheme = user && user.theme && (
|
const hasUserTheme = user && user.theme !== 'browser';
|
||||||
<link
|
|
||||||
rel="stylesheet"
|
|
||||||
type="text/css"
|
|
||||||
href={`/static/assets/css/themes/${user.theme}.min.css`}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Helmet>
|
<Helmet>
|
||||||
{userTheme ?? (
|
{hasUserTheme ? (
|
||||||
<>
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
type="text/css"
|
||||||
|
href={`/static/assets/css/themes/${user.theme}.min.css`}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
[
|
||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
type="text/css"
|
type="text/css"
|
||||||
href="/static/assets/css/themes/litely.min.css"
|
href="/static/assets/css/themes/litely.min.css"
|
||||||
id="default-light"
|
id="default-light"
|
||||||
media="(prefers-color-scheme: light)"
|
media="(prefers-color-scheme: light)"
|
||||||
/>
|
/>,
|
||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
type="text/css"
|
type="text/css"
|
||||||
href="/static/assets/css/themes/darkly.min.css"
|
href="/static/assets/css/themes/darkly.min.css"
|
||||||
id="default-dark"
|
id="default-dark"
|
||||||
media="(prefers-color-scheme: no-preference), (prefers-color-scheme: dark)"
|
media="(prefers-color-scheme: no-preference), (prefers-color-scheme: dark)"
|
||||||
/>
|
/>,
|
||||||
</>
|
]
|
||||||
)}
|
)}
|
||||||
</Helmet>
|
</Helmet>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue