Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature updates aug #135

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions components/submission/showSubmissionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ const validationSchema = [
.shape({
name: Yup.string().required("Please add an artist name"),
image: Yup.object().required("Please add an artist image"),
email: Yup.string()
.required("Please add an email")
.email("Invalid email"),
})
),
}),
Expand Down Expand Up @@ -125,6 +128,7 @@ export default function ShowSubmissionForm({
{
name: "",
pronouns: "",
email: "",
bio: "",
image: "",
},
Expand Down
6 changes: 6 additions & 0 deletions components/submission/showSubmissionStep3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ export default function ShowSubmissionStep3({
type="text"
label="Pronouns"
/>
<InputField
name={`extraArtists.${index}.email`}
type="email"
label="Email"
required
/>
<TextareaField
name={`extraArtists.${index}.bio`}
rows={4}
Expand Down
10 changes: 3 additions & 7 deletions lib/resend/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ export async function sendEmail(artist, show, severity) {
from: "Refuge Worldwide <[email protected]>",
to: artist.email,
subject: subject(severity),
reply_to: [
"[email protected]",
"[email protected]",
"[email protected]",
],
reply_to: ["[email protected]", "[email protected]"],
react: ShowSubmissionEmail({
userName: artist.name,
showDateStart: show.date,
Expand Down Expand Up @@ -53,7 +49,6 @@ export async function sendConfirmationEmail(show) {
reply_to: [
"[email protected]",
"[email protected]",
"[email protected]",
],
react: ShowSubmissionEmail({
userName: artist.label,
Expand Down Expand Up @@ -93,7 +88,8 @@ export async function sendArtworkEmail(artist, date) {
reply_to: [
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
],
react: ShowArtworkEmail({
userName: artist.name,
Expand Down
3 changes: 3 additions & 0 deletions pages/api/show-submission-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ const addArtist = async (artist) => {
pronouns: {
"en-US": artist.pronouns,
},
email: {
"en-US": [artist.email],
},
role: {
"en-US": false,
},
Expand Down
1 change: 1 addition & 0 deletions types/shared.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ export type SubmissionFormValues = {
extraArtists?: Array<{
name: string;
pronouns: string;
email: string;
bio?: string;
image?: string;
}>;
Expand Down
8 changes: 4 additions & 4 deletions util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,18 @@ export const formatArtistNames = (data: ArtistInterface[]) => {
const names = data.map(({ name }) => name);

if (names.length === 1) {
return `With ${names[0]}`;
return `with ${names[0]}`;
}

if (names.length === 2) {
return `With ${names[0]} and ${names[1]}`;
return `with ${names[0]} and ${names[1]}`;
}

if (names.length === 3) {
return `With ${names.slice(0, 2).join(", ")} and ${names[3]}`;
return `with ${names.slice(0, 2).join(", ")} and ${names[3]}`;
}

return `With ${names.slice(0, 2).join(", ")} and others`;
return `with ${names.slice(0, 2).join(", ")} and others`;
};

export const getMixcloudKey = (url: string) =>
Expand Down
Loading