Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
981a6a7
created swAPI one person component, created request for https://swapi…
Jan 21, 2020
3897592
created swAPI one person component, created request for https://swapi…
Jan 21, 2020
c08e4fd
rendering names gotten from SWapi
Jan 21, 2020
795624c
added button "Next" and took out ComponentPersonData, removed extra i…
Jan 22, 2020
684faf4
correccted "+" page and "-" page
Jan 22, 2020
666b644
app not crushing if page is outnumbered
Jan 22, 2020
57afd90
rendering specific person data
Jan 22, 2020
8035580
open/close data of persons
Jan 22, 2020
b581051
numeration of each element
Jan 22, 2020
750c1df
created planet component, request for planets
Jan 23, 2020
b33a4b2
created planet component, request for planets
Jan 23, 2020
6741652
refactored Perrson component, created planet component, made api requ…
Jan 23, 2020
83a8605
corrected import (importing container)
Jan 23, 2020
58f8d75
starships collection request made, removed extra imports from Compone…
Jan 23, 2020
8471de4
added single planet data? api request for singlaPlanet data
Jan 24, 2020
4892e38
starships created one Starship component, single planet component was…
Jan 24, 2020
d1855b6
added pages for starships
Jan 24, 2020
8829fb0
renamed all new components (deleted "Component" word)
Jan 24, 2020
1a9796d
corrected input of css to scss
Jan 24, 2020
de043e3
installed styled components
Jan 24, 2020
4b6615e
created styled components for PersonComponent
Jan 24, 2020
62f2459
created styled components for PersonData.tsx with example inside
Jan 24, 2020
6a37851
created styled components for PersonData
Jan 24, 2020
2f72a23
created styled components for Planets
Jan 24, 2020
c87eded
created 3 more api methods for getPeople, getPlanets, getStarships, r…
Jan 24, 2020
e73a049
added styled-component to img tag, deleted App.scss
Jan 27, 2020
58e8bba
using const in app and aip requests
Jan 27, 2020
43dfa13
moved interaces from separate files into component files
Jan 27, 2020
dde05d4
removed button "get" from components and made useEffect for request w…
Jan 27, 2020
b9d26bd
installed spinner, added component Spinner.tsx
Jan 27, 2020
3da9424
added spiner to Person component wile loading
TrubetskaiaInna Jan 27, 2020
bdc9818
added spinner to change page of person
Jan 28, 2020
1313190
added same spinner to sertan element loading (person planet, or perso…
Jan 28, 2020
fb072a1
remover unnecessary element import
Jan 28, 2020
35d32cd
added spinner to Planets component
Jan 28, 2020
0a56dc9
added spinner to Starships component
Jan 28, 2020
d1fcfb6
added overlay for spinner, deleted extra console.logs, removed consol…
Jan 30, 2020
c2a1ecd
wrote separate reducer for spinner, connected it in Person component,
Jan 30, 2020
7c7774d
overlay for spinner, removed extra console.log
Jan 30, 2020
d676e88
made single spinned for all app. if making API request - there is spi…
Jan 30, 2020
f0d97e2
'Wellcome' text added
Jan 30, 2020
3d3aee2
made overflow hidea and spinner over whole screen, added some styles …
Jan 30, 2020
088a865
moved actions to separete file 'ui.ts', renamed actions from spinnerS…
Jan 31, 2020
e8a2e2d
moved all constants to there`s own folder and renamed types and const…
Jan 31, 2020
e89c8fe
created SingleStarshipData.tsx component, led to a common style all c…
Jan 31, 2020
4c7493a
all app is made in common style
Jan 31, 2020
b226761
added links to persons, starships in progress
Feb 3, 2020
414ef34
added links to planets
Feb 3, 2020
f8d1e1a
single Starship data component created and connected to app
Feb 3, 2020
6d942df
single style for all elements of app
Feb 3, 2020
e21a944
removed extra console.log from app
Feb 3, 2020
da506d7
preattier fix some files
Feb 3, 2020
6f06b19
small fix of starships link
Feb 3, 2020
26954ea
added googleMaps component to project
Feb 3, 2020
005af02
fixed height of map
Feb 3, 2020
02f2768
created marker element for map, added map actions and map redusers, c…
Feb 4, 2020
c0f60cf
created Mark component for maps
Feb 4, 2020
0cd11a9
added tooltips to GoogleMapsMark.tsx,
Feb 4, 2020
9527e81
added marker image, correct positioning for marker on map, tooltips a…
Feb 5, 2020
02fcc65
displaying lat and lng in mark tooltip
Feb 5, 2020
ebe08cc
prittier fix
Feb 5, 2020
ffa797c
added standard text when creating new point on google map, changed el…
Feb 5, 2020
d61755f
installed uuid for unique mapMarkId, created actions and redusers for…
Feb 5, 2020
088e141
created function to make element 'inFocus' to convert element from Ma…
Feb 5, 2020
206d953
marks transforming in to inputs and vice versa
Feb 5, 2020
45d3ef9
changed title of Marker in tooltips
Feb 5, 2020
950de54
small adition: added "Title" to mapMark title.
Feb 5, 2020
010fda5
renamed components in clear style
Feb 6, 2020
46cb76b
added delete mark button to tooltipCCard element
Feb 6, 2020
c835aa5
added delete mark button to tooltip Card element
Feb 6, 2020
37dc29a
small fix of map width
Feb 6, 2020
7b824a5
fixed errors in googleMapsMarkCard
Feb 6, 2020
53d86f2
fixed errors in googleMapsMarkCard
Feb 6, 2020
567fe75
added formik, 3 inputs with "title", "lng" and "lan" parameters, crea…
Feb 10, 2020
7b62ab2
in progress. added google maps const in form element
Feb 10, 2020
b3c193c
added edit button, deleted extra console.log
Feb 11, 2020
d925036
removed logotype from page
Feb 11, 2020
872d77b
removed unused elements
Feb 11, 2020
81afe32
shifted form fields, wrapped link with button, added button 'Ok' in e…
Feb 11, 2020
c9ff320
changing logic in creating new mark element (WIP), created new Mark e…
Feb 12, 2020
a4e47ac
new mark correct position done
Feb 12, 2020
6ba1023
zoom bug fixed (zoom and position of new mark is correct)
Feb 12, 2020
28a2f4e
deleted extra console.logs
Feb 12, 2020
db95d3d
title of mark saves correctly
Feb 12, 2020
19efd52
Editing mark Title done, edit mark position - in progress
Feb 12, 2020
4272332
edit mark position on previous one
Feb 13, 2020
b379c5a
editing mark position and title done, removed trash(console.log and /…
Feb 13, 2020
1754a08
redirect after create new Mark
Feb 13, 2020
ff42506
filling input field with initial data when editing Mark
Feb 18, 2020
8b44de2
confirmation of title change and add title added, removed error in co…
Feb 18, 2020
d231281
confirm of mark delete
Feb 19, 2020
8110e27
prefilling input field for mark edition
Feb 19, 2020
006ac80
deleted some extra elements
Feb 19, 2020
ba402eb
deleted some extra elements
Feb 19, 2020
a486d06
deleted some extra elements
Feb 19, 2020
6f7a68f
deleted some extra elements, added go back after edition
Feb 19, 2020
f86656d
fix of title from array[0] element
Feb 19, 2020
878fd21
fix bug with "uncontrolled input"
Feb 19, 2020
2821624
fix bug with zoom sets default zoom on second click
Feb 19, 2020
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 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ yarn-error.log*

src/config/index.tsx
src/**/*.css

843 changes: 474 additions & 369 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,29 @@
},
"dependencies": {
"@testing-library/react": "^9.4.0",
"@types/google-map-react": "^1.1.4",
"@types/react-redux": "^7.1.6",
"@types/react-router": "^5.1.4",
"@types/react-router-dom": "^5.1.3",
"@types/styled-components": "^4.4.2",
"axios": "^0.19.1",
"formik": "^2.1.4",
"google-map-react": "^1.1.5",
"immutability-helper": "^3.0.1",
"node-sass": "^4.13.1",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-loading-overlay": "^1.0.1",
"react-redux": "^7.1.3",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-spinners": "^0.8.0",
"reactjs-popup": "^1.5.0",
"redux": "^4.0.5",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0"
"redux-thunk": "^2.3.0",
"styled-components": "^5.0.0",
"uuid": "^3.4.0"
},
"devDependencies": {
"@types/jest": "^24.9.0",
Expand Down
56 changes: 56 additions & 0 deletions src/actions/googleMap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { Dispatch } from "redux";
import {
CREATE_MAP_POINT,
DELETE_MAP_POINT,
CHANGE_GOOGLE_MAP_MARK_TEXT,
} from "../constants";

export function createMapPoint(
lat: number,
lng: number,
newPointText: string,
pointId: string,
) {
return (dispatch: Dispatch) => {
dispatch({
type: CREATE_MAP_POINT,
payload: {
lat,
lng,
newPointText,
pointId,
inFocus: false
}
});
};
}

export function changeGoogleMapMarkText(
pointId: string,
value: string,
lat: number,
lng: number
) {
return (dispatch: Dispatch) => {
dispatch({
type: CHANGE_GOOGLE_MAP_MARK_TEXT,
payload: {
pointId,
value,
lat,
lng
}
});
};
}

export function deleteMapPoint(pointId: string) {
return (dispatch: Dispatch) => {
dispatch({
type: DELETE_MAP_POINT,
payload: {
pointId
}
});
};
}
3 changes: 1 addition & 2 deletions src/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Dispatch } from "redux";

export const CHANGE_STATE_PROP = "_CHANGE_STATE_PROP";
import { CHANGE_STATE_PROP } from "../constants";

export function changeStateProp(prop: string, value: number, reducer: string) {
return (dispatch: Dispatch): void => {
Expand Down
12 changes: 5 additions & 7 deletions src/actions/main.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import { Dispatch } from "redux";

export const INCREMENT = 'INCREMENT'
export const DECREMENT = 'DECREMENT'
import { INCREMENT, DECREMENT } from "../constants";

export function increment() {
return (dispatch: Dispatch) => {
dispatch({
type: INCREMENT
})
}
});
};
}

export function decrement() {
return (dispatch: Dispatch) => {
dispatch({
type: DECREMENT
})
}
});
};
}
18 changes: 18 additions & 0 deletions src/actions/ui.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Dispatch } from "redux";
import { SHOW_LOADING, HIDE_LOADING } from "../constants";

export function showLoading() {
return (dispatch: Dispatch) => {
dispatch({
type: SHOW_LOADING
});
};
}

export function hideLoading() {
return (dispatch: Dispatch) => {
dispatch({
type: HIDE_LOADING
});
};
}
Binary file added src/assets/images/marker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 0 additions & 21 deletions src/components/App.css

This file was deleted.

28 changes: 0 additions & 28 deletions src/components/App.scss

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { App } from "./App";
it("renders without crashing", () => {
const div = document.createElement("div");
ReactDOM.render(
<App value={15} changeStateProp={() => {}} myCustomPropsFunc={() => {}} />,
<App value={15} changeStateProp={() => {}} myCustomPropsFunc={() => {}} isLoading={false}/>,
div
);
ReactDOM.unmountComponentAtNode(div);
Expand Down
169 changes: 101 additions & 68 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
// @ts-ignore
import React from "react";
// router
import { Route, Switch } from "react-router";
import { HashRouter, Link, RouteComponentProps } from "react-router-dom";
// components
import ComponentAContainer from "./ComponentsA/ComponentAContainer";
import ComponentBContainer from "./ComponentsB/ComponentBContainer";
// @ts-ignore
import logo from "../assets/images/logo.svg";
import "./App.css";
import { IProps } from "./AppInterfaces";
import PersonsContainer from "./Persons/PersonsContainer";
import PlanetsContainer from "./Planets/PlanetsContainer";
import StarshipsContainer from "./Starships/StarshipsContainer";
import GoogleMapsContainer from "./GoogleMaps/GoogleMapsContainer"
import GoogleMapsMarkFormContainer from "./GoogleMapsMarkForm/GoogleMapsMarkFormContainer"
import { AppElement, AppIntro } from "./AppElements";
import { Spinner } from "./Spinner/Spinner";
import { StyledLoader } from "./AppElements";

interface IProps {
isLoading: boolean | null;
value: number;
changeStateProp: (first: string, second: number, third: string) => void;
myCustomPropsFunc: any;
}

const NotFound = () => {
return (
<Route
// @ts-ignore
render={({ staticContext }: RouteComponentProps<string, any, string>) => {
if (staticContext) {
staticContext.status = 404;
Expand All @@ -31,68 +40,92 @@ const NotFound = () => {
export const App: React.FC<IProps> = props => {
return (
<HashRouter>
<div className="App">
<div className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h2>Welcome to React</h2>
</div>

<div>
<ul>
<li>
<Link to="/">AppContainer(Home)</Link>
</li>
<li>
<Link to="/componentA">ComponentAContainer</Link>
</li>
<li>
<Link to="/componentB">ComponentBContainer</Link>
</li>
</ul>
</div>
<StyledLoader
active={props.isLoading}
spinner={<Spinner />}
>
<AppElement>
<div>
<ul>
<li>
<Link to="/">AppContainer(Home)</Link>
</li>
<li>
<Link to="/componentA">ComponentAContainer</Link>
</li>
<li>
<Link to="/componentB">ComponentBContainer</Link>
</li>
<li>
<Link to="/person">Person</Link>
</li>
<li>
<Link to="/planet">Planet</Link>
</li>
<li>
<Link to="/starships">Starships</Link>
</li>
<li>
<Link to="/googleMaps">googleMaps</Link>
</li>
</ul>
</div>

<div>
<Switch>
<Route
exact
path="/"
render={() => {
return (
<div>
<h2>Welcome to App</h2>
<p className="App-intro">
<code>src/components/App.js</code>
</p>
<p>Value: {props.value}</p>
<p>
<button
onClick={() =>
props.changeStateProp("value", 0, "main")
}
>
Reset to "0"
</button>
</p>
</div>
);
}}
/>
<Route path="/componentA" component={ComponentAContainer} />
<Route
path="/componentB"
render={obj => {
return (
<ComponentBContainer
{...obj}
description="Value (custom description)"
/>
);
}}
/>
<Route component={NotFound} />
</Switch>
</div>
</div>
<div>
<Switch>
<Route
exact
path="/"
render={() => {
return (
<div>
<h2>Welcome to App</h2>
<AppIntro>
<code>src/components/App.js</code>
</AppIntro>
<p>Value: {props.value}</p>
<p>
<button
onClick={() =>
props.changeStateProp("value", 0, "main")
}
>
Reset to "0"
</button>
</p>
</div>
);
}}
/>
<Route
path="/componentB"
render={obj => {
return (
<ComponentBContainer
{...obj}
description="Value (custom description)"
/>
);
}}
/>
<Route path="/componentA" component={ComponentAContainer} />
<Route path="/person" component={PersonsContainer} />
<Route path="/planet" component={PlanetsContainer} />
<Route path="/starships" component={StarshipsContainer} />
<Route path="/googleMaps" component={GoogleMapsContainer} />
<Route path="/addGoogleMapMark" component={GoogleMapsMarkFormContainer} />
<Route path="/editGoogleMapMark"
render={(props: any) => {
return(
<GoogleMapsMarkFormContainer {...props.location.state}/>
)
}}
/>
<Route component={NotFound} />
</Switch>
</div>
</AppElement>
</StyledLoader>
</HashRouter>
);
};
Expand Down
Loading