Skip to content

Commit

Permalink
Formatting and rename param
Browse files Browse the repository at this point in the history
  • Loading branch information
davidopluslau authored Jul 6, 2024
1 parent 23b3fb4 commit 1ae95fb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/buttons/eventUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ export const alternateEventBtnStr = 'Join as Alternate';
export const noDescProvided = 'No description provided.';

// Member List generators
const escapeMemberNameForDisplay = (input: string): string => input.replace(/[_*]/g, '\\$&');
const escapeMemberNameForDisplay = (input: memberName): string => memberName.replace(/[_*]/g, '\\$&');
export const generateMemberTitle = (memberList: Array<LFGMember>, maxMembers: number): string => `Members Joined: ${memberList.length}/${maxMembers}`;
export const generateMemberList = (memberList: Array<LFGMember>): string => memberList.length ? memberList.map((member) => `${escapeMemberNameForDisplay(member.name)} - <@${member.id}>`).join('\n') : noMembersStr;
export const generateMemberList = (memberList: Array<LFGMember>): string => memberList.length ? memberList.map((member) =>
`${escapeMemberNameForDisplay(member.name)} - <@${member.id}>`).join('\n') : noMembersStr;
export const generateAlternateList = (alternateList: Array<LFGMember>): string =>
alternateList.length ? alternateList.map((member) => `${escapeMemberNameForDisplay(member.name)} - <@${member.id}>${member.joined ? ' *' : ''}`).join('\n') : noMembersStr;
alternateList.length ? alternateList.map((member) =>
`${escapeMemberNameForDisplay(member.name)} - <@${member.id}>${member.joined ? ' *' : ''}`).join('\n') : noMembersStr;

// Fields for event creation and editing modals
export const eventTimeId = 'eventTime';
Expand Down

0 comments on commit 1ae95fb

Please sign in to comment.