Skip to content

Commit

Permalink
fix: react fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
ialexanderbrito committed May 23, 2022
1 parent 7ecff67 commit a85e33f
Show file tree
Hide file tree
Showing 14 changed files with 771 additions and 808 deletions.
38 changes: 18 additions & 20 deletions src/components/Agenda/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,26 @@ import styles from './Agenda.module.scss';
export function Agenda() {
const { handleGoogleCalendarCliente, enventSaveBarbeiro } = useAgenda();
return (
<>
<div className={styles.wrapper}>
<h2>Adicionar ao seu calendário</h2>
<div className={styles.wrapper}>
<h2>Adicionar ao seu calendário</h2>

<div className={styles.containerButton}>
<button
className={styles.google}
type="button"
onClick={() => {
handleGoogleCalendarCliente();
}}
>
<SiGooglecalendar />
Adicionar ao Google Calendar
</button>
<div className={styles.containerButton}>
<button
className={styles.google}
type="button"
onClick={() => {
handleGoogleCalendarCliente();
}}
>
<SiGooglecalendar />
Adicionar ao Google Calendar
</button>

<button className={styles.apple} type="button">
<SiApple />
<ICalendarLink event={enventSaveBarbeiro}>Adicionar ao Apple Calendar</ICalendarLink>
</button>
</div>
<button className={styles.apple} type="button">
<SiApple />
<ICalendarLink event={enventSaveBarbeiro}>Adicionar ao Apple Calendar</ICalendarLink>
</button>
</div>
</>
</div>
);
}
32 changes: 15 additions & 17 deletions src/components/CardBarbeiroSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,21 @@ export function CardBarbeiroSelected(props: CardBarbeiroProps) {
}, [props.barbeiro]);

return (
<>
<div key={props.barbeiro?.id} className={styles.containerCard}>
<div className={styles.spacing}>
{photo === '' && (props.barbeiro?.avatar_url === null || props.barbeiro?.avatar_url === undefined) ? (
<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 key={props.barbeiro?.id} className={styles.containerCard}>
<div className={styles.spacing}>
{photo === '' && (props.barbeiro?.avatar_url === null || props.barbeiro?.avatar_url === undefined) ? (
<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>
);
}
12 changes: 5 additions & 7 deletions src/components/Dropzone/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ const Dropzone: React.FC<DropzoneProps> = ({ onFileUploaded }) => {
<div className={styles.profile}>
<p>
{user?.user_metadata.picture || user?.user_metadata.avatar_url ? (
<>
<img
src={user?.user_metadata.picture || user?.user_metadata.avatar_url}
alt="Perfil"
className={styles.preview}
/>
</>
<img
src={user?.user_metadata.picture || user?.user_metadata.avatar_url}
alt="Perfil"
className={styles.preview}
/>
) : (
<Avvvatars value={user?.user_metadata.name || ''} size={160} />
)}
Expand Down
46 changes: 22 additions & 24 deletions src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,27 @@ export function Navbar(props: NavBarProps) {

const navigate = useNavigate();
return (
<>
<nav className={styles.navbar}>
{props.back && (
<IoArrowBackOutline
size={24}
className={styles.icon}
onClick={() => {
navigate('/');
}}
/>
)}
{props.logo && (
<img
src={theme === 'light' ? logoDark : logo}
alt="Logo"
className={styles.logo}
onClick={() => {
navigate('/');
}}
/>
)}
<ul className={styles.navbarNav}>{props.children}</ul>
</nav>
</>
<nav className={styles.navbar}>
{props.back && (
<IoArrowBackOutline
size={24}
className={styles.icon}
onClick={() => {
navigate('/');
}}
/>
)}
{props.logo && (
<img
src={theme === 'light' ? logoDark : logo}
alt="Logo"
className={styles.logo}
onClick={() => {
navigate('/');
}}
/>
)}
<ul className={styles.navbarNav}>{props.children}</ul>
</nav>
);
}
106 changes: 51 additions & 55 deletions src/components/Overlay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,67 +14,63 @@ export function Overlay(props: OverlayProps) {
const { handleGoogleCalendar, eventSaveCliente } = useOverlay();

return (
<>
<div className={styles.overlay}>
<div className={styles.containerOverlay}>
{props.children}
<h1>{props.title}</h1>
<p>{props.description}</p>
<div className={styles.overlay}>
<div className={styles.containerOverlay}>
{props.children}
<h1>{props.title}</h1>
<p>{props.description}</p>

{props.calendar && (
<>
{isAndroid && (
<>
<button
className={styles.google}
type="button"
onClick={() => {
handleGoogleCalendar();
}}
>
<SiGooglecalendar />
Adicionar ao Google Calendar
</button>
</>
)}
{isIOS && (
{props.calendar && (
<>
{isAndroid && (
<button
className={styles.google}
type="button"
onClick={() => {
handleGoogleCalendar();
}}
>
<SiGooglecalendar />
Adicionar ao Google Calendar
</button>
)}
{isIOS && (
<button className={styles.apple} type="button">
<SiApple />
<ICalendarLink event={eventSaveCliente}>Adicionar ao Apple Calendar</ICalendarLink>
</button>
)}

{(isWindows || isMacOs) && (
<>
<button
className={styles.google}
type="button"
onClick={() => {
handleGoogleCalendar();
}}
>
<SiGooglecalendar />
Adicionar ao Google Calendar
</button>
<button className={styles.apple} type="button">
<SiApple />
<ICalendarLink event={eventSaveCliente}>Adicionar ao Apple Calendar</ICalendarLink>
</button>
)}

{(isWindows || isMacOs) && (
<>
<button
className={styles.google}
type="button"
onClick={() => {
handleGoogleCalendar();
}}
>
<SiGooglecalendar />
Adicionar ao Google Calendar
</button>
<button className={styles.apple} type="button">
<SiApple />
<ICalendarLink event={eventSaveCliente}>Adicionar ao Apple Calendar</ICalendarLink>
</button>
</>
)}
</>
)}
</>
)}
</>
)}

<Button
type="button"
onClick={() => {
window.location.replace('/');
}}
>
Ok
</Button>
</div>
<Button
type="button"
onClick={() => {
window.location.replace('/');
}}
>
Ok
</Button>
</div>
</>
</div>
);
}
Loading

0 comments on commit a85e33f

Please sign in to comment.