File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { Location } from '@reach/router'
1212const ChildrenList = styled . ul `
1313 height: calc(var(--open-ratio) * var(--calculated-height) * 1px);
1414 overflow: hidden;
15+ margin-left: 0;
1516`
1617
1718const ListItem = styled . li `
@@ -22,6 +23,7 @@ const ListItem = styled.li`
2223`
2324
2425const NavigationLink = styled ( GatsbyLink ) `
26+ padding-left: 0.5rem;
2527 ${ props => props . active == "t" && `
2628 background-color: #ffccc6;
2729 width: 100%;
@@ -101,7 +103,7 @@ export default class TreeViewItem extends React.Component {
101103 < NavigationLink
102104 to = { this . props . item . href }
103105 active = {
104- this . props . item . href == location . pathname ? 't' : 'f'
106+ ( this . props . item . href == location . pathname || this . props . item . href == location . pathname . slice ( 0 , - 1 ) ) ? 't' : 'f'
105107 }
106108 >
107109 < ListItem onClick = { this . onClick } >
Original file line number Diff line number Diff line change 11import React from 'react'
22import TreeViewItem from './TreeViewItem'
33import styled from 'styled-components'
4- import Scrollspy from 'react-scrollspy'
54
65const StyledUl = styled . ul `
7- margin-left: 0rem ;
6+ margin-left: 0 ;
87`
98
109export default class TreeView extends React . Component {
1110 render ( ) {
1211 return (
13- < Scrollspy
14- items = { [ 'yleistä' , 'kurssin-kaksi-versiota' , 'sisältö-ja-aikataulu' ] }
15- currentClassName = "is-current"
16- onUpdate = { element => {
17- document
18- . querySelectorAll ( '.active-section' )
19- . forEach ( e => e . classList . remove ( 'active-section' ) )
20- const selector = element . id
21- const current = document . querySelectorAll ( `.nav-item-${ selector } ` )
22- current . forEach ( e => e . classList . add ( 'active-section' ) )
23-
24- } }
25- >
26- < StyledUl >
27- { this . props . data . map ( top => < TreeViewItem key = { top . name } item = { top } spy /> ) }
28- </ StyledUl >
29- </ Scrollspy >
12+ < StyledUl >
13+ { this . props . data . map ( top => (
14+ < TreeViewItem key = { top . name } item = { top } spy />
15+ ) ) }
16+ </ StyledUl >
3017 )
3118 }
3219}
Original file line number Diff line number Diff line change @@ -200,22 +200,6 @@ const IndexPage = () => (
200200 </ p >
201201 </ section >
202202
203- < section id = "kurssi-vaylana" >
204- < h2 > Ohjelmoinnin MOOC väylänä yliopistoon</ h2 >
205-
206- < p >
207- Ohjelmoinnin MOOC toimii väylänä yliopistoon. Suorittamalla Ohjelmoinnin
208- MOOCin jokaisen osan tehtävistä yli 90 % annetussa aikataulussa, saat
209- kutsun Helsingin yliopistolla järjestettävään näyttökokeeseen. Näyttökokeessa
210- tehdään kurssin laajempia tehtäviä vastaava ohjelmointitehtävä sekä vastataan
211- muutamaan esseetyyppiseen kysymykseen.
212- </ p >
213-
214- < p >
215- Ohjelmoinnin MOOC on osa yhteishakua. Lisäämme tänne yhteishaun lähestyessä
216- ohjeita yhteishakulomakkeen täyttämiseen.
217- </ p >
218- </ section >
219203 </ Layout >
220204 </ ContentArea >
221205 </ Fragment >
You can’t perform that action at this time.
0 commit comments