Skip to content

Commit

Permalink
feat(ui): add emby user badge to the userProfile
Browse files Browse the repository at this point in the history
adds emby user badge to the userProfile general page
  • Loading branch information
Fallenbagel committed May 29, 2022
1 parent 722dda5 commit b9546e6
Showing 1 changed file with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { defineMessages, useIntl } from 'react-intl';
import { useToasts } from 'react-toast-notifications';
import useSWR from 'swr';
import * as Yup from 'yup';
import { MediaServerType } from '../../../../../server/constants/server';
import { UserSettingsGeneralResponse } from '../../../../../server/interfaces/api/userSettingsInterfaces';
import {
availableLanguages,
Expand All @@ -25,6 +24,7 @@ import PageTitle from '../../../Common/PageTitle';
import LanguageSelector from '../../../LanguageSelector';
import QuotaSelector from '../../../QuotaSelector';
import RegionSelector from '../../../RegionSelector';
import getConfig from 'next/config';

const messages = defineMessages({
general: 'General',
Expand Down Expand Up @@ -59,7 +59,7 @@ const messages = defineMessages({

const UserGeneralSettings: React.FC = () => {
const intl = useIntl();
const settings = useSettings();
const { publicRuntimeConfig } = getConfig();
const { addToast } = useToasts();
const { locale, setLocale } = useLocale();
const [movieQuotaEnabled, setMovieQuotaEnabled] = useState(false);
Expand Down Expand Up @@ -189,19 +189,25 @@ const UserGeneralSettings: React.FC = () => {
<div className="flex max-w-lg items-center">
{user?.userType === UserType.PLEX ? (
<Badge badgeType="warning">
{intl.formatMessage(messages.plexuser)}
</Badge>
) : user?.userType === UserType.LOCAL ? (
<Badge badgeType="default">
{intl.formatMessage(messages.localuser)}
</Badge>
) : (
) : publicRuntimeConfig.JELLYFIN_TYPE == 'emby' ? (
<Badge badgeType="success">
{intl.formatMessage(messages.mediaServerUser, {
mediaServerName: 'Emby',
})}
</Badge>
) : user?.userType === UserType.JELLYFIN ? (
<Badge badgeType="default">
{intl.formatMessage(messages.mediaServerUser, {
mediaServerName:
settings.currentSettings.mediaServerType ===
MediaServerType.PLEX
? 'Plex'
: 'Jellyfin',
mediaServerName: 'Jellyfin',
})}
</Badge>
)}
) : null}
</div>
</div>
</div>
Expand Down

0 comments on commit b9546e6

Please sign in to comment.