diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..d5b9941 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,11 @@ +# Browsers that we support + +[production] +>0.2% +not dead +not op_mini all + +[development] +last 1 chrome version +last 1 firefox version +last 1 safari version diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +node_modules diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..2106f6b --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": [ + "react-app", + "react-app/jest" + ] +} diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..56bfee4 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v16.10.0 diff --git a/README.md b/README.md index b87cb00..aca58c1 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,40 @@ -# Getting Started with Create React App - -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). +# Getting Started with React Rampup ## Available Scripts In the project directory, you can run: -### `npm start` - -Runs the app in the development mode.\ -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. +### Install nvm -The page will reload if you make edits.\ -You will also see any lint errors in the console. +```nvm``` allows you to quickly install and use different versions of node via the command line. -### `npm test` +I really recommend you install node and npm using nvm. This is the fastest, cleanest and easiest way to do it. -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. +That way, you install NVM simply doing: -### `npm run build` +```curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash``` -Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. +To test that nvm was properly installed, close and re-open Terminal and enter nvm. If you get a nvm: command not found message, your OS may not have the necessary .bash_profile file. In Terminal, enter touch ~/.bash_profile and run the above install script again. -The build is minified and the filenames include the hashes.\ -Your app is ready to be deployed! +And you are now able to install node typing: -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. +```nvm install ``` -### `npm run eject` +For example -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** +```nvm install v16.10.0``` -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. +if you just want to install the latest node version, you can just type -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. +```nvm install node``` -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. +### `npm start` -## Learn More +Runs the app in the development mode.\ +Open [http://localhost:3000](http://localhost:3000) to view it in the browser. -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). +The page will reload if you make edits.\ +You will also see any lint errors in the console. -To learn React, check out the [React documentation](https://reactjs.org/). +### What about the features of this project? +In this I have worked on React/redux and Github API for a github profile viewer webapp in which we can follow the users. diff --git a/package-lock.json b/package-lock.json index 1b159be..5e917d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,6 @@ "name": "my-app", "version": "0.1.0", "dependencies": { - "@outkit/outkit": "^0.0.3", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^13.3.0", "@testing-library/user-event": "^13.5.0", @@ -3355,15 +3354,6 @@ "resolved": "https://registry.npmjs.org/@octokit/webhooks-types/-/webhooks-types-6.3.4.tgz", "integrity": "sha512-9E0HNgHqc5v22+9IzCSEZ9iXnBJ/n+GM9gZye0kp7XmzcOfrnAKZzd4km269n6/vVOkmXwT11DbbQFukWOvbdw==" }, - "node_modules/@outkit/outkit": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@outkit/outkit/-/outkit-0.0.3.tgz", - "integrity": "sha512-EIpBc3yQNKGhoalrO7i7k5mjVoyBTnu6d0pRFaFUYsDB4Btz+14GVSDV1tkxGMEy+xy8RoHhVTa1eIW+yh7xpw==", - "dependencies": { - "lodash.assign": "^4.2.0", - "request": "^2.85.0" - } - }, "node_modules/@pmmmwh/react-refresh-webpack-plugin": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.7.tgz", @@ -21646,15 +21636,7 @@ "version": "6.3.4", "resolved": "https://registry.npmjs.org/@octokit/webhooks-types/-/webhooks-types-6.3.4.tgz", "integrity": "sha512-9E0HNgHqc5v22+9IzCSEZ9iXnBJ/n+GM9gZye0kp7XmzcOfrnAKZzd4km269n6/vVOkmXwT11DbbQFukWOvbdw==" - }, - "@outkit/outkit": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@outkit/outkit/-/outkit-0.0.3.tgz", - "integrity": "sha512-EIpBc3yQNKGhoalrO7i7k5mjVoyBTnu6d0pRFaFUYsDB4Btz+14GVSDV1tkxGMEy+xy8RoHhVTa1eIW+yh7xpw==", - "requires": { - "lodash.assign": "^4.2.0", - "request": "^2.85.0" - } + } }, "@pmmmwh/react-refresh-webpack-plugin": { "version": "0.5.7", diff --git a/package.json b/package.json index 67672b9..5373896 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,6 @@ "version": "0.1.0", "private": true, "dependencies": { - "@outkit/outkit": "^0.0.3", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^13.3.0", "@testing-library/user-event": "^13.5.0", @@ -35,26 +34,5 @@ "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" - }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "devDependencies": { - "react-router-dom": "^6.3.0" } } diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index a11777c..0000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/icons8-github-192.png b/public/icons8-github-192.png new file mode 100644 index 0000000..7c20489 Binary files /dev/null and b/public/icons8-github-192.png differ diff --git a/public/icons8-github-32.png b/public/icons8-github-32.png new file mode 100644 index 0000000..598ea21 Binary files /dev/null and b/public/icons8-github-32.png differ diff --git a/public/index.html b/public/index.html index aa069f2..ffe212a 100644 --- a/public/index.html +++ b/public/index.html @@ -2,14 +2,14 @@ - + - + diff --git a/public/logo192.png b/public/logo192.png deleted file mode 100644 index fc44b0a..0000000 Binary files a/public/logo192.png and /dev/null differ diff --git a/public/logo512.png b/public/logo512.png deleted file mode 100644 index a4e47a6..0000000 Binary files a/public/logo512.png and /dev/null differ diff --git a/public/manifest.json b/public/manifest.json index 080d6c7..b9bd2ec 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -3,19 +3,14 @@ "name": "Create React App Sample", "icons": [ { - "src": "favicon.ico", + "src": "icons8-github-32.png", "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" + "type": "image/png" }, { - "src": "logo192.png", + "src": "icons8-github-192.png", "type": "image/png", "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" } ], "start_url": ".", diff --git a/src/App.tsx b/src/App.tsx index cd5b1fd..e2bdbaf 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,4 @@ -import './App.css'; +import React from 'react'; import store,{persistor} from "./store"; import { Provider } from "react-redux"; import AppRoutes from "./routes" @@ -7,15 +7,12 @@ import { PersistGate } from 'redux-persist/integration/react'; function App() { return ( -
-
); } export default App; - diff --git a/src/component/loader/styles.css b/src/assets/.gitkeep similarity index 100% rename from src/component/loader/styles.css rename to src/assets/.gitkeep diff --git a/src/containers/home/style.scss b/src/components/.gitkeep similarity index 100% rename from src/containers/home/style.scss rename to src/components/.gitkeep diff --git a/src/component/image/107161_circle_github_icon.png b/src/components/image/107161_circle_github_icon.png similarity index 100% rename from src/component/image/107161_circle_github_icon.png rename to src/components/image/107161_circle_github_icon.png diff --git a/src/component/image/PngItem_1280311.png b/src/components/image/PngItem_1280311.png similarity index 100% rename from src/component/image/PngItem_1280311.png rename to src/components/image/PngItem_1280311.png diff --git a/src/component/image/undraw_add_friends_re_3xte.svg b/src/components/image/undraw_add_friends_re_3xte.svg similarity index 100% rename from src/component/image/undraw_add_friends_re_3xte.svg rename to src/components/image/undraw_add_friends_re_3xte.svg diff --git a/src/component/image/undraw_login_re_4vu2.svg b/src/components/image/undraw_login_re_4vu2.svg similarity index 100% rename from src/component/image/undraw_login_re_4vu2.svg rename to src/components/image/undraw_login_re_4vu2.svg diff --git a/src/component/navbar/index.tsx b/src/components/navbar/index.tsx similarity index 89% rename from src/component/navbar/index.tsx rename to src/components/navbar/index.tsx index 8b072da..6732345 100644 --- a/src/component/navbar/index.tsx +++ b/src/components/navbar/index.tsx @@ -1,10 +1,11 @@ import { useEffect, useState, useRef } from 'react'; +import React, { Component } from 'react'; import { useSelector, useDispatch } from '../../store/index'; import Button from 'react-bootstrap/Button'; import Overlay from 'react-bootstrap/Overlay'; import Tooltip from 'react-bootstrap/Tooltip'; -import profile from "../../component/image/107161_circle_github_icon.png"; -import './style.scss'; +import profile from "../image/107161_circle_github_icon.png"; +import '../../styles/sass/main.scss' import { useNavigate } from "react-router-dom"; export const Navbar = () => { @@ -16,7 +17,7 @@ export const Navbar = () => { const navigate = useNavigate(); useEffect(()=>{ if(searchedValue.length!=0){ - navigate("/search"); + navigate("/search/"+searchedValue); } },[searchedValue,navigate]) diff --git a/src/comtainers/.gitkeep b/src/comtainers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/constants/.gitkeep b/src/constants/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/constants/constants.ts b/src/constants/constants.ts new file mode 100644 index 0000000..f447d66 --- /dev/null +++ b/src/constants/constants.ts @@ -0,0 +1,6 @@ +export const EnterPersonalAccessToken = "Please enter your personal Access Token"; +export const EnterUserName = "Please enter your username"; + +export const LOGIN_REQUEST = "LOGIN_REQUEST"; +export const LOGIN_SUCCESS = "LOGIN_SUCCESS"; +export const LOGIN_ERROR = "LOGIN_ERROR"; \ No newline at end of file diff --git a/src/containers/home/index.tsx b/src/containers/home/index.tsx index 54cc9a9..9cf4457 100644 --- a/src/containers/home/index.tsx +++ b/src/containers/home/index.tsx @@ -1,19 +1,10 @@ -import { useEffect, useState, useRef } from 'react'; -import Button from 'react-bootstrap/Button'; -import Overlay from 'react-bootstrap/Overlay'; -import Tooltip from 'react-bootstrap/Tooltip'; -import 'bootstrap/dist/css/bootstrap.css'; -import { useSelector, useDispatch } from '../../store/index'; -import './style.scss'; -import profile from "../../component/image/107161_circle_github_icon.png"; +import React from "react"; + +// TODO: Add Home page UI export const HomePage = () => { - const {userData} = useSelector((state) => state.user) - const [show, setShow] = useState(false); - const [searchTerm, setSearchTerm] = useState(''); - const target = useRef(null); return( -
- -
- ) -} \ No newline at end of file +
+

Home Page

+
+ ) +} diff --git a/src/containers/login/index.tsx b/src/containers/login/index.tsx index 93c56fd..4a7e003 100644 --- a/src/containers/login/index.tsx +++ b/src/containers/login/index.tsx @@ -1,21 +1,18 @@ -import 'font-awesome/css/font-awesome.min.css'; - import React, { useEffect, useState } from 'react'; import { Spinner } from "react-bootstrap"; -import { useSelector, useDispatch } from '../../store/index'; -import {loginUser} from "../../store/actions/login"; import { useNavigate } from "react-router-dom"; -import profile from "..//../component/image/undraw_login_re_4vu2.svg"; - -import './style.scss'; - +import { useSelector, useDispatch } from '../../store/index'; +import {loginUser} from "../../store/actions/login"; +import profile from "../../components/image/undraw_login_re_4vu2.svg"; +import * as Constants from '../../constants/constants' +import '../../styles/sass/main.scss' export const LoginPage = () => { const {error,userLoggedIn} = useSelector((state) => state.user) - const dispatch = useDispatch() + const dispatch = useDispatch(); const [username, setUsername] = useState(""); - const [personalAccessToked, setPersonalAccessToked] = useState(""); + const [personalAccessToken, setPersonalAccessToken] = useState(""); const [usernameMissing, setUsernameMissing] = useState(false); const [personalAccessTokenMissing, setPersonalAccessTokenMissing] = useState(false); const [validateUserData, setvalidateUserData] = useState(false); @@ -36,39 +33,19 @@ export const LoginPage = () => { },[error,loading]) function login() { - if(username===''&&personalAccessToked===''){ - setUsernameMissing(true); - setPersonalAccessTokenMissing(true); + setUsernameMissing(!username); + setPersonalAccessTokenMissing(!personalAccessToken); + if (!username || !personalAccessToken) { setvalidateUserData(false); return; } - if(username===''){ - setUsernameMissing(true); - setPersonalAccessTokenMissing(false); - setvalidateUserData(false); - return; - } - if(personalAccessToked===''){ - setUsernameMissing(false); - setPersonalAccessTokenMissing(true); - setvalidateUserData(false); - return; - } - if(username===''||personalAccessToked===''){ - return; - } - dispatch(loginUser(personalAccessToked,username)); + dispatch(loginUser(personalAccessToken,username)); } function setLoader(){ - setLoading(true); - setTimeout(() => { - setLoading(false); - login() - }, 100); - }; + login(); + } return( -
@@ -80,10 +57,10 @@ export const LoginPage = () => {
setUsername(e.target.value)} type="text" placeholder="username" />
- {usernameMissing &&

Please enter your username

} + {usernameMissing &&

{Constants.EnterUserName}

}
- setPersonalAccessToked(e.target.value)} type="password" placeholder="personalAccessToked" /> - {personalAccessTokenMissing &&

Please enter your personal Access Token

} + setPersonalAccessToken(e.target.value)} type="password" placeholder="Personal Access Token" /> + {personalAccessTokenMissing &&

{Constants.EnterPersonalAccessToken}

} {validateUserData &&

{error}

}
@@ -110,6 +87,5 @@ export const LoginPage = () => {
-
) -} \ No newline at end of file +} diff --git a/src/containers/search/index.tsx b/src/containers/search/index.tsx index 870b99a..a3b7694 100644 --- a/src/containers/search/index.tsx +++ b/src/containers/search/index.tsx @@ -1,7 +1,52 @@ +import { useParams } from 'react-router-dom'; +import { useEffect, useState } from 'react'; +import ReactPaginate from 'react-paginate'; +import React, { Component } from 'react'; + +import axios from 'axios'; +import './style.scss'; + export const SearchPage = () => { + const [users,setUsers] = useState(); + const { searchId } = useParams(); + const [currentPage, setCurrentPage] = useState(0); + let pageCount; + const fetchData = async() =>{ + const response = await axios.get('https://api.github.com/search/users?per_page=10&page='+(currentPage+1)+'&q='+searchId) + setUsers(response.data); + } + useEffect(() =>{ + fetchData(); + },[searchId,currentPage]); + + function handlePageClick({selected} : {selected:number}) { + setCurrentPage(selected) + setUsers(undefined) + } + if (users!=undefined){ + pageCount = users.total_count; + } + return(
- Hii +
+ {users?.items?.map((res:any, index:any) => + <>
+

{res.login}

)} +
+
+ "} + pageCount = {pageCount} + onPageChange = {handlePageClick} + containerClassName = {"pagination"} + previousLinkClassName = {"pagination__link"} + nextClassName = {"pagination__link"} + disabledClassName = {"pagination__link--disabled"} + activeClassName = {"pagination__link--active"} + /> +
) -} \ No newline at end of file +} diff --git a/src/index.tsx b/src/index.tsx index b768844..1fd12b7 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -11,4 +11,3 @@ root.render( ); - diff --git a/src/pages/.gitkeep b/src/pages/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/routes/.gitkeep b/src/routes/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/routes/appRoute.tsx b/src/routes/appRoute.tsx index beea1bd..4a86f8e 100644 --- a/src/routes/appRoute.tsx +++ b/src/routes/appRoute.tsx @@ -1,6 +1,6 @@ +import PrivateRoute from "./privateRoute"; +import { Navbar } from "../components/navbar"; import { Route } from "react-router-dom"; -import PrivateRoute from "./privateRoute" -import { Navbar } from "../component/navbar" type AppRouteProps = { component: JSX.Element; @@ -10,9 +10,7 @@ const AppRoute = ({ component, isPrivate }: AppRouteProps):JSX.Element => ( - isPrivate ? <> : component ) - -export default AppRoute \ No newline at end of file +export default AppRoute; diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 6598d52..205c02a 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -1,7 +1,7 @@ import { BrowserRouter, Routes, Route } from "react-router-dom"; import routesConfig from "./routesConfig"; import AppRoute from "./appRoute"; - +import React from "react"; const AppRoutes = () => { return ( diff --git a/src/routes/privateRoute.tsx b/src/routes/privateRoute.tsx index e372f28..08ff0cf 100644 --- a/src/routes/privateRoute.tsx +++ b/src/routes/privateRoute.tsx @@ -1,6 +1,7 @@ import { useEffect } from 'react'; import { useNavigate } from "react-router-dom"; import { useSelector } from '../store'; +import { Route } from "react-router-dom"; type PrivateRouteProps = { component: JSX.Element; @@ -21,4 +22,4 @@ const PrivateRoute = ({ return component; } -export default PrivateRoute +export default PrivateRoute; diff --git a/src/routes/routesConfig.tsx b/src/routes/routesConfig.tsx index 7ed48fa..61a3d8f 100644 --- a/src/routes/routesConfig.tsx +++ b/src/routes/routesConfig.tsx @@ -1,15 +1,24 @@ import { LoginPage } from '../containers/login' import { HomePage } from '../containers/home' +import { SearchPage } from '../containers/search' +import React, { Component } from 'react'; + const routesConfig: RouteConfig[] = [ { path: '/', component: , private: true, }, + { + path: '/search/:searchId', + component: , + private: true, + }, { path: '/login', component: , private: false, }, ] -export default routesConfig \ No newline at end of file + +export default routesConfig; diff --git a/src/services/.gitkeep b/src/services/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/store/actions/.gitkeep b/src/store/actions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/store/actions/login.ts b/src/store/actions/login.ts index d4ec6fc..40c91c6 100644 --- a/src/store/actions/login.ts +++ b/src/store/actions/login.ts @@ -4,13 +4,10 @@ export const loginRequest = () => ({type:"LOGIN_REQUEST"}); export const loginError = (err: string) => ({type:"LOGIN_ERROR",payload:err}); export const loginSuccess = (userData: Record,token: string) => ({type:"LOGIN_SUCCESS",payload:{userData,token}}); -export const loginUser = (personalAccessToked: string,username: string) => { +export const loginUser = (personalAccessToken: string,username: string) => { return (dispatch: DispatchType) => { dispatch(loginRequest()); - const config = { headers: { Authorization: `Bearer ${personalAccessToked}`}}; - if(personalAccessToked===""||username===""){ - return - } + const config = { headers: { Authorization: `Bearer ${personalAccessToken}`}}; axios.get('https://api.github.com/user',config) .then(response => { const userData = response.data @@ -18,7 +15,7 @@ export const loginUser = (personalAccessToked: string,username: string) => { dispatch(loginError('Either username or personal Access Token is wrong')); } else { - dispatch(loginSuccess(userData,personalAccessToked)); + dispatch(loginSuccess(userData,personalAccessToken)); } }) .catch(err => { diff --git a/src/store/index.ts b/src/store/index.ts index b1ae6f7..653f78e 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -35,4 +35,3 @@ export const useDispatch = () => reduxUseDispatch(); export const useSelector: TypedUseSelectorHook = reduxUseSelector; export default store; - diff --git a/src/store/reducers/.gitkeep b/src/store/reducers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/store/reducers/login.ts b/src/store/reducers/login.ts index d237598..c4463cb 100644 --- a/src/store/reducers/login.ts +++ b/src/store/reducers/login.ts @@ -1,4 +1,6 @@ -export const initialState:InitialLoginState = { +import * as Constants from '../../constants/constants' + +const initialState:InitialLoginState = { token:null, userLoggedIn:false, userLoggingIn:false, @@ -7,28 +9,21 @@ export const initialState:InitialLoginState = { } export const userReducer = (state = initialState, action:GenericAction) =>{ - // state= Object.assign({},state) switch(action.type){ - - case "LOGIN_REQUEST": + case Constants.LOGIN_REQUEST: return { - ...state, userLoggingIn:true }; - case "LOGIN_SUCCESS": + case Constants.LOGIN_SUCCESS: return { - ...state, token:action.payload.token, userLoggedIn:true, userLoggingIn:false, error:'', userData:action.payload.userData } - case "LOGIN_ERROR": - - localStorage.removeItem('token'); + case Constants.LOGIN_ERROR: return { - ...state, token:null, userLoggedIn:false, userLoggingIn:false, @@ -38,4 +33,4 @@ export const userReducer = (state = initialState, action:GenericAction) =>{ default: return state; } -} \ No newline at end of file +} diff --git a/src/styles/sass/base/.gitkeep b/src/styles/sass/base/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/styles/sass/components/.gitkeep b/src/styles/sass/components/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/component/navbar/style.scss b/src/styles/sass/components/_navbar.scss similarity index 100% rename from src/component/navbar/style.scss rename to src/styles/sass/components/_navbar.scss diff --git a/src/styles/sass/main.scss b/src/styles/sass/main.scss new file mode 100644 index 0000000..475da9e --- /dev/null +++ b/src/styles/sass/main.scss @@ -0,0 +1,5 @@ +@import 'font-awesome/css/font-awesome.min.css'; + +@import 'pages/login'; +@import 'components/navbar'; +@import 'pages/search'; diff --git a/src/styles/sass/pages/.gitkeep b/src/styles/sass/pages/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/containers/login/style.scss b/src/styles/sass/pages/_login.scss similarity index 100% rename from src/containers/login/style.scss rename to src/styles/sass/pages/_login.scss diff --git a/src/styles/sass/pages/_search.scss b/src/styles/sass/pages/_search.scss new file mode 100644 index 0000000..9e8285c --- /dev/null +++ b/src/styles/sass/pages/_search.scss @@ -0,0 +1,41 @@ +.info { + img { + width: 100px; + height: 100px; + margin-top: 22px; + margin-left: 10px; + border-radius: 50%; + } + display: flex; +} +.pagination { + display: flex; + justify-content: flex-start; + list-style: none; + cursor: pointer; +} +.pagination a { + padding: 10px; + border: 1px solid #003865; + color: #003865; +} +.pagination__link { + font-weight: bold; +} +.pagination__link--active a { + color: #003865; + background: #003865; +} +.pagination__link--disabled a { + color: rgb(198, 197, 202); + background: 1px solid rgb(198, 197, 202); +} +.item { + width: 200px; + text-align: center; + display: block; + background-color: transparent; + border: 1px solid transparent; + margin-right: 10px; + margin-bottom: 1px; +} diff --git a/src/types/.gitkeep b/src/types/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/types/common.d.ts b/src/types/common.d.ts index d3ab222..4cdf24f 100644 --- a/src/types/common.d.ts +++ b/src/types/common.d.ts @@ -2,4 +2,4 @@ type RouteConfig ={ path: string; component: JSX.Element; private: boolean; -} \ No newline at end of file +} diff --git a/src/types/store.d.ts b/src/types/store.d.ts index 6480689..ec0ab74 100644 --- a/src/types/store.d.ts +++ b/src/types/store.d.ts @@ -6,13 +6,13 @@ type GenericAction = { type DispatchType = (args: GenericAction) => GenericAction; type InitialLoginState = { - token:string|null, - userLoggedIn:boolean, - userLoggingIn:boolean, - error:string, - userData:Record|null + token:string|null; + userLoggedIn:boolean; + userLoggingIn:boolean; + error:string; + userData:Record|null; } type GlobalState = { user: InitialLoginState -} \ No newline at end of file +} diff --git a/src/utils/.gitkeep b/src/utils/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tsconfig.json b/tsconfig.json index a841e1d..a273b0c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es6", + "target": "es5", "lib": [ "dom", "dom.iterable",