Skip to content

Commit ab70552

Browse files
committed
fix: refactor click handlers and improve styling for contact details
1 parent 8b20840 commit ab70552

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/renderer/src/components/Modules/NethVoice/SearchResults/SearchNumberDetail.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,24 @@ export function SearchNumberDetail({ contactDetail, onBack }: SearchNumberBoxPro
3838
<ModuleTitle
3939
title={
4040
<div
41-
className={`flex gap-1 pt-[10px] pl-1 pr-8 pb-[10px] items-center cursor-pointer`}
42-
onClick={() => {
43-
debouncer('onDetailBack', () => {
44-
onBack()
45-
}, 250)
46-
}}
41+
className={`flex gap-1 pt-[10px] pl-1 pr-8 pb-[10px] items-center `}
42+
4743
>
4844
<FontAwesomeIcon
49-
className="text-base dark:text-gray-50 text-gray-600 mr-1"
45+
className="text-base dark:text-gray-50 text-gray-600 mr-1 p-1 cursor-pointer"
5046
icon={BackIcon}
47+
onClick={() => {
48+
debouncer('onDetailBack', () => {
49+
onBack()
50+
}, 250)
51+
}}
5152
/>
5253
<p className="font-normal">
5354
{contact?.displayName}
5455
</p>
5556
</div>
5657
}
58+
5759
/>
5860
<div className='pl-6 pt-6 w-full h-full'>
5961
<Scrollable>
@@ -88,7 +90,7 @@ const ContactVisibility = ({ isPublic }: { isPublic: boolean }) => {
8890
<div className='w-full'>
8991
<div className='px-3 py-0.5 w-fit justify-start bg-bgEmerald rounded-full flex flex-row gap-1 items-center dark:text-titleDark text-titleLight'>
9092
<FontAwesomeIcon
91-
className="text-base dark:text-titleDark text-titleLight"
93+
className="text-base dark:text-titleDark text-titleLight w-5"
9294
icon={PublicIcon}
9395
/>
9496
{isPublic ? t("Phonebook.Public") : t("Phonebook.Only me")}
@@ -129,13 +131,13 @@ const ContactDetail = ({ children, label, icon, copy, protocol }: { label: strin
129131
return <div className='flex flex-row w-full justify-start'>
130132
<div className='flex flex-row gap-2 items-center min-w-[170px] '>
131133
<FontAwesomeIcon
132-
className="text-base dark:text-titleDark text-titleLight"
134+
className="text-base dark:text-titleDark text-titleLight w-5"
133135
icon={icon}
134136
/>
135137
{label}
136138
</div>
137139
<div className='relative flex flex-row truncate max-w-[calc(100%-170px)] gap-2'>
138-
<span className={classNames('truncate', protocol
140+
<span className={classNames('truncate', protocol && children
139141
? linkClassName
140142
: '',
141143
protocol === 'callto'
@@ -149,7 +151,7 @@ const ContactDetail = ({ children, label, icon, copy, protocol }: { label: strin
149151
data-tooltip-content={children}
150152
data-tooltip-place={'bottom'}
151153
>
152-
{children}
154+
{children || '-'}
153155
</span>
154156

155157
{children && copy && <div className='relative'>
@@ -160,7 +162,7 @@ const ContactDetail = ({ children, label, icon, copy, protocol }: { label: strin
160162
data-tooltip-id={`tooltip-copy-${label}`}
161163
data-tooltip-content={t('Common.Copy')}
162164
/>
163-
<div className='absolute left-1/2 top-0 z-0 w-0 h-full bg-red-500/50 visible'
165+
<div className='absolute left-1/2 top-0 z-0 w-0 h-full visible'
164166
data-tooltip-id={`tooltip-copied-${label}`}
165167
data-tooltip-content={t('Common.Copied')}
166168
/>

0 commit comments

Comments
 (0)