
* resolved typescript problems for success.tsx, useTheme.tsx and event.ts * remove NextRouter inferred type Co-authored-by: Alex Johansson <alexander@n1s.se> * remove router query inferred type Co-authored-by: Alex Johansson <alexander@n1s.se> * URIcomponent change ternary Co-authored-by: Alex Johansson <alexander@n1s.se> * infer types for event type * completed requested changes * Update pages/success.tsx | change context type to proper Co-authored-by: Alex Johansson <alexander@n1s.se> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: Alex Johansson <alexander@n1s.se> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Bailey Pumfleet <pumfleet@hey.com>
8 lines
337 B
TypeScript
8 lines
337 B
TypeScript
export function getEventName(
|
|
name: string | string[] | undefined,
|
|
eventTitle: string,
|
|
eventNameTemplate: string | null
|
|
) {
|
|
if (!name || !(typeof name === "string")) name = ""; // If name is not set or is not of proper type
|
|
return eventNameTemplate ? eventNameTemplate.replace("{USER}", name) : eventTitle + " with " + name;
|
|
}
|