Skip to content

Commit

Permalink
fix(apps/phone): default avatar on url state
Browse files Browse the repository at this point in the history
  • Loading branch information
itschip committed Sep 24, 2023
1 parent 5595e23 commit 19b54a5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions apps/phone/src/apps/contacts/components/views/ContactInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { useMyPhoneNumber } from '@os/simcard/hooks/useMyPhoneNumber';
import useMessages from '../../../messages/hooks/useMessages';
import { useQueryParams } from '@common/hooks/useQueryParams';
import { NPWDButton, NPWDInput } from '@ui/components';
import { InputBase } from '@ui/components/Input';
import { ContactsDatabaseLimits } from '@typings/contact';
import { useContactsAPI } from '../../hooks/useContactsAPI';
import { SendMoneyModal } from '../../components/modals/SendMoney';
Expand Down Expand Up @@ -88,7 +87,9 @@ const ContactsInfoPage: React.FC = () => {

const [name, setName] = useState(contact?.display ?? '');
const [number, setNumber] = useState(contact?.number ?? '');
const [avatar, setAvatar] = useState(contact?.avatar ?? '');
const [avatar, setAvatar] = useState(
contact?.avatar ?? 'https://i.fivemanage.com/images/3ClWwmpwkFhL.png',
);
// Set state after checking if null

const [t] = useTranslation();
Expand Down Expand Up @@ -177,7 +178,11 @@ const ContactsInfoPage: React.FC = () => {
</button>
<div className="mx-auto w-9/12">
<div>
<img src={avatar} className="mx-auto h-24 w-24 rounded-full text-center" />
<img
src={avatar}
className="mx-auto h-24 w-24 rounded-full text-center"
alt="contact avatar"
/>
</div>
<div className="mt-8">
<div className="text-sm font-medium dark:text-neutral-400">{t('CONTACTS.FORM_NAME')}</div>
Expand Down

0 comments on commit 19b54a5

Please sign in to comment.