Add an indicator of the google account on the front

This commit is contained in:
2023-06-23 00:58:39 +09:00
committed by GitBluub
parent 279d16d59a
commit ccc86895e2
3 changed files with 30 additions and 17 deletions

View File

@@ -151,6 +151,7 @@ export default class API {
name: (user.username ?? user.name) as string,
email: user.email as string,
premium: false,
googleID: user.googleID as string,
isGuest: user.isGuest as boolean,
data: {
gamesPlayed: user.partyPlayed as number,
@@ -232,16 +233,16 @@ export default class API {
// To be fixed with #168
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(song: any) =>
({
id: song.id as number,
name: song.name as string,
artistId: song.artistId as number,
albumId: song.albumId as number,
genreId: song.genreId as number,
details: song.difficulties,
cover: `${baseAPIUrl}/song/${song.id}/illustration`,
metrics: {},
} as Song)
({
id: song.id as number,
name: song.name as string,
artistId: song.artistId as number,
albumId: song.albumId as number,
genreId: song.genreId as number,
details: song.difficulties,
cover: `${baseAPIUrl}/song/${song.id}/illustration`,
metrics: {},
} as Song)
);
},
};
@@ -474,13 +475,13 @@ export default class API {
// To be fixed with #168
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(e: any) =>
({
id: e.id,
query: e.query,
type: e.type,
userId: e.userId,
timestamp: new Date(e.searchDate),
} as SearchHistory)
({
id: e.id,
query: e.query,
type: e.type,
userId: e.userId,
timestamp: new Date(e.searchDate),
} as SearchHistory)
)
),
};

View File

@@ -5,6 +5,7 @@ import UserSettings from './UserSettings';
interface User extends Model {
name: string;
email: string;
googleID: string;
isGuest: boolean;
premium: boolean;
data: UserData;

View File

@@ -87,6 +87,17 @@ const ProfileSettings = ({ navigation }: { navigation: any }) => {
text: user.id.toString(),
},
},
{
type: 'text',
title: 'Google Account',
data: {
text: user.googleID ? "Linked" : "Not linked"
},
// type: 'custom',
// data: user.googleID
// ? <Button><Text>Unlink</Text></Button>
// : <Button><Text>Link</Text></Button>,
},
{
type: 'text',
title: translate('nbGamesPlayed'),