-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
273 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import React from 'react' | ||
import axios from 'axios' | ||
import { authCtx } from '../context/authCtx' | ||
import Lang from './Lang' | ||
import * as bp3 from '@blueprintjs/core' | ||
class AllLangs extends React.Component { | ||
constructor(props) { | ||
super(props) | ||
this.state = { | ||
} | ||
this.state = { | ||
count: 0, | ||
data:{} | ||
} | ||
} | ||
static contextType = authCtx | ||
|
||
|
||
|
||
|
||
render() { | ||
if (JSON.stringify(this.context.langs) == '[]'){ | ||
return <bp3.Button minimal loading></bp3.Button> | ||
} | ||
else{ | ||
let row1 = [] | ||
let row2 = [] | ||
let row3 = [] | ||
let row4 = [] | ||
let i = 1 | ||
this.context.langs.forEach(element => { | ||
if(i%4 === 1){ | ||
console.log(element) | ||
console.log(element.topics) | ||
row1.push(<Lang key={element._id} id={element._id} name={element.name} topics={element.topics}/>) | ||
} | ||
if(i%4 === 2){ | ||
console.log(element) | ||
row2.push(<Lang key={element._id} id={element._id} name={element.name} topics={element.topics}/>) | ||
} | ||
if(i%4 === 3){ | ||
console.log(element) | ||
row3.push(<Lang key={element._id} id={element._id} name={element.name} topics={element.topics}/>) | ||
} | ||
if(i%4 === 0){ | ||
console.log(element) | ||
row4.push(<Lang key={element._id} id={element._id} name={element.name} topics={element.topics}/>) | ||
} | ||
i++ | ||
}) | ||
|
||
return( | ||
<div className="langs"> | ||
<div> | ||
{row1} | ||
</div> | ||
<div> | ||
{row2} | ||
</div> | ||
<div> | ||
{row3} | ||
</div> | ||
<div> | ||
{row4} | ||
</div> | ||
</div> | ||
) | ||
} | ||
} | ||
} | ||
|
||
export default AllLangs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.