Skip to content

Commit

Permalink
fix: resolved conflicts (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
shristigupta12 committed Dec 25, 2021
2 parents d79dd91 + 3fd1702 commit 0ac5a51
Show file tree
Hide file tree
Showing 36 changed files with 293 additions and 277 deletions.
18 changes: 0 additions & 18 deletions .eslintrc.json

This file was deleted.

4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run prettyCheck
1 change: 0 additions & 1 deletion .stylelintrc.json

This file was deleted.

24 changes: 24 additions & 0 deletions package-lock.json

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

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"pretty": "npx prettier --write \"./**/*.{js,jsx,json,css}\"",
"prettyCheck": "npx prettier --check \"./**/*.{js,jsx,json,css}\"",
"prepare": "husky install"
},
"eslintConfig": {
"extends": [
Expand All @@ -39,5 +42,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"husky": "^7.0.4"
}
}
20 changes: 10 additions & 10 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.logo {
float: left;
width: 120px;
height: 31px;
margin: 16px 24px 16px 0;
background: rgba(255, 255, 255, 0.3);
}
.ant-row-rtl .logo {
float: right;
margin: 16px 0 16px 24px;
}
float: left;
width: 120px;
height: 31px;
margin: 16px 24px 16px 0;
background: rgba(255, 255, 255, 0.3);
}
.ant-row-rtl .logo {
float: right;
margin: 16px 0 16px 24px;
}
5 changes: 2 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const App = () => {
let location = useLocation()
return (
//location.search is the part of url after ? symbol
<Contests queryStr={location.search} ContestAPI = {ContestAPI} />
<Contests queryStr={location.search} ContestAPI={ContestAPI} />
)
}

Expand Down Expand Up @@ -154,7 +154,6 @@ const App = () => {
{/* wise - topic,level | type - ladder,practice | slug is selected series */}
<Route path="/problems" element={<ProblemsPage1 />} />
{/* Problems page */}

<Route path="/contests" element={<ContestPage1 />} />
{/* Contest page */}
<Route
Expand Down Expand Up @@ -189,4 +188,4 @@ const App = () => {
)
}

export default App
export default App
2 changes: 1 addition & 1 deletion src/actions/Contest.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export default async function getProblems(creds, queryStr) {
Authorization: `Bearer ${creds.access}`,
},
}).then((data) => data.json())
}
}
36 changes: 25 additions & 11 deletions src/components/AccordionCom.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
import React from 'react'
import 'antd/dist/antd.css';
import { Card } from 'antd';
import '../styles/Accordion/accordion.css';
import 'antd/dist/antd.css'
import { Card } from 'antd'
import '../styles/Accordion/accordion.css'

export default function SimpleAccordion({ problem }) {
return (<>
<Card className='mainCard'>
<Card className='problemName' type="inner" title={problem.name} extra={<a className='solveLink' target="blank" href={`https://codeforces.com/contest/${problem.contestId}`}>Solve</a>}>
<strong>Duration</strong> : {problem.duration / 60 / 60} hours
</Card>
</Card>
</>
)
return (
<>
<Card className="mainCard">
<Card
className="problemName"
type="inner"
title={problem.name}
extra={
<a
className="solveLink"
target="blank"
href={`https://codeforces.com/contest/${problem.contestId}`}
>
Solve
</a>
}
>
<strong>Duration</strong> : {problem.duration / 60 / 60} hours
</Card>
</Card>
</>
)
}
11 changes: 5 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import {BrowserRouter} from 'react-router-dom'
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import App from './App'

ReactDOM.render(
<React.StrictMode>
<App /> </React.StrictMode>,
document.getElementById('root')
);
)
60 changes: 36 additions & 24 deletions src/pages/Contests/Contests.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ function ContestPage({ queryStr, ContestAPI }) {
const [datap, setDatap] = useState(queryStr.replace(/;/g, '&'))

//for sidenav (for adding a class)
const [openSideNav, setOpenSideNav] = useState("");
const [openSideNav, setOpenSideNav] = useState('')
//for blur bckground
const [blurBackground, setBlurBackground] = useState("");
const [blurBackground, setBlurBackground] = useState('')

// search box
const { Search } = Input
Expand Down Expand Up @@ -137,14 +137,14 @@ function ContestPage({ queryStr, ContestAPI }) {

//opening filter block
function openNav() {
setOpenSideNav('sideNavOpen');
setBlurBackground('blur_bckgrnd');
setOpenSideNav('sideNavOpen')
setBlurBackground('blur_bckgrnd')
}

//closing filter block
function closeNav() {
setOpenSideNav("sideNavClose");
setBlurBackground(null);
setOpenSideNav('sideNavClose')
setBlurBackground(null)
}

//rendering contests
Expand Down Expand Up @@ -172,7 +172,7 @@ function ContestPage({ queryStr, ContestAPI }) {
) : (
<>
<div id="contest_nav_id">{/* <Navbar /> */}</div>
<h3 className={`page_heading ${blurBackground}`} id="page_heading_id">
<h3 className={`page_heading ${blurBackground}`} id="page_heading_id">
Contests
</h3>
<Button className="filter_buttonnn" type="primary" onClick={openNav}>
Expand All @@ -186,9 +186,9 @@ function ContestPage({ queryStr, ContestAPI }) {
Refresh
</Button>

<div id="mySidenav1" className = {`sidenav1 ${openSideNav}`}>
<div id="mySidenav1" className={`sidenav1 ${openSideNav}`}>
{/* modal popup */}
<ModalForDivision
<ModalForDivision
difflev={DIFFICULTY_OBJECT.difficultyLevels}
display={displayDiff}
change={changeDifficultyFilter}
Expand All @@ -214,35 +214,47 @@ function ContestPage({ queryStr, ContestAPI }) {
/>
</div>
<br></br> <br></br>
<Button className="sidenav_apply_button" onClick={handleSubmit}> Apply </Button>
<Button className="sidenav_close_button" onClick={closeNav}> Close </Button>
<Button className="sidenav_apply_button" onClick={handleSubmit}>
{' '}
Apply{' '}
</Button>
<Button className="sidenav_close_button" onClick={closeNav}>
{' '}
Close{' '}
</Button>
</div>

{!problems.result ? (
// <Loading />
<h1>hi</h1>
) : (
<>
<div className={`contests_page ${blurBackground}`} id="contests_page_id">
<div
className={`contests_page ${blurBackground}`}
id="contests_page_id"
>
<div className="roww">
<div className="input-group">
{/* search box */}
<Search
placeholder="input search text"
allowClear
enterButton="Search"
size="large"
onChange={(e) => setSearchText(e.target.value)}
onSearch={handleSearch}
className="search_box"
/>
{/* search box */}
<Search
placeholder="input search text"
allowClear
enterButton="Search"
size="large"
onChange={(e) => setSearchText(e.target.value)}
onSearch={handleSearch}
className="search_box"
/>
</div>
</div>
<Row gutter={[16, 16]}>
{problems.result.map((playlist, i) => {
return (
<>
<Col span={screen.width > 768 ? 12 : 25} style={{ marginBottom: '1rem' }} >
<Col
span={screen.width > 768 ? 12 : 25}
style={{ marginBottom: '1rem' }}
>
<AccordionCom problem={playlist} />
</Col>
</>
Expand All @@ -257,4 +269,4 @@ function ContestPage({ queryStr, ContestAPI }) {
)
}

export default ContestPage
export default ContestPage
Loading

0 comments on commit 0ac5a51

Please sign in to comment.