Skip to content

Commit

Permalink
fix: avvvvatars cards
Browse files Browse the repository at this point in the history
  • Loading branch information
ialexanderbrito committed Apr 9, 2022
1 parent be51047 commit 8afe4f2
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 27 deletions.
37 changes: 22 additions & 15 deletions src/components/CardBarbeiro/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect, useState } from 'react';
import { BsCalendar, BsClock } from 'react-icons/bs';

import Avvvatars from 'avvvatars-react';
import { CardBarbeiroProps } from 'types/IComponents';

import { getPhoto } from 'services/get/photo';
Expand Down Expand Up @@ -36,21 +37,27 @@ export function CardBarbeiro(props: CardBarbeiroProps) {
}, [props.barbeiro]);

return (
<div className={styles.card} onClick={props.onClick} key={props.barbeiro?.id}>
<div className={styles.containerImg}>
<img src={photo || props.barbeiro?.avatar_url || props.barbeiro?.picture} alt={props.barbeiro?.nome} />
<>
<div className={styles.card} onClick={props.onClick} key={props.barbeiro?.id}>
<div className={styles.containerImg}>
{photo === '' && props.barbeiro?.avatar_url === null ? (
<Avvvatars value={props.barbeiro?.nome || ''} size={72} />
) : (
<img src={photo || props.barbeiro?.avatar_url || props.barbeiro?.picture} alt={props.barbeiro?.nome} />
)}
</div>
<div className={styles.containerInfo}>
<h2 className={styles.title}>{name || props.barbeiro?.nome}</h2>
<strong className={styles.info}>
<BsCalendar color="#FF9000" size={16} style={{ marginRight: '12px' }} />
Segunda à Domingo
</strong>
<strong className={styles.info}>
<BsClock color="#FF9000" size={16} style={{ marginRight: '12px' }} />
8h às 22h
</strong>
</div>
</div>
<div className={styles.containerInfo}>
<h2 className={styles.title}>{name || props.barbeiro?.nome}</h2>
<strong className={styles.info}>
<BsCalendar color="#FF9000" size={16} style={{ marginRight: '12px' }} />
Segunda à Domingo
</strong>
<strong className={styles.info}>
<BsClock color="#FF9000" size={16} style={{ marginRight: '12px' }} />
8h às 22h
</strong>
</div>
</div>
</>
);
}
29 changes: 18 additions & 11 deletions src/components/CardBarbeiroSelect/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useEffect, useState } from 'react';

import Avvvatars from 'avvvatars-react';
import { CardBarbeiroProps } from 'types/IComponents';

import { getPhoto } from 'services/get/photo';
Expand Down Expand Up @@ -35,17 +36,23 @@ export function CardBarbeiroSelected(props: CardBarbeiroProps) {
}, [props.barbeiro]);

return (
<div key={props.barbeiro?.id} className={styles.containerCard}>
<div className={styles.spacing}>
<img
src={photo || props.barbeiro?.avatar_url || props.barbeiro?.picture}
alt={props.barbeiro?.nome}
className={styles.img}
/>
<>
<div key={props.barbeiro?.id} className={styles.containerCard}>
<div className={styles.spacing}>
{photo === '' && props.barbeiro?.avatar_url === null ? (
<Avvvatars value={props.barbeiro?.nome || ''} size={38} />
) : (
<img
src={photo || props.barbeiro?.avatar_url || props.barbeiro?.picture}
alt={props.barbeiro?.nome}
className={styles.img}
/>
)}
</div>
<div className={styles.textContainer}>
<h2 className={styles.textTitle}>{name || props.barbeiro?.nome}</h2>
</div>
</div>
<div className={styles.textContainer}>
<h2 className={styles.textTitle}>{name || props.barbeiro?.nome}</h2>
</div>
</div>
</>
);
}
2 changes: 1 addition & 1 deletion src/components/Dropzone/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const Dropzone: React.FC<DropzoneProps> = ({ onFileUploaded }) => {
/>
</>
) : (
<Avvvatars value={user?.user_metadata.name || ''} size={100} />
<Avvvatars value={user?.user_metadata.name || ''} size={160} />
)}
</p>
<div className={styles.upload}>
Expand Down

0 comments on commit 8afe4f2

Please sign in to comment.