diff --git a/src/components/elements/MobileChallengeMenu.js b/src/components/elements/MobileChallengeMenu.js index 06e455c..7b39ded 100644 --- a/src/components/elements/MobileChallengeMenu.js +++ b/src/components/elements/MobileChallengeMenu.js @@ -1,9 +1,39 @@ import React from "react"; +import {FlexRow} from "../../utils/containers"; +import styled from "styled-components"; +import {Medium} from "../../utils/fonts"; -const MobileChallengeMenu = () => { +const MenuOption = styled(Medium)` + cursor: pointer; + transition: color 0.3s ease-in-out; + + &:hover { + color: ${({theme}) => theme.colors.green}; + } +`; + +const MobileChallengeMenu = (props) => { return ( <> - + + props.setSection(0)}> + Leaderboard + + props.setSection(1)}> + Readme + + props.setSection(2)}> + How to + + + + props.setSection(4)}> + My entries + + props.setSection(3)}> + Submit + + ); } diff --git a/src/components/sections/HowTo.js b/src/components/sections/HowTo.js new file mode 100644 index 0000000..e3552e6 --- /dev/null +++ b/src/components/sections/HowTo.js @@ -0,0 +1,15 @@ +import React from "react"; +import {FlexColumn} from "../../utils/containers"; +import {H2} from "../../utils/fonts"; + +const HowTo = () => { + return ( + +

+ How to +

+
+ ); +} + +export default HowTo; \ No newline at end of file diff --git a/src/components/sections/Leaderboard.js b/src/components/sections/Leaderboard.js new file mode 100644 index 0000000..b9c14e0 --- /dev/null +++ b/src/components/sections/Leaderboard.js @@ -0,0 +1,15 @@ +import React from "react"; +import {FlexColumn} from "../../utils/containers"; +import {H2} from "../../utils/fonts"; + +const Leaderboard = () => { + return ( + +

+ Leaderboard +

+
+ ); +} + +export default Leaderboard; \ No newline at end of file diff --git a/src/components/sections/MyEntries.js b/src/components/sections/MyEntries.js new file mode 100644 index 0000000..5fa9875 --- /dev/null +++ b/src/components/sections/MyEntries.js @@ -0,0 +1,15 @@ +import React from "react"; +import {FlexColumn} from "../../utils/containers"; +import {H2} from "../../utils/fonts"; + +const MyEntries = () => { + return ( + +

+ My entries +

+
+ ); +} + +export default MyEntries; \ No newline at end of file diff --git a/src/components/sections/Readme.js b/src/components/sections/Readme.js new file mode 100644 index 0000000..8bcfa19 --- /dev/null +++ b/src/components/sections/Readme.js @@ -0,0 +1,15 @@ +import React from "react"; +import {FlexColumn} from "../../utils/containers"; +import {H2} from "../../utils/fonts"; + +const Readme = () => { + return ( + +

+ Readme +

+
+ ); +} + +export default Readme; \ No newline at end of file diff --git a/src/components/sections/Submit.js b/src/components/sections/Submit.js new file mode 100644 index 0000000..2adc2c5 --- /dev/null +++ b/src/components/sections/Submit.js @@ -0,0 +1,15 @@ +import React from "react"; +import {FlexColumn} from "../../utils/containers"; +import {H2} from "../../utils/fonts"; + +const Submit = () => { + return ( + +

+ Submit +

+
+ ); +} + +export default Submit; \ No newline at end of file diff --git a/src/pages/Challenge.js b/src/pages/Challenge.js index 641a4f7..8130523 100644 --- a/src/pages/Challenge.js +++ b/src/pages/Challenge.js @@ -1,24 +1,24 @@ import React from "react"; import {Container, FlexColumn, FlexRow} from "../utils/containers"; -import {Link, useParams} from "react-router-dom"; -import {H1, Medium} from "../utils/fonts"; +import {useParams} from "react-router-dom"; +import {H1} from "../utils/fonts"; import getChallenges from "../api/getChallenges"; import theme from "../utils/theme"; -import styled from "styled-components"; - -const ChallengeLink = styled(Medium)` - cursor: pointer; - transition: color 0.3s ease-in-out; - - &:hover { - color: ${({theme}) => theme.colors.green}; - } -`; - +import MobileChallengeMenu from "../components/elements/MobileChallengeMenu"; +import Leaderboard from "../components/sections/Leaderboard"; +import Readme from "../components/sections/Readme"; +import HowTo from "../components/sections/HowTo"; +import MyEntries from "../components/sections/MyEntries"; +import Submit from "../components/sections/Submit"; const Challenge = () => { const challengeName = useParams().challengeId; const [challenges, setChallenges] = React.useState([]); + const [section, setSection] = React.useState([0]); + + React.useEffect(() => { + getChallenges(setChallenges); + }, []); const getChallenge = () => { if (challenges.length !== 0) { @@ -30,35 +30,31 @@ const Challenge = () => { return ''; } - React.useEffect(() => { - getChallenges(setChallenges); - }, []); + const sectionRender = () => { + switch (section) { + case 0: + return + case 1: + return + case 2: + return + case 3: + return + case 4: + return + default: + return + } + } return (

{getChallenge().title}

- - - Leaderboard - - - Readme - - - How to - - - - - Submit - - - My entries - - + + {sectionRender()}
); }