Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
907327b
.env.test*
venyustech May 28, 2022
1ecaf18
Update .gitignore
LeslyeSF May 28, 2022
088d551
feat: update
LeslyeSF May 28, 2022
376c675
Merge pull request #1 from top-drivent/TicketModality
venyustech May 28, 2022
52bcc27
feat: reserve orders online
venyustech May 30, 2022
4044da6
feat: reserve orders presential
venyustech May 30, 2022
b712bfe
chore: cleaning code
venyustech May 30, 2022
563d13f
Merge pull request #2 from top-drivent/feature/reserveOrders
Alan-A-Andrade Jun 1, 2022
5b6f300
feat: :sparkles: addded ticket info to payment form
neves-gabriel Jun 2, 2022
350153a
Merge pull request #3 from top-drivent/feat/payment
Alan-A-Andrade Jun 2, 2022
28c2137
feat: credit card form
Alan-A-Andrade Jun 3, 2022
ad0a4ba
Merge pull request #4 from top-drivent/feat/credit-card-form
Alan-A-Andrade Jun 4, 2022
1721540
feat: :sparkles: added Payment confirmation
neves-gabriel Jun 9, 2022
68b3d08
feat: hotel page
Alan-A-Andrade Jun 10, 2022
6ee8ba6
refactor: :zap: improved Paymente Confirmation
neves-gabriel Jun 10, 2022
ac84e25
Merge pull request #7 from top-drivent/feat-hotel
venyustech Jun 10, 2022
feb5e81
feat: select room
LeslyeSF Jun 11, 2022
502aac1
feat: select room
LeslyeSF Jun 11, 2022
b9df95c
fix: select room update
LeslyeSF Jun 11, 2022
e885323
Merge pull request #9 from top-drivent/feat/select-room
venyustech Jun 12, 2022
c46e9f6
chore: back to hotel choices by click on trocar hotel
venyustech Jun 12, 2022
ce7cacf
chore: add change hotel rental option and clean code
venyustech Jun 12, 2022
6e58590
Merge branch 'main' into feat/PaymentConf
neves-gabriel Jun 13, 2022
df69800
Merge pull request #10 from top-drivent/feat/changeHotel
LeslyeSF Jun 13, 2022
d7deaa5
fix: :bug: fixed conflicts in payment confirmation
neves-gabriel Jun 13, 2022
4d53160
Merge branch 'main' into feat/PaymentConf
neves-gabriel Jun 13, 2022
21c5b8b
fix: :ambulance: fixed bugs in payment confirmation
neves-gabriel Jun 13, 2022
8b5e661
Merge pull request #11 from top-drivent/feat/PaymentConf
LeslyeSF Jun 13, 2022
57824fd
feat: messages
LeslyeSF Jun 16, 2022
1edb0fe
Merge pull request #12 from top-drivent/feat/activities-message
venyustech Jun 16, 2022
40dd532
feat: activities page
Alan-A-Andrade Jun 17, 2022
11d8f71
Merge pull request #13 from top-drivent/feat-activities
neves-gabriel Jun 17, 2022
ae5a16d
feat: :sparkles: added tracks with timelines of activities
neves-gabriel Jun 19, 2022
b5690f9
feat: status of seats
venyustech Jun 20, 2022
85290f1
fix: get api by .env
venyustech Jun 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,841 changes: 102 additions & 1,739 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"qs": "^6.10.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-icons": "^4.2.0",
"react-icons": "^4.4.0",
"react-input-mask": "^2.0.4",
"react-loader-spinner": "^4.0.0",
"react-router-dom": "^6.3.0",
Expand Down
3 changes: 3 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
<title>Driven.t</title>
</head>
<body>
Expand Down
Binary file added src/assets/images/CreditCardMockUp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/checkVector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
217 changes: 217 additions & 0 deletions src/components/Activities/ActivitiesTracks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
import styled from 'styled-components';
import dayjs from 'dayjs';
import 'dayjs/locale/pt';
import { toast } from 'react-toastify';
import advancedFormat from 'dayjs/plugin/advancedFormat';
import localizedFormat from 'dayjs/plugin/localizedFormat';
import { useState } from 'react';
import { getSeats } from '../../services/activityApi';
import { TiDeleteOutline } from 'react-icons/ti';
import { CgEnter } from 'react-icons/cg';

export default function ActivitiesTracks({ showLabel, selectedDayActivities }) {
dayjs.extend(advancedFormat);
dayjs.extend(localizedFormat);
dayjs.locale('pt');

const handleNewUserActivity = (activity) => {
console.log('adicionar essa atividade: ', activity);
};

return (
<Container showLabel={showLabel}>
<Track>
<StyleLabel>Auditório Principal</StyleLabel>
<Timeline>
{selectedDayActivities?.map((el) =>
el.locationId === 1 ? (
<ActivityBox duration={dayjs(el.endTime).format('HH') - dayjs(el.startTime).format('HH')}>
<div style={{ width: '180px' }}>
<ActivityTitle>{el.name}</ActivityTitle>
<ActivityTimeSlot>
{dayjs(el.startTime).format('HH:00')} - {dayjs(el.endTime).format('HH:00')}
</ActivityTimeSlot>
</div>
<Divider />
<StatusWrapper>
<HandleSeats>{el}</HandleSeats>
</StatusWrapper>
</ActivityBox>
) : null
)}
</Timeline>
</Track>
<Track>
<StyleLabel>Auditório Lateral</StyleLabel>
<Timeline>
{selectedDayActivities?.map((el) =>
el.locationId === 2 ? (
<ActivityBox duration={dayjs(el.endTime).format('HH') - dayjs(el.startTime).format('HH')}>
<div style={{ width: '180px' }}>
<ActivityTitle>{el.name}</ActivityTitle>
<ActivityTimeSlot>
{dayjs(el.startTime).format('HH:00')} - {dayjs(el.endTime).format('HH:00')}
</ActivityTimeSlot>
</div>
<Divider />
<StatusWrapper>
<HandleSeats>{el}</HandleSeats>
</StatusWrapper>
</ActivityBox>
) : null
)}
</Timeline>
</Track>
<Track>
<StyleLabel>Sala de Workshop</StyleLabel>
<Timeline>
{selectedDayActivities?.map((el) =>
el.locationId === 3 ? (
<ActivityBox duration={dayjs(el.endTime).format('HH') - dayjs(el.startTime).format('HH')}>
<div style={{ width: '180px' }}>
<ActivityTitle>{el.name}</ActivityTitle>
<ActivityTimeSlot>
{dayjs(el.startTime).format('HH:00')} - {dayjs(el.endTime).format('HH:00')}
</ActivityTimeSlot>
</div>
<Divider />
<StatusWrapper>
<HandleSeats>{el}</HandleSeats>
</StatusWrapper>
</ActivityBox>
) : null
)}
</Timeline>
</Track>
</Container>
);

function HandleSeats({ children }) {
let body = {
activityId: children.id,
locationId: children.locationId
};
const [available, setAvailable] = useState(null);

const resposta = getSeats(body);
resposta.then((response) => {
setAvailable(response.data.length);
});
resposta.catch(error => toast('Falha ao carregar vagas disponiveis!'));

if (available === null) {
return <div>...</div>;
}
if (available === 0) {
return (
<span style={{ color: 'red' }}>
<div><TiDeleteOutline/></div>
<div><p>esgotado</p></div>
</span>
);
};
if (available === 1) {
return (
<span style={{ color: 'green' }} onClick={() => handleNewUserActivity(body)}>
<div><CgEnter/></div>
<div>{available} vaga</div>
</span>
);
};
if (available > 1) {
return (
<span style={{ color: 'green' }} onClick={() => handleNewUserActivity(body)}>
<div> <CgEnter /> </div>
<div><p>{available} vagas </p></div>
</span>
);
};
};
}

const Container = styled.div`
display: ${({ showLabel }) => (showLabel ? 'none' : 'flex')};
flex-direction: row;
`;

const Track = styled.div`
display: flex;
flex-direction: column;
width: 288px;
`;

const Timeline = styled.div`
display: flex;
flex-direction: column;
width: 288px;
height: 389.96px;
padding: 9.96px;
border: 1px solid #d7d7d7;
gap: 10px;
`;

const StyleLabel = styled.p`
font-family: 'Roboto', normal;
font-size: 17px;
font-weight: 400;
color: #8e8e8e;
text-align: center;
margin-bottom: 13px;
`;

const ActivityBox = styled.div`
display: flex;
align-items: center;
flex-direction: row;
width: 265px;
height: ${({ duration }) => `${duration * 80 + (duration - 1) * 0.5}px`};
background: #f1f1f1;
border-radius: 5px;
padding: 12px 10px 12px 10px;
`;

const ActivityTitle = styled.p`
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
font-size: 12px;
line-height: 14px;
color: #343434;
text-align: left;
`;

const ActivityTimeSlot = styled.p`
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-size: 12px;
line-height: 14px;
color: #343434;
text-align: left;
`;

const Divider = styled.div`
width: 0px;
height: 100%;
border: 1px solid #cfcfcf;
margin-left: 10px;
margin-right: 10px;
`;
const StatusWrapper = styled.div`
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
div{
width: 100%;
display: flex;
justify-content: center;
align-items: center;
p{
font-size:8px
}
svg{
font-size:24px ;
}
}
`;
86 changes: 86 additions & 0 deletions src/components/Activities/FormActivity.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import styled from 'styled-components';
import useActivity from '../../hooks/api/useActivity';
import dayjs from 'dayjs';
import 'dayjs/locale/pt';
import advancedFormat from 'dayjs/plugin/advancedFormat';
import localizedFormat from 'dayjs/plugin/localizedFormat';
import { useState } from 'react';
import ActivitiesTracks from './ActivitiesTracks';

export default function FormActivity() {
dayjs.extend(advancedFormat);
dayjs.extend(localizedFormat);
const { activities } = useActivity();
dayjs.locale('pt');
const activitiesDaysArray = activities?.map((el) => dayjs(el.date).format('dddd, DD/MM'));
const activitiesDays = [...new Set(activitiesDaysArray)];

const [dayOption, setDayOption] = useState('');
const [selectedDayActivities, setSelectedDayActivities] = useState([]);
const [showLabel, setShowLabel] = useState(true);

function handleDayOption(id, el) {
setDayOption(id);
setShowLabel(false);
setSelectedDayActivities(activities?.filter((element) => dayjs(element.date).format('dddd, DD/MM') === el));
}

return (
<Container>
<StyleLabel showLabel={showLabel}>Primeiro, filtre pelo dia do evento</StyleLabel>
<List>
{activitiesDays.map((el, id) => (
<DayButton onClick={() => handleDayOption(`button_${id}`, el)} id={`button_${id}`} state={dayOption}>
{el}
</DayButton>
))}
</List>
<ActivitiesTracks showLabel={showLabel} selectedDayActivities={selectedDayActivities} />
</Container>
);
}
const Container = styled.div`
padding: 0 0 30px 0;
display: flex;
flex-direction: column;
align-items: start;
gap: 37px;
`;

const List = styled.div`
width: 100%;

margin-bottom: 15px;

display: flex;
flex-direction: row;
align-items: start;
gap: 37px;
`;

const DayButton = styled.button`
all: unset;
width: 131px;
height: 37px;

background: ${({ id, state }) => (id === state ? '#FFD37D' : '#E0E0E0')};
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.25);
border-radius: 4px;

font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 16px;
text-align: center;

color: #000000;
`;

const StyleLabel = styled.p`
font-family: 'Roboto', sans-serif;
font-size: 20px;
font-weight: 400;
color: #8e8e8e;
display: ${({ showLabel }) => (showLabel ? 'block' : 'none')};
`;
40 changes: 40 additions & 0 deletions src/components/Activities/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import Message from '../Message';
import styled from 'styled-components';
import Typography from '@material-ui/core/Typography';
import useEnrollment from '../../hooks/api/useEnrollment';
import FormActivity from './FormActivity';

export default function ActivitiesPage() {
const { enrollment } = useEnrollment();

return (
<Container>
<StyledTypography variant="h4">Escolha de atividades</StyledTypography>
{enrollment?.payment ? (
enrollment.payment.ticketModality !== 'PRESENTIAL' ? (
<Message text="Sua modalidade de ingresso não necessita escolher atividade. Você terá acesso a todas as atividades." />
) : (
<FormActivity />
)
) : (
<Message text="Você precisa ter confirmado pagamento antes de fazer a escolha de atividades" />
)}
</Container>
);
}

const Container = styled.div`
width: 100%;
height: 100%;

padding: 0 0 50px 0;

display: flex;
flex-direction: column;
align-items: start;
gap: 37px;
`;

const StyledTypography = styled(Typography)`
margin-bottom: -10px !important;
`;
8 changes: 4 additions & 4 deletions src/components/Dashboard/NavigationBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,28 @@ export default function NavigationBar() {
</Link>

<Link to="/dashboard/payment">
<NavigationButton active={isActive('/dashboard/paymen')}>
<NavigationButton active={isActive('/dashboard/payment')}>
<FaMoneyBill />
<span>Pagamento</span>
</NavigationButton>
</Link>

<Link to="/dashboard/hotel">
<NavigationButton active={isActive('/dashboard/hote')}>
<NavigationButton active={isActive('/dashboard/hotel')}>
<FaBed />
<span>Hotel</span>
</NavigationButton>
</Link>

<Link to="/dashboard/activities">
<NavigationButton active={isActive('/dashboard/activitie')}>
<NavigationButton active={isActive('/dashboard/activities')}>
<FaCalendarWeek />
<span>Atividades</span>
</NavigationButton>
</Link>

<Link to="/dashboard/certificate">
<NavigationButton active={isActive('/dashboard/certificat')}>
<NavigationButton active={isActive('/dashboard/certificate')}>
<FaCertificate />
<span>Certificado</span>
</NavigationButton>
Expand Down
Loading