Skip to content

Instantly share code, notes, and snippets.

@nicohvi
Created March 4, 2016 11:09
Show Gist options
  • Save nicohvi/6ff102856a096ab5cae0 to your computer and use it in GitHub Desktop.
Save nicohvi/6ff102856a096ab5cae0 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react'
import Lamell from './Lamell.js'
class Lamel extends Component {
}
export default class LamelModel extends Component {
onClick (lamelId) {
this.setState({ active: lamedId });
}
render () {
const { data } = this.props;
const { activeId } = this.state;
// burde abstraheres ut
return (<Lamell id={1} title="Steg 1" data={data} active={activeId === 1} onClick={() => this.onClick(id)}>Innhold steg 1</Lamell>
<Lamell id={2} title="Steg 2" data={data} active={activeId === 2} onClick={() => this.onClick(id)}>Innhold steg 2</Lamell>
<Lamell id={3} title="Steg 3" data={data} active={activeId === 3} onClick={() => this.onClick(id)}>Innhold steg 3</Lamell>
<Lamell id={4} title="Steg 4" data={data} active={activeId === 4} onClick={() => this.onClick(id)}>Innhold steg 4</Lamell>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment