-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from hackjunction/fix/challenges
Fixed faulty challenges
- Loading branch information
Showing
5 changed files
with
766 additions
and
300 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
116 changes: 116 additions & 0 deletions
116
frontend/app/src/components/ChallengeGrid/DesktopLayout.js
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,116 @@ | ||
import React, { useState } from 'react' | ||
import './style.scss' | ||
|
||
import Markdown from '../Markdown' | ||
import { requirePropFactory } from '@material-ui/core' | ||
|
||
const DesktopLayout = (props) => { | ||
//Animation duration | ||
|
||
// var { cardbackground, icon } = item | ||
// if (!cardbackground) { | ||
// cardbackground = { url: '' } | ||
// } | ||
if (!props.cardbackground) { | ||
props.cardbackground = { url: '' } | ||
} | ||
// const [open, toggleOpen] = useState(false) | ||
// const [clicable, toggleClicable] = useState(true) | ||
|
||
// const flipStyle = (e, state) => { | ||
// e.currentTarget.classList.toggle('flip', state) | ||
// e.currentTarget.doneAnimating = !state | ||
// } | ||
// const flipCard = (e) => { | ||
// console.log('===', clicable) | ||
// if (!clicable) { | ||
// return | ||
// } | ||
// let duration = aDur * 1000 | ||
// flipStyle(e, true) | ||
// setTimeout(() => toggleOpen(!open), duration / 2) | ||
// } | ||
|
||
// if (open) { | ||
return ( | ||
<div className="ChallengeItem"> | ||
<div className="ChallengeItem--head"> | ||
<img className="ChallengeItem--image" src={props.cardbackground.url} /> | ||
<div className="ChallengeItem--title-container"> | ||
<span className="ChallengeItem--title">{props.name}</span> | ||
</div> | ||
<div className="ChallengeItem--shorttext-container"> | ||
<span className="ChallengeItem--shorttext"> {props.shorttext}</span> | ||
</div> | ||
<div className="ChallengeItem--longtext-container"> | ||
<Markdown | ||
className="ChallengeItem--longtext" | ||
source={props.long_text} | ||
/> | ||
</div> | ||
<div className="ChallengeItem--subsection"> | ||
<span className="ChallengeItem--subsection-left">The Challenge</span> | ||
<Markdown | ||
className="ChallengeItem--subsection-right" | ||
source={props.thechallenge} | ||
/> | ||
</div> | ||
{props.insights && ( | ||
<div className="ChallengeItem--subsection"> | ||
<span className="ChallengeItem--subsection-left"> Insights</span> | ||
<Markdown | ||
className="ChallengeItem--subsection-right" | ||
source={props.insights} | ||
/> | ||
</div> | ||
)} | ||
|
||
{props.support && ( | ||
<div className="ChallengeItem--subsection"> | ||
<span className="ChallengeItem--subsection-left"> Support</span> | ||
<Markdown | ||
className="ChallengeItem--subsection-right" | ||
source={props.support} | ||
/> | ||
</div> | ||
)} | ||
{/* {insightimage && <img class="InsightImg" src={insightimage.url} />} */} | ||
{props.price && ( | ||
<div className="ChallengeItem--subsection"> | ||
<span className="ChallengeItem--subsection-left"> The Prize</span> | ||
<Markdown | ||
className="ChallengeItem--subsection-right" | ||
source={props.price} | ||
/> | ||
</div> | ||
)} | ||
|
||
{props.judging && ( | ||
<div className="ChallengeItem--subsection"> | ||
<span className="ChallengeItem--subsection-left"> | ||
{' '} | ||
Judging Criteria | ||
</span> | ||
<Markdown | ||
className="ChallengeItem--subsection-right" | ||
source={props.judging} | ||
/> | ||
</div> | ||
)} | ||
|
||
<div className="ChallengeItem--subsection"> | ||
<span className="ChallengeItem--subsection-left"> | ||
{' '} | ||
About the company | ||
</span> | ||
<Markdown | ||
className="ChallengeItem--subsection-right" | ||
source={props.aboutcompany} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default DesktopLayout |
Oops, something went wrong.