Skip to content

Commit 91c6e8b

Browse files
committed
Code style
1 parent b86648b commit 91c6e8b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+699
-700
lines changed

.prettierrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"semi": false,
3-
"singleQuote": true,
4-
"trailingComma": "es5"
3+
"singleQuote": false,
4+
"trailingComma": "all"
55
}

src/components/Banner.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react'
2-
import styled from 'styled-components'
3-
import Bruce from '../images/banner.svg'
4-
import withSimpleErrorBoundary from '../util/withSimpleErrorBoundary'
1+
import React from "react"
2+
import styled from "styled-components"
3+
import Bruce from "../images/banner.svg"
4+
import withSimpleErrorBoundary from "../util/withSimpleErrorBoundary"
55

66
const BannerWrapper = styled.header`
77
height: 30rem;
@@ -21,9 +21,9 @@ const BannerWrapper = styled.header`
2121
`
2222

2323
const Heading = styled.div`
24-
font-family: 'Roboto Slab', -apple-system, BlinkMacSystemFont, 'Segoe UI',
25-
Roboto, 'Helvetica Neue', Arial, Noto Sans, sans-serif, 'Apple Color Emoji',
26-
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
24+
font-family: "Roboto Slab", -apple-system, BlinkMacSystemFont, "Segoe UI",
25+
Roboto, "Helvetica Neue", Arial, Noto Sans, sans-serif, "Apple Color Emoji",
26+
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
2727
font-weight: 500;
2828
font-size: 2rem;
2929
color: #c0392b;

src/components/Button.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import React from 'react'
2-
import { Link } from 'gatsby'
3-
import styled from 'styled-components'
4-
import { Button as MaterialButton } from '@material-ui/core'
5-
import withSimpleErrorBoundary from '../util/withSimpleErrorBoundary'
1+
import React from "react"
2+
import { Link } from "gatsby"
3+
import styled from "styled-components"
4+
import { Button as MaterialButton } from "@material-ui/core"
5+
import withSimpleErrorBoundary from "../util/withSimpleErrorBoundary"
66

77
const StyledLink = styled(Link)`
88
margin: 1rem 0.5rem;
99
`
1010

11-
const Button = ({ children, to, onClick, disabled, variant = 'outlined' }) => (
11+
const Button = ({ children, to, onClick, disabled, variant = "outlined" }) => (
1212
<StyledLink
1313
onClick={onClick}
1414
to={to === undefined ? false : to}

src/components/Container.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import styled from 'styled-components'
2-
import withSimpleErrorBoundary from '../util/withSimpleErrorBoundary'
1+
import styled from "styled-components"
2+
import withSimpleErrorBoundary from "../util/withSimpleErrorBoundary"
33

44
const Container = styled.div`
55
width: 90%;

src/components/ContentArea.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react'
2-
import styled from 'styled-components'
3-
import { SIDEBAR_WIDTH } from './Sidebar'
4-
import withSimpleErrorBoundary from '../util/withSimpleErrorBoundary'
1+
import React from "react"
2+
import styled from "styled-components"
3+
import { SIDEBAR_WIDTH } from "./Sidebar"
4+
import withSimpleErrorBoundary from "../util/withSimpleErrorBoundary"
55

66
const ContentAreaContainer = styled.main`
77
@media only screen and (min-width: 1200px) {

src/components/CoursePageFooter.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react'
2-
import styled from 'styled-components'
3-
import PagesInThisSection from '../partials/PagesInThisSection'
4-
import withSimpleErrorBoundary from '../util/withSimpleErrorBoundary'
1+
import React from "react"
2+
import styled from "styled-components"
3+
import PagesInThisSection from "../partials/PagesInThisSection"
4+
import withSimpleErrorBoundary from "../util/withSimpleErrorBoundary"
55

66
const CoursePageFooterWrapper = styled.footer`
77
background-color: white;
@@ -22,7 +22,7 @@ class CoursePageFooter extends React.Component {
2222
<CoursePageFooterWrapper>
2323
<CoursePageFooterContent>
2424
<PagesInThisSection
25-
style={{ width: '400px', fontSize: '0.8rem', margin: 0 }}
25+
style={{ width: "400px", fontSize: "0.8rem", margin: 0 }}
2626
/>
2727
</CoursePageFooterContent>
2828
</CoursePageFooterWrapper>

src/components/EndOfSubSection.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import React, { Fragment } from 'react'
2-
import styled from 'styled-components'
3-
import PagesContext from '../contexes/PagesContext'
4-
import { nthIndex } from '../util/strings'
5-
import { Link } from 'gatsby'
1+
import React, { Fragment } from "react"
2+
import styled from "styled-components"
3+
import PagesContext from "../contexes/PagesContext"
4+
import { nthIndex } from "../util/strings"
5+
import { Link } from "gatsby"
66

7-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
8-
import { faArrowRight as icon } from '@fortawesome/free-solid-svg-icons'
9-
import withSimpleErrorBoundary from '../util/withSimpleErrorBoundary'
7+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
8+
import { faArrowRight as icon } from "@fortawesome/free-solid-svg-icons"
9+
import withSimpleErrorBoundary from "../util/withSimpleErrorBoundary"
1010

1111
const StyledLink = styled(Link)`
1212
color: black;
@@ -47,7 +47,7 @@ class EndOfSubSection extends React.Component {
4747
{value => {
4848
const currentPath = value.current.path
4949
let sectionPath = currentPath
50-
const sectionSeparator = nthIndex(currentPath, '/', 2)
50+
const sectionSeparator = nthIndex(currentPath, "/", 2)
5151
if (sectionSeparator !== -1) {
5252
sectionPath = currentPath.substr(0, sectionSeparator)
5353
}
@@ -79,10 +79,10 @@ class EndOfSubSection extends React.Component {
7979
}
8080
return (
8181
<div>
82-
Pääsit aliluvun loppuun!{' '}
82+
Pääsit aliluvun loppuun!{" "}
8383
{nextPart && (
8484
<Fragment>
85-
Jatka tästä seuraavaan osaan:{' '}
85+
Jatka tästä seuraavaan osaan:{" "}
8686
<ButtonWrapper>
8787
<StyledLink to={nextPart.path}>
8888
<StyledIcon icon={icon} />

src/components/Footer.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import React from 'react'
2-
import styled from 'styled-components'
3-
import BackgroundImage from '../images/banner.svg'
4-
import { SIDEBAR_WIDTH } from './Sidebar'
5-
import { Card, CardContent } from '@material-ui/core'
6-
import { OutboundLink } from 'gatsby-plugin-google-analytics'
7-
import { Link } from 'gatsby'
1+
import React from "react"
2+
import styled from "styled-components"
3+
import BackgroundImage from "../images/banner.svg"
4+
import { SIDEBAR_WIDTH } from "./Sidebar"
5+
import { Card, CardContent } from "@material-ui/core"
6+
import { OutboundLink } from "gatsby-plugin-google-analytics"
7+
import { Link } from "gatsby"
88

9-
import withSimpleErrorBoundary from '../util/withSimpleErrorBoundary'
9+
import withSimpleErrorBoundary from "../util/withSimpleErrorBoundary"
1010

11-
import UHLogo from '../images/uh-logo.png'
12-
import MoocfiLogo from '../images/moocfi-logo-bw.png'
13-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
11+
import UHLogo from "../images/uh-logo.png"
12+
import MoocfiLogo from "../images/moocfi-logo-bw.png"
13+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
1414
import {
1515
faTwitter,
1616
faFacebook,
1717
faYoutube,
1818
faGithub,
19-
} from '@fortawesome/free-brands-svg-icons'
19+
} from "@fortawesome/free-brands-svg-icons"
2020

2121
const StyledIcon = styled(FontAwesomeIcon)`
2222
color: black;
@@ -118,7 +118,7 @@ class Footer extends React.Component {
118118
</OutboundLink>
119119
</GithubContainer>
120120
<ContentContainer>
121-
Kurssin on tehnyt Helsingin yliopiston{' '}
121+
Kurssin on tehnyt Helsingin yliopiston{" "}
122122
<OutboundLink
123123
href="https://www.helsinki.fi/en/researchgroups/data-driven-education"
124124
target="_blank"

src/components/Loading.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React, { Fragment } from 'react'
2-
import styled from 'styled-components'
1+
import React, { Fragment } from "react"
2+
import styled from "styled-components"
33

4-
import { CircularProgress } from '@material-ui/core'
5-
import withSimpleErrorBoundary from '../util/withSimpleErrorBoundary'
4+
import { CircularProgress } from "@material-ui/core"
5+
import withSimpleErrorBoundary from "../util/withSimpleErrorBoundary"
66

77
const LoadingWrapper = styled.div`
88
padding: 5rem;

src/components/LoginControls.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import React, { Fragment } from 'react'
2-
import Button from './Button'
3-
import { signOut, getCachedUserDetails } from '../services/moocfi'
1+
import React, { Fragment } from "react"
2+
import Button from "./Button"
3+
import { signOut, getCachedUserDetails } from "../services/moocfi"
44
import LoginStateContext, {
55
withLoginStateContext,
6-
} from '../contexes/LoginStateContext'
6+
} from "../contexes/LoginStateContext"
77

8-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
9-
import { faUser as profileIcon } from '@fortawesome/free-solid-svg-icons'
10-
import styled from 'styled-components'
11-
import withSimpleErrorBoundary from '../util/withSimpleErrorBoundary'
8+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
9+
import { faUser as profileIcon } from "@fortawesome/free-solid-svg-icons"
10+
import styled from "styled-components"
11+
import withSimpleErrorBoundary from "../util/withSimpleErrorBoundary"
1212

1313
const StyledIcon = styled(FontAwesomeIcon)`
1414
margin-right: 0.5rem;
@@ -27,9 +27,9 @@ class LoginControls extends React.Component {
2727
return
2828
}
2929
const details = await getCachedUserDetails()
30-
let name = `${details?.user_field?.first_name || ''} ${details?.user_field
31-
?.last_name || ''}`.trim()
32-
if (name === '') {
30+
let name = `${details?.user_field?.first_name || ""} ${details?.user_field
31+
?.last_name || ""}`.trim()
32+
if (name === "") {
3333
name = details.email
3434
}
3535
this.setState({
@@ -38,7 +38,7 @@ class LoginControls extends React.Component {
3838
}
3939

4040
state = {
41-
name: 'Loading...',
41+
name: "Loading...",
4242
}
4343

4444
render() {

src/components/Logo.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React from 'react'
2-
import logo from '../images/logo.png'
3-
import styled from 'styled-components'
4-
import 'typeface-open-sans-condensed'
5-
import withSimpleErrorBoundary from '../util/withSimpleErrorBoundary'
1+
import React from "react"
2+
import logo from "../images/logo.png"
3+
import styled from "styled-components"
4+
import "typeface-open-sans-condensed"
5+
import withSimpleErrorBoundary from "../util/withSimpleErrorBoundary"
66

77
const LogoImg = styled.img`
88
width: 50px;
@@ -13,7 +13,7 @@ const LogoImg = styled.img`
1313

1414
const LogoTypography = styled.div`
1515
flex: 1;
16-
font-family: 'Open Sans Condensed', sans-serif !important;
16+
font-family: "Open Sans Condensed", sans-serif !important;
1717
font-size: 1.75rem !important;
1818
`
1919

src/components/MailinglistForm.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React from 'react'
2-
import styled from 'styled-components'
1+
import React from "react"
2+
import styled from "styled-components"
33

4-
import { TextField, Button } from '@material-ui/core'
5-
import withSimpleErrorBoundary from '../util/withSimpleErrorBoundary'
4+
import { TextField, Button } from "@material-ui/core"
5+
import withSimpleErrorBoundary from "../util/withSimpleErrorBoundary"
66

77
const Container = styled.div`
88
padding: 3rem;

src/components/PointsBalloon/PointsBalloonBalloon.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React from 'react'
2-
import withSimpleErrorBoundary from '../../util/withSimpleErrorBoundary'
3-
import Fab from '@material-ui/core/Fab'
4-
import styled from 'styled-components'
5-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
6-
import { faChartLine as icon } from '@fortawesome/free-solid-svg-icons'
1+
import React from "react"
2+
import withSimpleErrorBoundary from "../../util/withSimpleErrorBoundary"
3+
import Fab from "@material-ui/core/Fab"
4+
import styled from "styled-components"
5+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
6+
import { faChartLine as icon } from "@fortawesome/free-solid-svg-icons"
77

88
const StyledIcon = styled(FontAwesomeIcon)`
99
color: white;

src/components/PointsBalloon/PointsBalloonContent.js

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import React, { Fragment } from 'react'
2-
import LoginStateContext from '../../contexes/LoginStateContext'
3-
import withSimpleErrorBoundary from '../../util/withSimpleErrorBoundary'
4-
import { Modal, Paper, Button } from '@material-ui/core'
5-
import styled from 'styled-components'
6-
import { OutboundLink } from 'gatsby-plugin-google-analytics'
7-
import Loading from '../Loading'
8-
1+
import React, { Fragment } from "react"
2+
import LoginStateContext from "../../contexes/LoginStateContext"
3+
import withSimpleErrorBoundary from "../../util/withSimpleErrorBoundary"
4+
import { Modal, Paper, Button } from "@material-ui/core"
5+
import styled from "styled-components"
6+
import { OutboundLink } from "gatsby-plugin-google-analytics"
7+
import Loading from "../Loading"
98

109
const StyledModal = styled(Modal)`
1110
z-index: 500 !important;
@@ -35,8 +34,8 @@ const Title = styled.h1`
3534
`
3635

3736
const data = [
38-
{ group: 'Osa 1', Ohjelmointitehtävät: 80, Kyselyt: 20 },
39-
{ group: 'Osa 2', Ohjelmointitehtävät: 30, Kyselyt: 40 },
37+
{ group: "Osa 1", Ohjelmointitehtävät: 80, Kyselyt: 20 },
38+
{ group: "Osa 2", Ohjelmointitehtävät: 30, Kyselyt: 40 },
4039
]
4140

4241
class PointsBalloonContent extends React.Component {
@@ -69,12 +68,14 @@ class PointsBalloonContent extends React.Component {
6968
<p>
7069
Tähän tulee visualisaatio edistymisestäsi heti kun olemme
7170
saaneet tämän ominaisuuden toteutettua. Odotellessasi voit
72-
tutkia edistymisestäsi ohjelmointitehtävissä
73-
TMC:ssä:{' '}
71+
tutkia edistymisestäsi ohjelmointitehtävissä TMC:ssä:{" "}
7472
<OutboundLink href="https://tmc.mooc.fi/participants/me">
7573
https://tmc.mooc.fi/participants/me
7674
</OutboundLink>
77-
. Huomaathan, että pisteisiisi vaikuttaa muutkin tehtävät kuin ohjelmointitehtävät, kuten vaikka materiaalin seassa olevat kyselyt. Näiden tehtävien pisteet eivät näy TMC:ssä. Kiitos kärsivällisyydestäsi!
75+
. Huomaathan, että pisteisiisi vaikuttaa muutkin tehtävät kuin
76+
ohjelmointitehtävät, kuten vaikka materiaalin seassa olevat
77+
kyselyt. Näiden tehtävien pisteet eivät näy TMC:ssä. Kiitos
78+
kärsivällisyydestäsi!
7879
</p>
7980
</Fragment>
8081
</Loading>

src/components/PointsBalloon/index.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React, { Fragment } from 'react'
2-
import LoginStateContext from '../../contexes/LoginStateContext'
3-
import withSimpleErrorBoundary from '../../util/withSimpleErrorBoundary'
4-
import styled from 'styled-components'
1+
import React, { Fragment } from "react"
2+
import LoginStateContext from "../../contexes/LoginStateContext"
3+
import withSimpleErrorBoundary from "../../util/withSimpleErrorBoundary"
4+
import styled from "styled-components"
55

6-
import PointsBalloonBalloon from './PointsBalloonBalloon'
7-
import PointsBalloonContent from './PointsBalloonContent'
6+
import PointsBalloonBalloon from "./PointsBalloonBalloon"
7+
import PointsBalloonContent from "./PointsBalloonContent"
88

99
const PoitsBalloonContainer = styled.div`
1010
position: fixed;

0 commit comments

Comments
 (0)