Skip to content

Commit

Permalink
fix: avatar or image
Browse files Browse the repository at this point in the history
  • Loading branch information
ialexanderbrito committed Apr 9, 2022
1 parent 1d7e20d commit dbcef1f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/CardBarbeiro/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function CardBarbeiro(props: CardBarbeiroProps) {
<>
<div className={styles.card} onClick={props.onClick} key={props.barbeiro?.id}>
<div className={styles.containerImg}>
{photo === '' && props.barbeiro?.avatar_url === null ? (
{photo === '' && (props.barbeiro?.avatar_url === null || props.barbeiro?.avatar_url === undefined) ? (
<Avvvatars value={props.barbeiro?.nome || ''} size={72} />
) : (
<img src={photo || props.barbeiro?.avatar_url || props.barbeiro?.picture} alt={props.barbeiro?.nome} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/CardBarbeiroSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function CardBarbeiroSelected(props: CardBarbeiroProps) {
<>
<div key={props.barbeiro?.id} className={styles.containerCard}>
<div className={styles.spacing}>
{photo === '' && props.barbeiro?.avatar_url === null ? (
{photo === '' && (props.barbeiro?.avatar_url === null || props.barbeiro?.avatar_url === undefined) ? (
<Avvvatars value={props.barbeiro?.nome || ''} size={38} />
) : (
<img
Expand Down
2 changes: 1 addition & 1 deletion src/components/CardCliente/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function CardCliente(props: CardClienteProps) {
<br />
</div>
<div className={styles.containerImg}>
{photo === '' && props.cliente?.client_avatar === undefined ? (
{photo === '' && (props.cliente?.client_avatar === null || props.cliente?.client_avatar === undefined) ? (
<Avvvatars value={props.cliente?.client_name || ''} size={50} />
) : (
<img
Expand Down
3 changes: 2 additions & 1 deletion src/components/DropdownMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export function DropdownMenu() {
>
<div className={styles.menu}>
<DropdownItem link="/profile">
{user?.user_metadata.avatar_url === undefined && photo === '' ? (
{photo === '' &&
(user?.user_metadata.avatar_url === null || user?.user_metadata.avatar_url === undefined) ? (
<div className={styles.imgProfile}>
<Avvvatars value={user?.user_metadata.name || ''} size={30} />
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Ticket/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export function Ticket(props: Props) {
<div className="ticket">
<div className="ticket-profile">
<div className="ticket-profile-top">
{photo === '' && props.cliente?.client_avatar === undefined ? (
{photo === '' &&
(props.cliente?.client_avatar === null || props.cliente?.client_avatar === undefined) ? (
<div className="ticket-profile-top-image">
<Avvvatars value={props.cliente?.client_name || ''} size={82} />
</div>
Expand Down

0 comments on commit dbcef1f

Please sign in to comment.