 				},
 				Button(title: "Login", enabled: loginEnabled) {}
 					.selfAlignment(.FlexEnd)
-					.margin(Edges(bottom: 4)),
+					.margin(Edges(top: 10)),
 			])
 	}
 }

		])
}

func renderTemperatureConverter(component: Few.Component<ConverterState>, state: ConverterState) -> Element {
	let numberFormatter = NSNumberFormatter()
	let parseNumber: String -> CGFloat? = { str in
		return (numberFormatter.numberFromString(str)?.doubleValue).map { CGFloat($0) }

		])
}

enum Display {
	case Demo
	case Converter
}

func renderApp(component: Component<Display>, state: Display) -> Element {
	let contentComponent: Element
	switch state {
	case .Demo:
		contentComponent = Component(initialState: (), render: renderDemo)
	case .Converter:
		contentComponent = Component(initialState: ConverterState(), render: renderTemperatureConverter)
	}

	return Element()
		.justification(.Center)
		.childAlignment(.Center)
		.direction(.Column)
		.children([
			contentComponent,
			Button(title: "Switch!") { component.updateState(toggleDisplay) }
				.width(100)
				.margin(Edges(bottom: 20))
		])
}

func toggleDisplay(display: Display) -> Display {
	switch display {
	case .Demo:
		return .Converter
	case .Converter:
		return .Demo
	}
}

class AppDelegate: NSObject, NSApplicationDelegate {
	@IBOutlet weak var window: NSWindow!

	private let appComponent = Component(initialState: .Demo, render: renderApp)

	func applicationDidFinishLaunching(notification: NSNotification) {
		let contentView = window.contentView as! NSView
		appComponent.addToView(contentView)
	}
}
