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

[#1682] Project HIFI #1753

Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
0dc5a48
Create custom Button component
jamessspanggg Apr 23, 2021
685d217
Create new Projects container with basic hero and move previous Proje…
jamessspanggg Apr 23, 2021
9031f0e
Add button animation when hover
jamessspanggg Apr 24, 2021
b4086dd
Add responsive Project Card and list of projects
jamessspanggg Apr 24, 2021
451f679
Define Project and Milestone apis and types
jamessspanggg Apr 24, 2021
551cb08
Change endpoint for project rules to accomodate project details page
jamessspanggg Apr 24, 2021
3ea72d1
Add ProjectCard hovered box shadow
jamessspanggg Apr 24, 2021
1408c45
Add iconLeft support in Button component
jamessspanggg Apr 24, 2021
74d1351
Implement project details page with temporary dummy data
jamessspanggg Apr 24, 2021
2051dcf
Hook up apis and implement scroll behavior of project details
jamessspanggg Apr 25, 2021
8554132
Improve scrolling behavior of project details based on figma design
jamessspanggg Apr 25, 2021
0bf0316
Update mobile nav projects link
jamessspanggg Apr 25, 2021
e1b75b8
Merge branch 'development' into 1682-projects-hifi
jamessspanggg May 1, 2021
e3a36bd
! Use new project icons
jamessspanggg May 1, 2021
efb9a67
! Fix project icons overwritting colors of one another
jamessspanggg May 1, 2021
1f0de4d
! Modify projects page to use latest font system
jamessspanggg May 1, 2021
c247620
! Fix colouring of integration icon
jamessspanggg May 1, 2021
76926d5
! Fix project icons not being masked properly
jamessspanggg May 1, 2021
1f492eb
! Update projects hifi page based on latest updated design
jamessspanggg May 1, 2021
4f1467c
! Change usage of gap as safari does not support, refactor all z-inde…
jamessspanggg May 1, 2021
8c6afa5
! Add formatted date support with fecha package
jamessspanggg May 2, 2021
1efee62
UI fixes based on testing done for mobile safari and chrome
jamessspanggg May 2, 2021
66e5cc9
Take into account multiline content as well as content with links
jamessspanggg May 2, 2021
7dee94c
Merge branch 'development' into 1682-projects-hifi
jamessspanggg May 2, 2021
48f5947
Remove handle of multiline description in project card
jamessspanggg May 2, 2021
a4dd082
Center project lead title for mobile views
jamessspanggg May 2, 2021
e6f7d9f
Simplify project lead container to span
jamessspanggg May 2, 2021
a87f3b9
remove strings.tsx
angle943 May 2, 2021
5f15547
remove linkifyjs
angle943 May 2, 2021
4d74e07
remove fecha
angle943 May 2, 2021
c5b76ea
PaginatedResponse
angle943 May 3, 2021
e359631
Remove milestone related api as milestone is nested within the projec…
jamessspanggg May 3, 2021
b6b6deb
lint errors
angle943 May 4, 2021
000771c
transparent project details header
angle943 May 4, 2021
3e2dc0e
Make list of project cards more responsive
jamessspanggg May 9, 2021
85007c9
Merge branch '1682-projects-hifi' of github.com:jamessspanggg/Website…
jamessspanggg May 9, 2021
7636d27
Merge branch 'development' into 1682-projects-hifi
jamessspanggg May 13, 2021
542e99b
Merge branch 'development' into 1682-projects-hifi
angle943 May 20, 2021
836a583
fix merge conflicts
angle943 May 20, 2021
cfa604a
z-index
angle943 May 20, 2021
4757e7e
ProjectIcons
angle943 May 20, 2021
3eafb40
update annoying caniuse error
angle943 May 20, 2021
3971b0c
a couple changes
angle943 May 23, 2021
2a603f5
stashing changes - going to update button
angle943 May 24, 2021
62bd387
Merge branch 'development' into 1682-projects-hifi
angle943 May 24, 2021
9582a7c
make Button into one component
angle943 May 25, 2021
5175904
minor change to ProjectMilestones.scss
angle943 May 25, 2021
2fa96af
override css for button
angle943 May 25, 2021
18e1f9b
minor css changes
angle943 May 25, 2021
e432472
ProjectDetailsHeader
angle943 May 25, 2021
b18aecb
some directory changes
angle943 May 25, 2021
f550395
minor change
angle943 May 25, 2021
a0c186a
minor change on ListOfProjects
angle943 May 25, 2021
d54634b
minor edit to ProjectDetailsTopic
angle943 May 25, 2021
98c6182
remove eslint-disable
angle943 May 25, 2021
ef2f9d4
ProjectDetailsSideMenu
angle943 May 25, 2021
31da1fb
ProjectDetailsSideMenu.scss
angle943 May 25, 2021
579dba8
projectLeadDisplayName
angle943 May 27, 2021
4786e2d
correct position of the side menu
angle943 May 27, 2021
70cf3e2
dynamic side menu (when you scroll, it highlights correct one)
angle943 May 29, 2021
54da3e3
fix the leftMenu bug
angle943 May 29, 2021
d654118
making a couple minor adjustments
angle943 May 29, 2021
6197985
Remove hover effect for touch screen devices
jamessspanggg May 29, 2021
3bd8138
Project card css fix and tidy up css
jamessspanggg May 29, 2021
5417664
Merge branch 'development' into 1682-projects-hifi
jamessspanggg May 29, 2021
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
59 changes: 59 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
"axios": "^0.21.1",
"clsx": "^1.1.1",
"date-fns": "^2.16.1",
"fecha": "^4.2.1",
"formik": "^2.2.2",
"leaflet": "^1.7.1",
"linkifyjs": "^2.1.9",
"lodash-es": "^4.17.15",
"mdi-react": "^7.3.0",
"normalize.css": "^8.0.1",
Expand Down Expand Up @@ -72,6 +74,7 @@
},
"devDependencies": {
"@types/leaflet": "^1.5.19",
"@types/linkifyjs": "^2.1.3",
"@types/lodash-es": "^4.17.3",
"@types/qrcode": "^1.3.5",
"@types/react-copy-to-clipboard": "^4.3.0",
Expand Down
39 changes: 39 additions & 0 deletions src/apis/projects/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import axios from 'axios';

import {APIArrayResponse} from 'types/api';
import {Project, Milestone} from 'types/projects';

export async function getProjects(): Promise<Project[]> {
const response = await axios.get<APIArrayResponse<Project>>(`${process.env.REACT_APP_BACKEND_API}/projects`);

if (!response.data) {
throw new Error('Error while fetching projects, please try again.');
}
return response.data.results;
}

export async function getMilestones(): Promise<Milestone[]> {
const response = await axios.get<APIArrayResponse<Milestone>>(`${process.env.REACT_APP_BACKEND_API}/milestones`);
if (!response.data) {
throw new Error('Error while fetching milestones, please try again.');
}
return response.data.results;
}

export async function getMilestonesByProject(id: string): Promise<Milestone[]> {
const response = await axios.get<APIArrayResponse<Milestone>>(
`${process.env.REACT_APP_BACKEND_API}/milestones?project=${id}`,
jamessspanggg marked this conversation as resolved.
Show resolved Hide resolved
);
if (!response.data) {
throw new Error('Error while fetching milestones, please try again.');
}
return response.data.results;
}

export async function getProjectMemberById(id: string) {
const response = await axios.get(`${process.env.REACT_APP_BACKEND_API}/project_members/${id}`);
if (!response.data) {
throw new Error('Error while fetching project member, please try again.');
}
return response.data;
}
1 change: 1 addition & 0 deletions src/apis/projects/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * as api from './api';
9 changes: 9 additions & 0 deletions src/apis/users/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import axios from 'axios';

import {standardHeaders} from 'utils/requests';
import {User} from 'types/app/User';

export async function createUser({
display_name,
Expand All @@ -13,3 +14,11 @@ export async function createUser({
}) {
return axios.post(`${process.env.REACT_APP_BACKEND_API}/users`, {display_name, email, password}, standardHeaders());
}

export async function getUser({uuid}: {uuid: string}): Promise<User> {
const response = await axios.get<User>(`${process.env.REACT_APP_BACKEND_API}/users/${uuid}`);
if (!response.data) {
throw new Error('Error while fetching user. Please try again.');
}
return response.data;
}
4 changes: 3 additions & 1 deletion src/components/BreadcrumbMenu/BreadcrumbMenu.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import 'styles/z-index';

$navigation-bars-height: 100px; // TopNav.height + BreadcrumbMenu__bar.height

.BreadcrumbMenu {
Expand Down Expand Up @@ -31,7 +33,7 @@ $navigation-bars-height: 100px; // TopNav.height + BreadcrumbMenu__bar.height
right: 0;
top: $navigation-bars-height;
width: 100vw;
z-index: 2;
z-index: $z-index-breadcrumb;
}

&__navigation {
Expand Down
34 changes: 34 additions & 0 deletions src/components/Button/Button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.Button {
align-items: center;
display: inline-flex;
height: 40px;
outline: none;

&__empty {
background-color: var(--color-white);
border: 1px solid var(--color-white);
color: var(--color-primary);
transition: 0.2s;

&:hover {
background-color: var(--color-blue-50);
border: 1px solid var(--color-gray-200);
}
}

&__outlined {
background-color: var(--color-white);
border: 1px solid var(--color-gray-200);
color: var(--color-primary);
}

&__primary {
background-color: var(--color-primary);
border: none;
color: var(--color-white);
}

&--rounded {
border-radius: 100px;
}
}
26 changes: 26 additions & 0 deletions src/components/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React, {FC} from 'react';

import clsx from 'clsx';

import './Button.scss';

type Props = {
className?: string;
iconLeft?: React.ReactNode;
iconRight?: React.ReactNode;
onClick: (event: React.SyntheticEvent<HTMLButtonElement>) => void;
rounded?: boolean;
type?: 'primary' | 'outlined' | 'empty';
};

const Button: FC<Props> = ({children, className, iconLeft, iconRight, onClick, rounded = false, type = 'primary'}) => {
return (
<button className={clsx('Button', `Button__${type}`, {'Button--rounded': rounded}, className)} onClick={onClick}>
{iconLeft && <div className="Button__icon-left">{iconLeft}</div>}
{children}
{iconRight && <div className="Button__icon-right">{iconRight}</div>}
</button>
);
};

export default Button;
2 changes: 1 addition & 1 deletion src/components/FormElements/Button/Button.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.Button {
.FormButton {
$self: &;
border-radius: 3px;
border-style: solid;
Expand Down
4 changes: 2 additions & 2 deletions src/components/FormElements/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const Button: FC<BaseButtonProps> = ({

return (
<button
className={clsx('Button', `Button--${variant}`, `Button--${color}`, className, {
'Button--disabled': disabled,
className={clsx('FormButton', `FormButton--${variant}`, `FormButton--${color}`, className, {
'FormButton--disabled': disabled,
...bemify(className, `--${variant}`),
...bemify(className, `--${color}`),
...bemify(className, '--disabled', disabled),
Expand Down
4 changes: 3 additions & 1 deletion src/components/GoToTop/GoToTop.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import 'styles/z-index';

@keyframes fadeIn {
from {
opacity: 0;
Expand All @@ -19,5 +21,5 @@
position: fixed;
right: 24px;
width: 36px;
z-index: 1000;
z-index: $z-index-go-to-top;
}
4 changes: 3 additions & 1 deletion src/components/Layout/Layout.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import 'styles/z-index';

$top-nav-height: 60px;
$footer-height: 348px;

Expand Down Expand Up @@ -30,6 +32,6 @@ $footer-height: 348px;
&__top-nav-wrapper {
position: sticky;
top: 0;
z-index: 1;
z-index: $z-index-layout;
}
}
4 changes: 3 additions & 1 deletion src/components/Modal/Modal.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import 'styles/z-index';

$modal-header-height: 48px;
$modal-header-height-mobile: 75px;
$modal-footer-height: 60px;
Expand Down Expand Up @@ -100,7 +102,7 @@ $break-mobile: 640px;
height: 100%;
position: fixed;
width: 100vw;
z-index: 20;
z-index: $z-index-modal;

&__close-icon {
left: 23px;
Expand Down
Loading