Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ORG-117] See restrictions in event page #94

Merged
merged 4 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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`;