Skip to content

Commit

Permalink
feat: Import youtube username from Oengus
Browse files Browse the repository at this point in the history
  • Loading branch information
cma2819 committed Aug 8, 2024
1 parent cd03021 commit 770bbf0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions bundles/admin/scheduleImport/scheduleImportCore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const ScheduleImportCore = ({ event, schedule }: Props) => {
twitter: runner.connections.find(conn => conn.platform === 'TWITTER')?.username,
twitch: runner.connections.find(conn => conn.platform === 'TWITCH')?.username,
nico: runner.connections.find(conn => conn.platform === 'NICO')?.username,
youtube: runner.connections.find(conn => (conn.platform as string) === 'YOUTUBE')?.username,
platform: 'TWITCH',
pronouns: runner.pronouns,
},
Expand Down
5 changes: 4 additions & 1 deletion bundles/admin/scheduleImport/scheduleImportTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@ type Props = {
export const ScheduleImportTable = ({ schedule }: Props) => {
const runHeaders = ['game', 'category', 'console', 'estimate', 'setup'] as const;

const runnerHeaders = ['name', 'twitter', 'nico', 'twitch', 'pronouns'] as const;
const runnerHeaders = ['name', 'twitter', 'nico', 'twitch', 'youtube', 'pronouns'] as const;

const connectionsToSocials = (
connections: OengusConnection[],
): {
twitter?: string;
nico?: string;
twitch?: string;
youtube?: string;
} => {
return {
twitter: connections.find(conn => conn.platform === 'TWITTER')?.username,
nico: connections.find(conn => conn.platform === 'NICO')?.username,
twitch: connections.find(conn => conn.platform === 'TWITCH')?.username,
youtube: connections.find(conn => conn.platform as string === 'YOUTUBE')?.username,
};
};

Expand Down Expand Up @@ -53,6 +55,7 @@ export const ScheduleImportTable = ({ schedule }: Props) => {
<td>{connectionsToSocials(runner.connections).twitter || ''}</td>
<td>{connectionsToSocials(runner.connections).nico || ''}</td>
<td>{connectionsToSocials(runner.connections).twitch || ''}</td>
<td>{connectionsToSocials(runner.connections).youtube || ''}</td>
<td>{runner.pronouns}</td>
</tr>
));
Expand Down

0 comments on commit 770bbf0

Please sign in to comment.