Skip to content

Commit

Permalink
refactor: add a Reply button with mailto link
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanL06 committed Oct 29, 2024
1 parent fec7aa2 commit ffe798c
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions components/modals/HelpRequestsModal.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from '@material-tailwind/react'
import Image from 'next/image'
import Link from 'next/link'
import React, { Fragment } from 'react'
Expand Down Expand Up @@ -34,7 +35,7 @@ const formatLabel = (label) => {
return label.replace(/([a-z])([A-Z])/g, '$1 $2')
}

const HelpRequestsModal = ({ helpRequestInfo, handleClose }) => {
const HelpRequestsModal = ({ helpRequestInfo, handleClose, mailtoLink }) => {
return (
<div className={style.modal_background} onClick={handleClose}>
<div className={style.modal_container}>
Expand All @@ -50,7 +51,7 @@ const HelpRequestsModal = ({ helpRequestInfo, handleClose }) => {
</div>
</div>

<div>
<div className="mb-8">
<form>
<div className={style.modal_form_container}>
{Object.entries(helpRequestInfo).map(([key, value], index) => (
Expand Down Expand Up @@ -81,7 +82,7 @@ const HelpRequestsModal = ({ helpRequestInfo, handleClose }) => {
</div>
) : key === 'email' ? (
<Link
href={`mailto:${value}`}
href={mailtoLink}
target="_blank"
className="underline">
{value}
Expand All @@ -95,6 +96,20 @@ const HelpRequestsModal = ({ helpRequestInfo, handleClose }) => {
</div>
</form>
</div>

<Link href={mailtoLink} target="_blank">
<Button
color="blue"
buttonType="filled"
size="regular"
rounded={false}
block={false}
iconOnly={false}
ripple="light"
className={style.modal_form_button}>
Reply
</Button>
</Link>
</div>
</div>
</div>
Expand Down

0 comments on commit ffe798c

Please sign in to comment.