Skip to content

Commit

Permalink
refactor: Update contact-dialog component layout and styling
Browse files Browse the repository at this point in the history
  • Loading branch information
emapeire committed May 21, 2024
1 parent 8626638 commit 5f79ea3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
27 changes: 22 additions & 5 deletions src/components/contact-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
import { CopyToClipboard } from './copy-to-clipboard'
import { ArrowUpRightIcon } from 'lucide-react'
import { data } from '@/constants'

export function ContactDialog() {
Expand All @@ -26,9 +27,9 @@ export function ContactDialog() {
Contact
</Button>
</DialogTrigger>
<DialogContent className='sm:max-w-md'>
<DialogContent className='sm:max-w-3xl'>
<DialogHeader>
<DialogTitle>Contact me</DialogTitle>
<DialogTitle className='text-xl'>Contact me</DialogTitle>
<DialogDescription>
Feel free to reach out to me through the following channels.
</DialogDescription>
Expand All @@ -37,10 +38,26 @@ export function ContactDialog() {
{data.contact.map((contact) => (
<div key={contact.label} className='flex items-end gap-4 pt-2'>
<div className='grid flex-1 gap-2'>
<Label htmlFor={contact.label} className='font-semibold'>
{contact.label}
<Label
htmlFor={contact.label}
className='font-semibold text-base font-mono pb-2'
>
<a
href={`${contact.prefix}${contact.value}`}
target='_blank'
rel='noopener noreferrer'
className='hover:underline hover:underline-offset-4 group inline-flex gap-1 items-center'
>
{contact.label}
<ArrowUpRightIcon className='size-4 text-neutral-500 dark:group-hover:text-neutral-100 group-hover:text-neutral-900' />
</a>
</Label>
<Input id={contact.label} defaultValue={contact.value} readOnly />
<Input
id={contact.label}
defaultValue={contact.value}
readOnly
className='font-mono'
/>
</div>
<CopyToClipboard url={contact.value} />
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ export const LINKS = [
export const CONTACT = [
{
label: 'Email',
prefix: 'mailto:',
value: '[email protected]'
},
{
label: 'WhatsApp',
prefix: 'https://wa.me/',
value: '+543417190449'
}
]
Expand Down
1 change: 1 addition & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface LinksProps {

export interface ContactProps {
label: string
prefix: string
value: string
}

Expand Down

0 comments on commit 5f79ea3

Please sign in to comment.