diff --git a/app/views/home/controller.js b/app/views/home/controller.js index e47c963..7ba5dac 100644 --- a/app/views/home/controller.js +++ b/app/views/home/controller.js @@ -5,11 +5,8 @@ export class HomeController extends ViewController { // Super passes state, view name, and default state to ViewController, // which stores state in this.appState and the view controller's state to this.state super(state, 'home', { - messages: [ - 'hello', - 'test', - 'yay', - ], + recentReviews: [], + recentUpdates: [], }); // If using controller methods in an input's onchange or onclick instance, @@ -17,7 +14,10 @@ export class HomeController extends ViewController { // or use `onclick=${() => controller.submit()}` to maintain the 'this' of the class instead. } - get messages() { - return [...this.state.messages]; + get recentReviews() { + return [...this.state.recentReviews]; + } + get recentUpdates() { + return [...this.state.recentUpdates]; } } \ No newline at end of file diff --git a/app/views/home/index.js b/app/views/home/index.js index a1a1f25..af49c13 100644 --- a/app/views/home/index.js +++ b/app/views/home/index.js @@ -1,42 +1,18 @@ import html from 'choo/html'; -import './styles.scss'; // Creates a separate CSS file, but allows better code splitting. -// We'll see if code splitting is worth it in the end or if we should combine everything into `src/index.scss` import { HomeController } from './controller'; // The controller for this view, where processing should happen. +import { loggedOutView } from './loggedOut'; // This is the view function that is exported and used in the view manager. export const homeView = (state, emit) => { const controller = new HomeController(state); - const { i18n } = controller; // Returning an array in a view allows non-shared parent HTML elements. // This one doesn't have the problem right now, but it's good to remember. return [ - html`
-

${i18n.__('home.subtitle')}

- -
-
-
-
-

${i18n.__('home.temp_left')}

-
-
-
-
-
-
-

${i18n.__('home.temp_right')}

-
-
-
-
- -
- ${controller.messages.map(message => { - return html`

${message}

`; - })} -
-
`, + (!controller.isLoggedIn + ? loggedOutView(controller, emit) + : html`

lol wut how are u logged in

` + ), ]; } \ No newline at end of file diff --git a/app/views/home/loggedOut.js b/app/views/home/loggedOut.js new file mode 100644 index 0000000..91824e3 --- /dev/null +++ b/app/views/home/loggedOut.js @@ -0,0 +1,81 @@ +import html from 'choo/html'; + +export const loggedOutView = (homeController, emit) => { + return [ + html`
+

Read Together

+
+
+
+
+ + + +
+
+ Keep track of books you've read, want to read, and are currently reading. +
+
+
+
+
+
+ + + +
+
+ Share your thoughts about what you're reading and see what your friends think of their books. +
+
+
+
+
+
+ + + +
+ +
+
+
+
`, + html`
+

Join the Community

+
+
+
+
+

Recent Reviews

+ +
+
+ ${homeController.recentReviews.map(review => reviewCard(review))} +
+
+
+
+
+
+

Recent Updates

+ +
+ +
+
+
+
`, + html`
+ Join Now! +
`, + ]; +} \ No newline at end of file diff --git a/app/views/home/styles.scss b/app/views/home/styles.scss deleted file mode 100644 index e92a2b3..0000000 --- a/app/views/home/styles.scss +++ /dev/null @@ -1,8 +0,0 @@ -.test { - background-color: #dddddd; - padding: 10px; - - p { - border: 1px solid #444444; - } -} \ No newline at end of file