Permalink
Browse files

Merge pull request #14 from kevgathuku/landing-elm

Port landing page component to Elm
  • Loading branch information...
kevgathuku committed May 23, 2017
2 parents ce1de0b + 4a349f0 commit 80ddc789ab5ce81b4e65acd8d070730372a91c4b
@@ -0,0 +1,47 @@
module Landing exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
type alias Model =
{ authLink : String
}
model : Model
model =
{ authLink = "/auth" }
update msg model =
model
main =
beginnerProgram { model = model, view = view, update = update }
view : Model -> Html msg
view model =
div [ id "hero" ]
[ div [ class "container", id "hero-text-container" ]
[ div [ class "row" ]
[ div [ class "col s12 center-align" ]
[ h1 [ id "hero-title" ]
[ span [ class "bold" ] [ text "Docue " ]
, span [ class "thin" ] [ text "is the simplest way for" ]
, br [] []
, span [ class "thin" ] [ text "you to manage your documents online" ]
]
]
]
, div [ class "row" ]
[ div [ class "col s12" ]
[ div [ class "center-align" ]
[ a [ class "btn btn-large create-list-link hero-btn", href model.authLink ] [ text "Get Started" ]
]
]
]
]
]
@@ -0,0 +1,13 @@
import React from 'react';
import Elm from 'react-elm-components';
import { Landing } from '../Landing.elm';
// Requires the CSS for it to be included in the final output
import 'react-select/dist/react-select.css';
import '../../styles/style.css';
export default class Main extends React.PureComponent {
render() {
return <Elm src={Landing} />;
}
}

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -13,7 +13,7 @@ import CreateDocument from './components/CreateDocument/index.jsx';
import CreateRole from './components/CreateRole/index.jsx';
import DocumentPage from './components/DocumentPage/index.jsx';
import Dashboard from './components/Dashboard/index.jsx';
import Landing from './components/Landing/index.jsx';
import Landing from './components/Landing/Landing.jsx';
import Profile from './components/Profile/Profile.jsx';
import Main from './components/Landing/Main.jsx';
import NotFound from './components/NotFound/NotFound.jsx';
@@ -2,28 +2,43 @@ module Tests exposing (..)
import Test exposing (..)
import Expect
import NotFound
import Html
import Html.Attributes exposing (class)
import Test.Html.Query as Query
import Test.Html.Selector exposing (text, tag)
import Test.Html.Selector exposing (attribute, text, tag)
import Landing
import NotFound
all : Test
all =
describe "Sample Test Suite"
[ describe "Not Found"
[ test "Correctly Renders Model Content" <|
\() ->
NotFound.view "Nothing"
|> Query.fromHtml
|> Query.find [ tag "h2" ]
|> Query.has [ text "Nothing" ]
, test "Renders static text" <|
\() ->
NotFound.view "Nothing"
|> Query.fromHtml
|> Query.find [ tag "p" ]
|> Query.has [ text "Sorry. This is not the page you were looking for" ]
]
describe "Docue Test Suite"
[ notFound, landing ]
notFound : Test
notFound =
describe "Not Found"
[ test "Correctly Renders Model Content" <|
\() ->
NotFound.view "Nothing"
|> Query.fromHtml
|> Query.find [ tag "h2" ]
|> Query.has [ text "Nothing" ]
, test "Renders static text" <|
\() ->
NotFound.view "Nothing"
|> Query.fromHtml
|> Query.find [ tag "p" ]
|> Query.has [ text "Sorry. This is not the page you were looking for" ]
]
landing : Test
landing =
describe "Landing"
[ test "Correctly Renders Model Content" <|
\() ->
Landing.view { authLink = "/authenticate" }
|> Query.fromHtml
|> Query.find [ attribute "href" "/authenticate" ]
|> Query.has [ text "Get Started" ]
]

0 comments on commit 80ddc78

Please sign in to comment.