Skip to content

Commit

Permalink
[ORG-117] See restrictions in event page (#94)
Browse files Browse the repository at this point in the history
* correct typo in login screen

* correct typo

* refactor in URLs

* Added more information in the event card
  • Loading branch information
carlotacb authored Jan 10, 2024
1 parent af8b989 commit 5c4ddb1
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 11 deletions.
28 changes: 27 additions & 1 deletion organizator/app/(tabs)/(home)/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ const BasicInfoContainer = styled.View`
gap: 20px;
`;

const RestrictionContainer = styled.View`
margin-top: 30px;
background-color: rgba(138, 159, 243, 0.2);
border: 2px solid rgb(138, 159, 243);
border-radius: 20px;
padding: 20px;
display: flex;
flex-direction: column;
gap: 20px;
`;

const TextLine = styled.View`
display: flex;
flex-direction: row;
Expand Down Expand Up @@ -531,7 +542,7 @@ export default function EventPage() {
}}
color="dimgray"
iconName="edit"
title="Open for participants to aply"
title="Open for participants to apply"
active={inputs.openForParticipants}
/>

Expand Down Expand Up @@ -587,6 +598,21 @@ export default function EventPage() {
</Text>
</TextLine>
</BasicInfoContainer>
<RestrictionContainer>
<TextLine>
<Text>
The minimum age to participate is: {events?.minAge}
</Text>
</TextLine>
<TextLine>
<Text>
The event is open for{" "}
{events?.onlyForStudents
? "only students"
: "everyone"}
</Text>
</TextLine>
</RestrictionContainer>
<ButtonsContainer>
{(isOrganizer || isOrganizerAdmin) && (
<Button
Expand Down
2 changes: 1 addition & 1 deletion organizator/app/(tabs)/(home)/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ export default function CreatePage() {
}}
color="dimgray"
iconName="edit"
title="Open for participants to aply"
title="Open for participants to apply"
active={inputs.openForParticipants}
/>

Expand Down
12 changes: 8 additions & 4 deletions organizator/app/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Button from "../components/ButtonWithIcon";
import { loginUser } from "../utils/api/axiosUsers";
import { LoginResponse } from "../utils/interfaces/Users";
import { getToken, storeToken } from "../utils/sessionCalls";
import FilterButton from "../components/FilterButtons";

const Container = styled(SafeAreaView)`
padding: 50px 40px;
Expand Down Expand Up @@ -173,11 +174,14 @@ export default function LoginPage() {
</Link>
</RegisterTextContainer>
<RegisterTextContainer>
<RegisterText>You don't to register now? </RegisterText>
<Link href="/" asChild>
<Pressable>
<RegisterButton>HomePage</RegisterButton>
</Pressable>
<FilterButton
title="Go to homepage"
onPress={() => {}}
iconName="home"
color="#040240"
active
/>
</Link>
</RegisterTextContainer>
</>
Expand Down
3 changes: 1 addition & 2 deletions organizator/utils/api/axiosApplications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import {
CreateNewApplicationResponse,
GetMyApplicationsResponse,
} from "../interfaces/Applications";

const applicationsAPI = "http://0.0.0.0:8000/organizator-api/applications";
import { applicationsAPI } from "./constants";

export async function createNewApplication(
eventId: string,
Expand Down
3 changes: 1 addition & 2 deletions organizator/utils/api/axiosEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import {
UpdateEventProps,
updateEventResponse,
} from "../interfaces/Events";

const eventsAPI = "http://0.0.0.0:8000/organizator-api/events";
import { eventsAPI } from "./constants";

export async function getAllUpcomingEvents(): Promise<getAllEventResponse> {
try {
Expand Down
2 changes: 1 addition & 1 deletion organizator/utils/api/axiosUsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
UpdateRoleResponse,
UserInformationResponse,
} from "../interfaces/Users";
import { usersAPI } from "./constants";

const usersAPI = "http://0.0.0.0:8000/organizator-api/users";
const baseImage =
"https://media.istockphoto.com/id/1087531642/vector/male-face-silhouette-or-icon-man-avatar-profile-unknown-or-anonymous-person-vector.jpg?s=612x612&w=0&k=20&c=FEppaMMfyIYV2HJ6Ty8tLmPL1GX6Tz9u9Y8SCRrkD-o%3D";

Expand Down
8 changes: 8 additions & 0 deletions organizator/utils/api/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const baseURLdevelopment = "http://0.0.0.0:8000/organizator-api";
// const baseURLproduction = "https://event-organizator-api-c6wz5mj4uq-ew.a.run.app/organizator-api";

const usingURL = baseURLdevelopment;

export const usersAPI = `${usingURL}/users`;
export const eventsAPI = `${usingURL}/events`;
export const applicationsAPI = `${usingURL}/applications`;

0 comments on commit 5c4ddb1

Please sign in to comment.