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

Resolving conflicts #1

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e1a4133
preloader added
marizvi Oct 9, 2021
327fecc
preloader added
marizvi Oct 12, 2021
958cdfc
Merge pull request #56 from marizvi/master
shivamm0110 Oct 13, 2021
66521c2
feat:axios added
prathmeshkhandelwal1 Oct 14, 2021
88395cc
improved css of list in homepage
ShravaniAK Oct 11, 2022
7b51b1b
Merge pull request #69 from ShravaniAK/master
rashiyadhruv Oct 20, 2022
7003854
Update package.json
AniModi Oct 2, 2023
e8f1c0c
updated package.json
AniModi Oct 2, 2023
f42ed5b
Merge pull request #79 from AniModi/master
AniModi Oct 2, 2023
48f356a
Page in between the github transition
SteakFisher Oct 2, 2023
aff5347
Delete package-lock.json
SteakFisher Oct 3, 2023
1bd52bc
Setting up vercel
aryanargupta Oct 3, 2023
1457113
Create vercel.yml
aryanargupta Oct 3, 2023
946a97c
Update vercel.yml
aryanargupta Oct 3, 2023
2c56dff
Update vercel.yml
aryanargupta Oct 3, 2023
4b04840
updated vercel.yml
aryanargupta Oct 3, 2023
8af045f
Update vercel.yml
aryanargupta Oct 3, 2023
2550179
Update vercel.yml
aryanargupta Oct 3, 2023
7226912
vercel.yml workflow
aryanargupta Oct 3, 2023
4218b84
Update vercel.yml
aryanargupta Oct 3, 2023
218a8f5
Update vercel.yml
aryanargupta Oct 3, 2023
eae491b
Update vercel.yml
AniModi Oct 3, 2023
8c56d31
Delete .github/workflows/vercel.yml
aryanargupta Oct 3, 2023
6452c59
Merge pull request #81 from SteakFisher/master
AniModi Oct 3, 2023
f883969
Revert "Feat: Page in between the github transition "
AniModi Oct 3, 2023
ee8ef89
Merge pull request #84 from iiitv/revert-81-master
AniModi Oct 3, 2023
dd13ba8
Adding netlify.toml
AniModi Oct 3, 2023
874e3e1
Re: Page in between redirection
SteakFisher Oct 3, 2023
28e44e1
Merge branch 'iiitv:master' into master
SteakFisher Oct 3, 2023
9aa5901
Update Algorithm.js
SteakFisher Oct 3, 2023
8227432
Merge pull request #86 from SteakFisher/master
AniModi Oct 4, 2023
8e5d189
feat: add github workflow
Alitindrawan24 Oct 4, 2023
b0cd9e0
feat: add github workflow
Alitindrawan24 Oct 4, 2023
9e63a96
Merge pull request #90 from Alitindrawan24/master
aryanargupta Oct 7, 2023
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
30 changes: 30 additions & 0 deletions .github/workflows/github-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18.x'

- name: Install yarn
run: npm i --global yarn

- name: Install npm packages
run: yarn install

- name: Build assets
run: yarn build

- name: Run test
run: yarn test -- --watchAll=false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ dist
.vscode/
.vs/
.idea/
.vercel
4 changes: 4 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[[redirects]]
from = "/*"
to = "/"
status = 200
14,637 changes: 0 additions & 14,637 deletions package-lock.json

This file was deleted.

14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,26 @@
"private": true,
"homepage": "https://algos-web.netlify.com",
"dependencies": {
"axios": "^0.21.2",
"@emotion/react": "^11.4.1",
"axios": "^0.23.0",
"react": "^16.14.0",
"react-dom": "^16.13.1",
"react-particles-js": "^3.5.3",
"react-redux": "^7.2.1",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.3",
"react-scripts": "^3.4.4",
"react-spinners": "^0.11.0",
"react-springy-parallax": "^1.3.0",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0",
"script": "^0.1.4",
"tsparticles": "^1.35.2",
"uikit": "^3.5.7"
"tsparticles": "^1.35.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"start": "react-scripts --openssl-legacy-provider start",
"preinstall": "git config --global url.\"https://\".insteadOf git://",
"build": "react-scripts --openssl-legacy-provider build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"predeploy": "npm run build",
Expand Down
9 changes: 9 additions & 0 deletions src/Main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.App {
text-align: center;
background-color: rgb(16, 29, 68);
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
}
38 changes: 38 additions & 0 deletions src/Main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React, { useState, useEffect } from 'react';
import { Switch, Route } from 'react-router-dom';
import HomePage from './components/home/HomePage';
import HomeComponent from './components/welcome/HomeComponent.js';
import HashLoader from 'react-spinners/HashLoader';
import './Main.css';
import Algorithm from './components/algorithm/Algorithm';


function App() {
const [loading, setLoading] = useState(false);
useEffect(() => {
setLoading(true);
setTimeout(() => {
setLoading(false);
}, 2410);
}, []);

return (
<div className="App">
{loading ? (
<div className="loadd">
<HashLoader color={'white'} loading={loading} size={60} />
</div>
) : (
<Switch>
{/* New PArrellax component */}
{/* <Route exact path="/" component={HomePage}></Route> */}
<Route exact path="/" component={HomeComponent}></Route>
<Route className="homepage" exact path="/home" component={HomePage}></Route>
<Route path="/algorithm/:name" component={Algorithm} />
</Switch>
)}
</div>
);
}

export default App;
23 changes: 23 additions & 0 deletions src/components/algorithm/Algorithm.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.list ul{
padding: 10px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.list ul li{
padding: 10px;
list-style: none;
border:1px solid white;
margin:10px;
color: white;
width:40vw;

}
.list{
width: 100vw;
height:100%;
background-color:rgb(16, 29, 68);
}


42 changes: 42 additions & 0 deletions src/components/algorithm/Algorithm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React, { useState, useEffect } from 'react';
import {useParams} from "react-router-dom";
import axios from 'axios';
import './Algorithm.css';

const Algorithm = () => {
const { name } = useParams();
const [data, setData] = useState([]);
console.log(name);

// Get all files under the selected algo and store it into the data variable
useEffect(() => {
const getDataFromGit = async () => {
try {
const resp = await axios.get(`https://api.github.com/repos/iiitv/algos/contents/${name}`);
console.log(resp.data);
setData(resp.data);
} catch (e) {
console.log(e.response, 'error');
}
};
getDataFromGit();
}, [name]);

console.log(data)

let finalRender = data.map((file) => {
return (
<a key={file.sha} href={`${file.html_url}`}>
<li key={file.sha}>{file.name}</li>
</a>
);
});
return (
<div className="list">
<ul>{finalRender}</ul>
</div>
)
}


export default Algorithm
23 changes: 23 additions & 0 deletions src/components/home/HomePage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.list ul{
padding: 10px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.list ul li{
padding: 10px;
list-style: none;
border:1px solid white;
margin:10px;
color: white;
width:40vw;

}
.list{
width: 100vw;
height:100%;
background-color:rgb(16, 29, 68);
}


34 changes: 18 additions & 16 deletions src/components/home/HomePage.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import React, { useState, useEffect } from 'react';
import './HomePage.css';
import axios from 'axios';
import {Link} from "react-router-dom";

const HomePage = () => {
const [data, setData] = useState(null);

useEffect(() => {
fetch('https://cors-anywhere.herokuapp.com/https://api.github.com/repos/iiitv/algos/contents', {
method: 'GET',
credentials: 'same-origin',
headers: new Headers({
'Access-Control-Allow-Origin': '*',
}),
mode: 'cors',
})
.then((res) => res.json())
.then((data) => {
setData(data);
});
const getDataFromGit = async () => {
try {
const resp = await axios.get('https://api.github.com/repos/iiitv/algos/contents');
console.log(resp.data);
setData(resp.data);
} catch (e) {
console.log(e.response, 'error');
}
};
getDataFromGit();
}, []);

let val = null;
Expand All @@ -31,9 +31,9 @@ const HomePage = () => {
if (val) {
list = val.map((item) => {
return (
<a key={item.sha} href={item.html_url}>
<Link key={item.sha} to={`algorithm/${item.name}`}>
<li key={item.sha}>{item.name}</li>
</a>
</Link>
);
});
}
Expand Down Expand Up @@ -63,13 +63,15 @@ const HomePage = () => {
</div>
</div>
<div className="uk-width-4-5@s">
<div style={{ background: 'blue' }} className="uk-padding-small">
<div style={{ background: 'blue' } } className="uk-padding-small">
<p>yomo</p>
</div>
</div>
</div>
<>
<ul>{list}</ul>
<div className="list">
<ul>{list}</ul>
</div>
</>
</div>
);
Expand Down
1 change: 0 additions & 1 deletion src/components/welcome/HomeComponent.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
.footer-image {
opacity: 0.6;
width: 40%;
margin-left: 30%;
}

.footer-heading {
Expand Down
2 changes: 2 additions & 0 deletions src/components/welcome/HomeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export default class HomeComponent extends Component {
</div>
</Parallax.Layer>
</Parallax>
// )}
// </div>
);
}
}
13 changes: 3 additions & 10 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { Route } from 'react-router';
import { BrowserRouter, Switch } from 'react-router-dom';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'react-redux';
import Main from './Main';

// import * as serviceWorker from './serviceWorker';
import store from './store';
import './index.css';
import HomePage from './components/home/HomePage';
import HomeComponent from './components/welcome/HomeComponent.js';

ReactDOM.render(
<Provider store={store}>
<BrowserRouter basename={process.env.PUBLIC_URL}>
<Switch>
{/* New PArrellax component */}
{/* <Route exact path="/" component={HomePage}></Route> */}
<Route exact path="/" component={HomeComponent}></Route>
<Route exact path="/home" component={HomePage}></Route>
</Switch>
<Main />
</BrowserRouter>
</Provider>,
document.getElementById('root')
Expand Down
Loading